Complete improve performance of table drawing.

This commit is contained in:
Fedor 2020-06-10 21:11:38 +03:00
parent 1d760290a6
commit 6a49e31e07
170 changed files with 824 additions and 822 deletions

View File

@ -721,7 +721,6 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
: mReferenceFrame(aReferenceFrame),
mIgnoreScrollFrame(nullptr),
mLayerEventRegions(nullptr),
mCurrentTableItem(nullptr),
mCurrentFrame(aReferenceFrame),
mCurrentReferenceFrame(aReferenceFrame),
mCurrentAGR(&mRootAGR),
@ -731,6 +730,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mGlassDisplayItem(nullptr),
mScrollInfoItemsForHoisting(nullptr),
mMode(aMode),
mTableBackgroundSet(nullptr),
mCurrentScrollParentId(FrameMetrics::NULL_SCROLL_ID),
mCurrentScrollbarTarget(FrameMetrics::NULL_SCROLL_ID),
mCurrentScrollbarFlags(0),
@ -864,10 +864,9 @@ nsDisplayListBuilder::FindAnimatedGeometryRootFor(nsDisplayItem* aItem)
void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
nsIFrame* aFrame,
const nsRect& aDirtyRect)
nsIFrame* aFrame)
{
nsRect dirtyRectRelativeToDirtyFrame = aDirtyRect;
nsRect dirtyRectRelativeToDirtyFrame = GetDirtyRect();
if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(aFrame) &&
IsPaintingToWindow()) {
NS_ASSERTION(aDirtyFrame == aFrame->GetParent(), "Dirty frame should be viewport frame");
@ -882,6 +881,7 @@ void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
dirtyRectRelativeToDirtyFrame.SizeTo(aDirtyFrame->GetSize());
}
}
nsRect dirty = dirtyRectRelativeToDirtyFrame - aFrame->GetOffsetTo(aDirtyFrame);
nsRect overflowRect = aFrame->GetVisualOverflowRect();
@ -925,7 +925,6 @@ nsDisplayListBuilder::~nsDisplayListBuilder() {
"All frames should have been unmarked");
NS_ASSERTION(mPresShellStates.Length() == 0,
"All presshells should have been exited");
NS_ASSERTION(!mCurrentTableItem, "No table item should be active");
nsCSSRendering::EndFrameTreesLocked();
@ -1008,8 +1007,22 @@ nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
}
state->mInsidePointerEventsNoneDoc = pointerEventsNone;
if (!buildCaret)
state->mPresShellIgnoreScrollFrame =
state->mPresShell->IgnoringViewportScrolling()
? state->mPresShell->GetRootScrollFrame()
: nullptr;
nsPresContext* pc = aReferenceFrame->PresContext();
nsCOMPtr<nsIDocShell> docShell = pc->GetDocShell();
if (docShell) {
docShell->GetWindowDraggingAllowed(&mWindowDraggingAllowed);
}
mIsInChromePresContext = pc->IsChrome();
if (!buildCaret) {
return;
}
RefPtr<nsCaret> caret = state->mPresShell->GetCaret();
state->mCaretFrame = caret->GetPaintGeometry(&state->mCaretRect);
@ -1017,13 +1030,6 @@ nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
mFramesMarkedForDisplay.AppendElement(state->mCaretFrame);
MarkFrameForDisplay(state->mCaretFrame, nullptr);
}
nsPresContext* pc = aReferenceFrame->PresContext();
nsCOMPtr<nsIDocShell> docShell = pc->GetDocShell();
if (docShell) {
docShell->GetWindowDraggingAllowed(&mWindowDraggingAllowed);
}
mIsInChromePresContext = pc->IsChrome();
}
// A non-blank paint is a paint that does not just contain the canvas background.
@ -1094,8 +1100,7 @@ nsDisplayListBuilder::ResetMarkedFramesForDisplayList()
void
nsDisplayListBuilder::MarkFramesForDisplayList(nsIFrame* aDirtyFrame,
const nsFrameList& aFrames,
const nsRect& aDirtyRect) {
const nsFrameList& aFrames) {
for (nsIFrame* e : aFrames) {
// Skip the AccessibleCaret frame when building no caret.
if (!IsBuildingCaret()) {
@ -1107,9 +1112,8 @@ nsDisplayListBuilder::MarkFramesForDisplayList(nsIFrame* aDirtyFrame,
}
}
}
mFramesMarkedForDisplay.AppendElement(e);
MarkOutOfFlowFrameForDisplay(aDirtyFrame, e, aDirtyRect);
MarkOutOfFlowFrameForDisplay(aDirtyFrame, e);
}
}
@ -2573,8 +2577,7 @@ static nsStyleContext* GetBackgroundStyleContext(nsIFrame* aFrame)
/* static */ void
SetBackgroundClipRegion(DisplayListClipState::AutoSaveRestore& aClipState,
nsIFrame* aFrame, const nsPoint& aToReferenceFrame,
const nsStyleImageLayers::Layer& aLayer,
nsIFrame* aFrame, const nsStyleImageLayers::Layer& aLayer,
const nsRect& aBackgroundRect,
bool aWillPaintBorder)
{
@ -2626,7 +2629,6 @@ SpecialCutoutRegionCase(nsDisplayListBuilder* aBuilder,
return true;
}
/*static*/ bool
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
@ -2635,14 +2637,16 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
bool aAllowWillPaintBorderOptimization,
nsStyleContext* aStyleContext,
const nsRect& aBackgroundOriginRect,
nsIFrame* aSecondaryReferenceFrame)
nsIFrame* aSecondaryReferenceFrame,
Maybe<nsDisplayListBuilder::AutoBuildingDisplayList>*
aAutoBuildingDisplayList)
{
nsStyleContext* bgSC = aStyleContext;
const nsStyleBackground* bg = nullptr;
nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame);
nsRect bgRect = aBackgroundRect;
nsRect bgOriginRect = bgRect;
if (!aBackgroundOriginRect.IsEmpty()) {
bgOriginRect = aBackgroundOriginRect + aBuilder->ToReferenceFrame(aFrame);
bgOriginRect = aBackgroundOriginRect;
}
nsPresContext* presContext = aFrame->PresContext();
bool isThemed = aFrame->IsThemed();
@ -2678,8 +2682,6 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
!isThemed && !hasInsetShadow &&
borderStyle->HasBorder();
nsPoint toRef = aBuilder->ToReferenceFrame(aFrame);
// An auxiliary list is necessary in case we have background blending; if that
// is the case, background items need to be wrapped by a blend container to
// isolate blending to the background
@ -2688,6 +2690,9 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
// to create an item for hit testing.
if ((drawBackgroundColor && color != NS_RGBA(0,0,0,0)) ||
aBuilder->IsForEventDelivery()) {
if (aAutoBuildingDisplayList && !*aAutoBuildingDisplayList) {
aAutoBuildingDisplayList->emplace(aBuilder, aFrame);
}
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (bg && !aBuilder->IsForEventDelivery()) {
// Disable the will-paint-border optimization for background
@ -2699,7 +2704,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
// artifacts along the rounded corners.
bool useWillPaintBorderOptimization = willPaintBorder &&
nsLayoutUtils::HasNonZeroCorner(borderStyle->mBorderRadius);
SetBackgroundClipRegion(clipState, aFrame, toRef,
SetBackgroundClipRegion(clipState, aFrame,
bg->BottomLayer(), bgRect,
useWillPaintBorderOptimization);
}
@ -2752,6 +2757,10 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
continue;
}
if (aAutoBuildingDisplayList && !*aAutoBuildingDisplayList) {
aAutoBuildingDisplayList->emplace(aBuilder, aFrame);
}
if (bg->mImage.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
needBlendContainer = true;
}
@ -2759,8 +2768,8 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (!aBuilder->IsForEventDelivery()) {
const nsStyleImageLayers::Layer& layer = bg->mImage.mLayers[i];
SetBackgroundClipRegion(clipState, aFrame, toRef,
layer, bgRect, willPaintBorder);
SetBackgroundClipRegion(clipState, aFrame, layer, bgRect,
willPaintBorder);
}
nsDisplayList thisItemList;

View File

@ -48,6 +48,7 @@ class nsISelection;
class nsIScrollableFrame;
class nsDisplayLayerEventRegions;
class nsDisplayScrollInfoLayer;
class nsDisplayTableBackgroundSet;
class nsCaret;
namespace mozilla {
@ -444,6 +445,10 @@ public:
* BuildDisplayList on right now).
*/
const nsRect& GetDirtyRect() { return mDirtyRect; }
void SetDirtyRect(const nsRect& aDirtyRect) { mDirtyRect = aDirtyRect; }
void IntersectDirtyRect(const nsRect& aDirtyRect) { mDirtyRect.IntersectRect(mDirtyRect, aDirtyRect); }
const nsIFrame* GetCurrentFrame() { return mCurrentFrame; }
const nsIFrame* GetCurrentReferenceFrame() { return mCurrentReferenceFrame; }
const nsPoint& GetCurrentFrameOffsetToReferenceFrame() { return mCurrentOffsetToReferenceFrame; }
@ -493,11 +498,10 @@ public:
/**
* Display the caret if needed.
*/
void DisplayCaret(nsIFrame* aFrame, const nsRect& aDirtyRect,
nsDisplayList* aList) {
void DisplayCaret(nsIFrame* aFrame, nsDisplayList* aList) {
nsIFrame* frame = GetCaretFrame();
if (aFrame == frame) {
frame->DisplayCaret(this, aDirtyRect, aList);
frame->DisplayCaret(this, aList);
}
}
/**
@ -517,6 +521,14 @@ public:
* Get the caret associated with the current presshell.
*/
nsCaret* GetCaret();
/**
* Returns the root scroll frame for the current PresShell, if the PresShell
* is ignoring viewport scrolling.
*/
nsIFrame* GetPresShellIgnoreScrollFrame() {
return CurrentPresShellState()->mPresShellIgnoreScrollFrame;
}
/**
* Notify the display list builder that we're entering a presshell.
* aReferenceFrame should be a frame in the new presshell.
@ -577,6 +589,16 @@ public:
mSyncDecodeImages = aSyncDecodeImages;
}
nsDisplayTableBackgroundSet* SetTableBackgroundSet(
nsDisplayTableBackgroundSet* aTableSet) {
nsDisplayTableBackgroundSet* old = mTableBackgroundSet;
mTableBackgroundSet = aTableSet;
return old;
}
nsDisplayTableBackgroundSet* GetTableBackgroundSet() const {
return mTableBackgroundSet;
}
/**
* Helper method to generate background painting flags based on the
* information available in the display list builder. Currently only
@ -602,8 +624,7 @@ public:
* destroyed.
*/
void MarkFramesForDisplayList(nsIFrame* aDirtyFrame,
const nsFrameList& aFrames,
const nsRect& aDirtyRect);
const nsFrameList& aFrames);
/**
* Mark all child frames that Preserve3D() as needing display.
* Because these frames include transforms set on their parent, dirty rects
@ -700,8 +721,12 @@ public:
friend class AutoBuildingDisplayList;
class AutoBuildingDisplayList {
public:
AutoBuildingDisplayList(nsDisplayListBuilder* aBuilder,
nsIFrame* aForChild,
AutoBuildingDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame* aForChild)
: AutoBuildingDisplayList(
aBuilder, aForChild, aBuilder->GetDirtyRect(), aForChild->IsTransformed()){}
AutoBuildingDisplayList(nsDisplayListBuilder* aBuilder, nsIFrame* aForChild,
const nsRect& aDirtyRect, bool aIsRoot)
: mBuilder(aBuilder),
mPrevFrame(aBuilder->mCurrentFrame),
@ -803,10 +828,11 @@ public:
friend class AutoSaveRestorePerspectiveIndex;
class AutoSaveRestorePerspectiveIndex {
public:
AutoSaveRestorePerspectiveIndex(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
AutoSaveRestorePerspectiveIndex(nsDisplayListBuilder* aBuilder,
const bool aChildrenHavePerspective)
: mBuilder(nullptr)
{
if (aFrame->ChildrenHavePerspective()) {
if (aChildrenHavePerspective) {
mBuilder = aBuilder;
mCachedItemIndex = aBuilder->mPerspectiveItemIndex;
aBuilder->mPerspectiveItemIndex = 0;
@ -981,10 +1007,6 @@ public:
return mPreserves3DCtx.mAccumulatedRectLevels;
}
// Helpers for tables
nsDisplayTableItem* GetCurrentTableItem() { return mCurrentTableItem; }
void SetCurrentTableItem(nsDisplayTableItem* aTableItem) { mCurrentTableItem = aTableItem; }
struct OutOfFlowDisplayData {
OutOfFlowDisplayData(const DisplayItemClip* aContainingBlockClip,
const DisplayItemScrollClip* aContainingBlockScrollClip,
@ -1120,11 +1142,11 @@ public:
Preserves3DContext mSavedCtx;
};
const nsRect GetPreserves3DDirtyRect(const nsIFrame *aFrame) const {
const nsRect GetPreserves3DRects() const {
return mPreserves3DCtx.mDirtyRect;
}
void SetPreserves3DDirtyRect(const nsRect &aDirtyRect) {
mPreserves3DCtx.mDirtyRect = aDirtyRect;
void SavePreserves3DRects() {
mPreserves3DCtx.mDirtyRect = mDirtyRect;
}
bool IsBuildingInvisibleItems() const { return mBuildingInvisibleItems; }
@ -1133,8 +1155,7 @@ public:
}
private:
void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
const nsRect& aDirtyRect);
void MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame);
/**
* Returns whether a frame acts as an animated geometry root, optionally
@ -1178,6 +1199,7 @@ private:
// in the document, and is set when we enter a subdocument for a pointer-
// events:none frame.
bool mInsidePointerEventsNoneDoc;
nsIFrame* mPresShellIgnoreScrollFrame;
};
PresShellState* CurrentPresShellState() {
@ -1202,7 +1224,6 @@ private:
AutoTArray<PresShellState,8> mPresShellStates;
AutoTArray<nsIFrame*,400> mFramesMarkedForDisplay;
AutoTArray<ThemeGeometry,2> mThemeGeometries;
nsDisplayTableItem* mCurrentTableItem;
DisplayListClipState mClipState;
// mCurrentFrame is the frame that we're currently calling (or about to call)
// BuildDisplayList on.
@ -1245,6 +1266,7 @@ private:
nsTArray<DisplayItemScrollClip*> mScrollClipsToDestroy;
nsTArray<DisplayItemClip*> mDisplayItemClipsToDestroy;
nsDisplayListBuilderMode mMode;
nsDisplayTableBackgroundSet* mTableBackgroundSet;
ViewID mCurrentScrollParentId;
ViewID mCurrentScrollbarTarget;
uint32_t mCurrentScrollbarFlags;
@ -2287,12 +2309,13 @@ protected:
* to the object, and all distinct.
*/
struct nsDisplayListCollection : public nsDisplayListSet {
nsDisplayListCollection() :
nsDisplayListSet(&mLists[0], &mLists[1], &mLists[2], &mLists[3], &mLists[4],
&mLists[5]) {}
explicit nsDisplayListCollection(nsDisplayList* aBorderBackground) :
nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
explicit nsDisplayListCollection(nsDisplayListBuilder* aBuilder)
: nsDisplayListSet(&mLists[0], &mLists[1], &mLists[2], &mLists[3], &mLists[4],
&mLists[5]) {}
explicit nsDisplayListCollection(nsDisplayListBuilder* aBuilder,
nsDisplayList* aBorderBackground)
: nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
&mLists[5]) {}
/**
* Sort all lists by content order.
@ -2739,7 +2762,9 @@ public:
bool aAllowWillPaintBorderOptimization = true,
nsStyleContext* aStyleContext = nullptr,
const nsRect& aBackgroundOriginRect = nsRect(),
nsIFrame* aSecondaryReferenceFrame = nullptr);
nsIFrame* aSecondaryReferenceFrame = nullptr,
mozilla::Maybe<nsDisplayListBuilder::AutoBuildingDisplayList>*
aAutoBuildingDisplayList = nullptr);
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,

View File

@ -3111,7 +3111,8 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
}
builder.EnterPresShell(aFrame);
aFrame->BuildDisplayListForStackingContext(&builder, aRect, &list);
builder.SetDirtyRect(aRect);
aFrame->BuildDisplayListForStackingContext(&builder, &list);
builder.LeavePresShell(aFrame, nullptr);
#ifdef MOZ_DUMP_PAINTING
@ -3460,7 +3461,8 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
PROFILER_LABEL("nsLayoutUtils", "PaintFrame::BuildDisplayList",
js::ProfileEntry::Category::GRAPHICS);
aFrame->BuildDisplayListForStackingContext(&builder, dirtyRect, &list);
builder.SetDirtyRect(dirtyRect);
aFrame->BuildDisplayListForStackingContext(&builder, &list);
}
nsIAtom* frameType = aFrame->GetType();

View File

@ -4868,8 +4868,8 @@ PresShell::CreateRangePaintInfo(nsIDOMRange* aRange,
nsIFrame* frame = aNode->AsContent()->GetPrimaryFrame();
// XXX deal with frame being null due to display:contents
for (; frame; frame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(frame)) {
frame->BuildDisplayListForStackingContext(&info->mBuilder,
frame->GetVisualOverflowRect(), &info->mList);
info->mBuilder.SetDirtyRect(frame->GetVisualOverflowRect());
frame->BuildDisplayListForStackingContext(&info->mBuilder, &info->mList);
}
};
if (startParent->NodeType() == nsIDOMNode::TEXT_NODE) {

View File

@ -263,8 +263,8 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
nsDisplayButtonBoxShadowOuter(aBuilder, this));
}
nsRect buttonRect;
GetButtonRect(mFrame->GetRectRelativeToSelf(), buttonRect);
nsRect buttonRect =
mFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(mFrame);
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, mFrame, buttonRect, aBackground);

View File

@ -1295,7 +1295,6 @@ public:
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
protected:
@ -1336,11 +1335,10 @@ nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
void
nsComboboxDisplayFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayListCollection set;
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, set);
nsDisplayListCollection set(aBuilder);
nsBlockFrame::BuildDisplayList(aBuilder, set);
// remove background items if parent frame is themed
if (mComboBox->IsThemed()) {
@ -1541,13 +1539,8 @@ void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder,
void
nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
#ifdef NOISY
printf("%p paint at (%d, %d, %d, %d)\n", this,
aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);
#endif
if (aBuilder->IsForEventDelivery()) {
// Don't allow children to receive events.
@ -1556,7 +1549,7 @@ nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} else {
// REVIEW: Our in-flow child frames are inline-level so they will paint in our
// content list, so we don't need to mess with layers.
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsBlockFrame::BuildDisplayList(aBuilder, aLists);
}
// draw a focus indicator only when focus rings should be drawn

View File

@ -92,7 +92,6 @@ public:
nsEventStatus* aEventStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void PaintFocus(DrawTarget& aDrawTarget, nsPoint aPt);

View File

@ -153,7 +153,6 @@ nsDisplayFieldSetBorderBackground::ComputeInvalidationRegion(nsDisplayListBuilde
void
nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
// Paint our background and border in a special way.
// REVIEW: We don't really need to check frame emptiness here; if it's empty,
@ -166,9 +165,11 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsDisplayBoxShadowOuter(aBuilder, this));
}
const nsRect rect =
VisualBorderRectRelativeToSelf() + aBuilder->ToReferenceFrame(this);
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, this, VisualBorderRectRelativeToSelf(),
aLists.BorderBackground(),
aBuilder, this, rect, aLists.BorderBackground(),
/* aAllowWillPaintBorderOptimization = */ false);
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
@ -180,10 +181,10 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
DisplayOverflowContainers(aBuilder, aLists);
}
nsDisplayListCollection contentDisplayItems;
nsDisplayListCollection contentDisplayItems(aBuilder);
if (nsIFrame* inner = GetInner()) {
// Collect the inner frame's display items into their own collection.
// We need to be calling BuildDisplayList on it before the legend in
@ -191,13 +192,13 @@ nsFieldSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// legend. However, we want the inner frame's display items to be
// after the legend's display items in z-order, so we need to save them
// and append them later.
BuildDisplayListForChild(aBuilder, inner, aDirtyRect, contentDisplayItems);
BuildDisplayListForChild(aBuilder, inner, contentDisplayItems);
}
if (nsIFrame* legend = GetLegend()) {
// The legend's background goes on our BlockBorderBackgrounds list because
// it's a block child.
nsDisplayListSet set(aLists, aLists.BlockBorderBackgrounds());
BuildDisplayListForChild(aBuilder, legend, aDirtyRect, set);
BuildDisplayListForChild(aBuilder, legend, set);
}
// Put the inner frame's display items on the master list. Note that this
// moves its border/background display items to our BorderBackground() list,

View File

@ -53,7 +53,6 @@ public:
nscoord* aBaseline) const override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,

View File

@ -485,10 +485,9 @@ nsFileControlFrame::SetFormProperty(nsIAtom* aName,
void
nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
}
#ifdef ACCESSIBILITY

View File

@ -33,7 +33,6 @@ public:
nsIFrame* aPrevInFlow) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
NS_DECL_QUERYFRAME

View File

@ -40,7 +40,6 @@ public:
// nsIFrame replacements
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {
DO_GLOBAL_REFLOW_COUNT_DSP("nsFormControlFrame");
DisplayBorderBackgroundOutline(aBuilder, aLists);

View File

@ -107,10 +107,9 @@ nsGfxCheckboxControlFrame::AccessibleType()
//------------------------------------------------------------
void
nsGfxCheckboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsFormControlFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsFormControlFrame::BuildDisplayList(aBuilder, aLists);
// Get current checked state through content model.
if ((!IsChecked() && !IsIndeterminate()) || !IsVisibleForPainting(aBuilder))

View File

@ -23,7 +23,6 @@ public:
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
#ifdef ACCESSIBILITY

View File

@ -70,10 +70,9 @@ PaintCheckedRadioButton(nsIFrame* aFrame,
void
nsGfxRadioControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsFormControlFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsFormControlFrame::BuildDisplayList(aBuilder, aLists);
if (!IsVisibleForPainting(aBuilder))
return;

View File

@ -25,7 +25,6 @@ public:
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
};

View File

@ -98,7 +98,6 @@ nsHTMLButtonControlFrame::ShouldClipPaintingToBorderBox()
void
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Clip to our border area for event hit testing.
@ -117,7 +116,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
}
nsDisplayListCollection set;
nsDisplayListCollection set(aBuilder);
// Do not allow the child subtree to receive events.
if (!isForEventDelivery) {
@ -132,7 +131,7 @@ nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipState.ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
// That should put the display items in set.Content()
}

View File

@ -27,7 +27,6 @@ public:
NS_DECL_FRAMEARENA_HELPERS
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;

View File

@ -155,7 +155,6 @@ nsListControlFrame::DestroyFrom(nsIFrame* aDestructRoot)
void
nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// We allow visibility:hidden <select>s to contain visible options.
@ -180,7 +179,7 @@ nsListControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mLastDropdownBackstopColor));
}
nsHTMLScrollFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsHTMLScrollFrame::BuildDisplayList(aBuilder, aLists);
}
/**

View File

@ -81,7 +81,6 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsContainerFrame* GetContentInsertionFrame() override;

View File

@ -98,10 +98,9 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
void
nsProgressFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
}
void

View File

@ -32,7 +32,6 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aCX,

View File

@ -255,7 +255,6 @@ nsDisplayRangeFocusRing::Paint(nsDisplayListBuilder* aBuilder,
void
nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (IsThemed()) {
@ -270,10 +269,10 @@ nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsIFrame* thumb = mThumbDiv->GetPrimaryFrame();
if (thumb) {
nsDisplayListSet set(aLists, aLists.Content());
BuildDisplayListForChild(aBuilder, thumb, aDirtyRect, set, DISPLAY_CHILD_INLINE);
BuildDisplayListForChild(aBuilder, thumb, set, DISPLAY_CHILD_INLINE);
}
} else {
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
}
// Draw a focus outline if appropriate:

View File

@ -43,7 +43,6 @@ public:
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,

View File

@ -126,16 +126,15 @@ public:
void
nsSelectsAreaFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!aBuilder->IsForEventDelivery()) {
BuildDisplayListInternal(aBuilder, aDirtyRect, aLists);
BuildDisplayListInternal(aBuilder, aLists);
return;
}
nsDisplayListCollection set;
BuildDisplayListInternal(aBuilder, aDirtyRect, set);
nsDisplayListCollection set(aBuilder);
BuildDisplayListInternal(aBuilder, set);
nsOptionEventGrabberWrapper wrapper;
wrapper.WrapLists(aBuilder, this, set, aLists);
@ -143,10 +142,9 @@ nsSelectsAreaFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
void
nsSelectsAreaFrame::BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsBlockFrame::BuildDisplayList(aBuilder, aLists);
nsListControlFrame* listFrame = GetEnclosingListFrame(this);
if (listFrame && listFrame->IsFocused()) {

View File

@ -18,11 +18,9 @@ public:
nsFrameState aFlags);
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
virtual void Reflow(nsPresContext* aCX,

View File

@ -1419,7 +1419,6 @@ nsTextControlFrame::PeekOffset(nsPeekOffsetStruct *aPos)
void
nsTextControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
/*
@ -1447,7 +1446,7 @@ nsTextControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// placeholder has to be visible.
if (kid->GetContent() != txtCtrl->GetPlaceholderNode() ||
txtCtrl->GetPlaceholderVisibility()) {
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, set, 0);
BuildDisplayListForChild(aBuilder, kid, set, 0);
}
kid = kid->GetNextSibling();
}

View File

@ -127,7 +127,6 @@ public:
nsFrameList& aChildList) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual mozilla::dom::Element*

View File

@ -39,7 +39,6 @@ nsBackdropFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
/* virtual */ void
nsBackdropFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DO_GLOBAL_REFLOW_COUNT_DSP("nsBackdropFrame");

View File

@ -27,7 +27,6 @@ public:
virtual nsStyleContext*
GetParentStyleContext(nsIFrame** aProviderFrame) const override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual mozilla::LogicalSize
ComputeAutoSize(nsRenderingContext* aRenderingContext,

View File

@ -6525,13 +6525,13 @@ static void DebugOutputDrawLine(int32_t aDepth, nsLineBox* aLine, bool aDrawn) {
static void
DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea,
const nsRect& aDirtyRect, nsBlockFrame::LineIterator& aLine,
nsBlockFrame::LineIterator& aLine,
int32_t aDepth, int32_t& aDrawnLines, const nsDisplayListSet& aLists,
nsBlockFrame* aFrame, TextOverflow* aTextOverflow) {
// If the line's combined area (which includes child frames that
// stick outside of the line's bounding box or our bounding box)
// intersects the dirty rect then paint the line.
bool intersect = aLineArea.Intersects(aDirtyRect);
bool intersect = aLineArea.Intersects(aBuilder->GetDirtyRect());
#ifdef DEBUG
if (nsBlockFrame::gLamePaintMetrics) {
aDrawnLines++;
@ -6554,7 +6554,7 @@ DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea,
// Collect our line's display items in a temporary nsDisplayListCollection,
// so that we can apply any "text-overflow" clipping to the entire collection
// without affecting previous lines.
nsDisplayListCollection collection;
nsDisplayListCollection collection(aBuilder);
// Block-level child backgrounds go on the blockBorderBackgrounds list ...
// Inline-level child backgrounds go on the regular child content list.
@ -6566,8 +6566,7 @@ DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea,
nsIFrame* kid = aLine->mFirstChild;
int32_t n = aLine->GetChildCount();
while (--n >= 0) {
aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect,
childLists, flags);
aFrame->BuildDisplayListForChild(aBuilder, kid, childLists, flags);
kid = kid->GetNextSibling();
}
@ -6580,13 +6579,13 @@ DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea,
void
nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
int32_t drawnLines; // Will only be used if set (gLamePaintMetrics).
int32_t depth = 0;
#ifdef DEBUG
if (gNoisyDamageRepair) {
nsRect dirty = aBuilder->GetDirtyRect();
depth = GetDepth();
nsRect ca;
::ComputeVisualOverflowArea(mLines, mRect.width, mRect.height, ca);
@ -6594,7 +6593,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
ListTag(stdout);
printf(": bounds=%d,%d,%d,%d dirty(absolute)=%d,%d,%d,%d ca=%d,%d,%d,%d\n",
mRect.x, mRect.y, mRect.width, mRect.height,
aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height,
dirty.x, dirty.y, dirty.width, dirty.height,
ca.x, ca.y, ca.width, ca.height);
}
PRTime start = 0; // Initialize these variables to silence the compiler.
@ -6607,21 +6606,21 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayBorderBackgroundOutline(aBuilder, aLists);
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
DisplayOverflowContainers(aBuilder, aLists);
for (nsIFrame* f : mFloats) {
if (f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT)
BuildDisplayListForChild(aBuilder, f, aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, f, aLists);
}
}
aBuilder->MarkFramesForDisplayList(this, mFloats, aDirtyRect);
aBuilder->MarkFramesForDisplayList(this, mFloats);
// Prepare for text-overflow processing.
UniquePtr<TextOverflow> textOverflow(
TextOverflow::WillProcessLines(aBuilder, this));
// We'll collect our lines' display items here, & then append this to aLists.
nsDisplayListCollection linesDisplayListCollection;
nsDisplayListCollection linesDisplayListCollection(aBuilder);
// Don't use the line cursor if we might have a descendant placeholder ...
// it might skip lines that contain placeholders but don't themselves
@ -6631,7 +6630,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// approximate it by checking it on |this|; if it's true for any
// frame in our child list, it's also true for |this|.
nsLineBox* cursor = aBuilder->ShouldDescendIntoFrame(this) ?
nullptr : GetFirstLineContaining(aDirtyRect.y);
nullptr : GetFirstLineContaining(aBuilder->GetDirtyRect().y);
LineIterator line_end = LinesEnd();
if (cursor) {
@ -6642,10 +6641,10 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!lineArea.IsEmpty()) {
// Because we have a cursor, the combinedArea.ys are non-decreasing.
// Once we've passed aDirtyRect.YMost(), we can never see it again.
if (lineArea.y >= aDirtyRect.YMost()) {
if (lineArea.y >= aBuilder->GetDirtyRect().YMost()) {
break;
}
DisplayLine(aBuilder, lineArea, aDirtyRect, line, depth, drawnLines,
DisplayLine(aBuilder, lineArea, line, depth, drawnLines,
linesDisplayListCollection, this, textOverflow.get());
}
}
@ -6658,7 +6657,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
line != line_end;
++line) {
nsRect lineArea = line->GetVisualOverflowArea();
DisplayLine(aBuilder, lineArea, aDirtyRect, line, depth, drawnLines,
DisplayLine(aBuilder, lineArea, line, depth, drawnLines,
linesDisplayListCollection, this, textOverflow.get());
if (!lineArea.IsEmpty()) {
if (lineArea.y < lastY
@ -6688,7 +6687,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (HasOutsideBullet()) {
// Display outside bullets manually
nsIFrame* bullet = GetOutsideBullet();
BuildDisplayListForChild(aBuilder, bullet, aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, bullet, aLists);
}
#ifdef DEBUG

View File

@ -139,7 +139,6 @@ public:
virtual nsSplittableType GetSplittableType() const override;
virtual bool IsFloatContainingBlock() const override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsIAtom* GetType() const override;
virtual bool IsFrameOfType(uint32_t aFlags) const override

View File

@ -274,7 +274,6 @@ void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder,
void
nsBulletFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))

View File

@ -68,7 +68,6 @@ public:
// nsIFrame
virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsIAtom* GetType() const override;
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) override;

View File

@ -410,11 +410,10 @@ public:
void
nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
DisplayOverflowContainers(aBuilder, aLists);
}
// Force a background to be shown. We may have a background propagated to us,
@ -488,7 +487,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
for (nsIFrame* kid : PrincipalChildList()) {
// Put our child into its own pseudo-stack.
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, kid, aLists);
}
#ifdef DEBUG_CANVAS_FOCUS
@ -504,7 +503,7 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
docShell->GetHasFocus(&hasFocus);
printf("%p - nsCanvasFrame::Paint R:%d,%d,%d,%d DR: %d,%d,%d,%d\n", this,
mRect.x, mRect.y, mRect.width, mRect.height,
aDirtyRect.x, aDirtyRect.y, aDirtyRect.width, aDirtyRect.height);
dirty.x, dirty.y, dirty.width, dirty.height);
}
printf("%p - Focus: %s c: %p DoPaint:%s\n", docShell.get(), hasFocus?"Y":"N",
focusContent.get(), mDoPaintFocus?"Y":"N");

View File

@ -107,7 +107,6 @@ public:
NS_IMETHOD SetHasFocus(bool aHasFocus);
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void PaintFocus(mozilla::gfx::DrawTarget* aRenderingContext, nsPoint aPt);

View File

@ -1115,7 +1115,6 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
void
nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DisplayBorderBackgroundOutline(aBuilder, aLists);
@ -1128,7 +1127,7 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Our children won't have backgrounds so it doesn't matter where we put them.
for (nsFrameList::Enumerator e(mFrames); !e.AtEnd(); e.Next()) {
BuildDisplayListForChild(aBuilder, e.get(), aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, e.get(), aLists);
}
}

View File

@ -67,7 +67,6 @@ public:
}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsIAtom* GetType() const override;

View File

@ -331,17 +331,15 @@ nsContainerFrame::GetChildLists(nsTArray<ChildList>* aLists) const
void
nsContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DisplayBorderBackgroundOutline(aBuilder, aLists);
BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists);
BuildDisplayListForNonBlockChildren(aBuilder, aLists);
}
void
nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
uint32_t aFlags)
{
@ -350,7 +348,7 @@ nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aB
nsDisplayListSet set(aLists, aLists.Content());
// The children should be in content order
while (kid) {
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, set, aFlags);
BuildDisplayListForChild(aBuilder, kid, set, aFlags);
kid = kid->GetNextSibling();
}
}
@ -1340,13 +1338,12 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
void
nsContainerFrame::DisplayOverflowContainers(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsFrameList* overflowconts = GetPropTableFrames(OverflowContainersProperty());
if (overflowconts) {
for (nsIFrame* frame : *overflowconts) {
BuildDisplayListForChild(aBuilder, frame, aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, frame, aLists);
}
}
}

View File

@ -437,7 +437,6 @@ public:
* Add overflow containers to the display list
*/
void DisplayOverflowContainers(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
/**
@ -450,7 +449,6 @@ public:
* to emulate what nsContainerFrame::Paint did.
*/
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
static void PlaceFrameView(nsIFrame* aFrame)
@ -576,7 +574,6 @@ protected:
* display items) go into the Content() list.
*/
void BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
uint32_t aFlags = 0);
@ -585,11 +582,9 @@ protected:
* Intended as a convenience for derived classes.
*/
void BuildDisplayListForInline(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists,
DISPLAY_CHILD_INLINE);
BuildDisplayListForNonBlockChildren(aBuilder, aLists, DISPLAY_CHILD_INLINE);
}

View File

@ -50,10 +50,9 @@ nsFirstLetterFrame::GetType() const
void
nsFirstLetterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
}
void

View File

@ -20,7 +20,6 @@ public:
explicit nsFirstLetterFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Init(nsIContent* aContent,

View File

@ -2433,7 +2433,6 @@ GetDisplayFlagsForFlexItem(nsIFrame* aFrame)
void
nsFlexContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// XXXdholbert hacky temporary band-aid for bug 1059138: Trivially pass this
@ -2452,7 +2451,7 @@ nsFlexContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// the BlockBorderBackgrounds list.
nsDisplayListSet childLists(aLists, aLists.BlockBorderBackgrounds());
for (nsIFrame* childFrame : mFrames) {
BuildDisplayListForChild(aBuilder, childFrame, aDirtyRect, childLists,
BuildDisplayListForChild(aBuilder, childFrame, childLists,
GetDisplayFlagsForFlexItem(childFrame));
}
}

View File

@ -64,7 +64,6 @@ public:
nsIFrame* aPrevInFlow) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void MarkIntrinsicISizesDirty() override;

View File

@ -1793,6 +1793,13 @@ void
nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
// Per https://drafts.csswg.org/css-tables-3/#global-style-overrides:
// "All css properties of table-column and table-column-group boxes are
// ignored, except when explicitly specified by this specification."
// CSS outlines fall into this category, so we skip them on these boxes.
MOZ_ASSERT(GetType() != nsGkAtoms::tableColGroupFrame && GetType() != nsGkAtoms::tableColFrame);
if (StyleOutline()->mOutlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
return;
}
@ -1813,7 +1820,7 @@ nsFrame::DisplayOutline(nsDisplayListBuilder* aBuilder,
void
nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect, nsDisplayList* aList)
nsDisplayList* aList)
{
if (!IsVisibleForPainting(aBuilder))
return;
@ -1839,7 +1846,9 @@ nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsForEventDelivery() || aForceBackground ||
!StyleBackground()->IsTransparent() || StyleDisplay()->mAppearance) {
return nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, this, GetRectRelativeToSelf(), aLists.BorderBackground());
aBuilder, this,
GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(this),
aLists.BorderBackground());
}
return false;
}
@ -1872,7 +1881,9 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
// If there's a themed background, we should not create a border item.
// It won't be rendered.
if (!bgIsThemed && StyleBorder()->HasBorder()) {
// Don't paint borders for tables here, since they paint them in a different
// order.
if (!bgIsThemed && StyleBorder()->HasBorder() && GetType() != nsGkAtoms::tableFrame) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBorder(aBuilder, this));
}
@ -2072,13 +2083,12 @@ ItemParticipatesIn3DContext(nsIFrame* aAncestor, nsDisplayItem* aItem)
static void
WrapSeparatorTransform(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsRect& aDirtyRect,
nsDisplayList* aSource, nsDisplayList* aTarget,
int aIndex) {
if (!aSource->IsEmpty()) {
nsDisplayTransform *sepIdItem =
new (aBuilder) nsDisplayTransform(aBuilder, aFrame, aSource,
aDirtyRect, Matrix4x4(), aIndex);
aBuilder->GetDirtyRect(), Matrix4x4(), aIndex);
sepIdItem->SetNoExtendContext();
aTarget->AppendToTop(sepIdItem);
}
@ -2086,7 +2096,6 @@ WrapSeparatorTransform(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
void
nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
nsDisplayList* aList) {
if (GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
return;
@ -2122,25 +2131,27 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
aBuilder->AddToWillChangeBudget(this, GetSize());
}
bool extend3DContext = Extend3DContext();
const bool isTransformed = IsTransformed();
const bool hasPerspective = isTransformed && HasPerspective();
const bool extend3DContext = Extend3DContext();
const bool combines3DTransformWithAncestors =
(extend3DContext || isTransformed) && Combines3DTransformWithAncestors();
const bool childrenHavePerspective = ChildrenHavePerspective();
Maybe<nsDisplayListBuilder::AutoPreserves3DContext> autoPreserves3DContext;
if (extend3DContext && !Combines3DTransformWithAncestors()) {
if (extend3DContext && !combines3DTransformWithAncestors) {
// Start a new preserves3d context to keep informations on
// nsDisplayListBuilder.
autoPreserves3DContext.emplace(aBuilder);
// Save dirty rect on the builder to avoid being distorted for
// multiple transforms along the chain.
aBuilder->SetPreserves3DDirtyRect(aDirtyRect);
aBuilder->SavePreserves3DRects();
}
// For preserves3d, use the dirty rect already installed on the
// builder, since aDirtyRect maybe distorted for transforms along
// the chain.
nsRect dirtyRect = aDirtyRect;
nsRect dirtyRect = aBuilder->GetDirtyRect();
bool inTransform = aBuilder->IsInTransform();
bool isTransformed = IsTransformed();
bool hasPerspective = HasPerspective();
// reset blend mode so we can keep track if this stacking context needs have
// a nsDisplayBlendContainer. Set the blend mode back when the routine exits
// so we keep track if the parent stacking context needs a container too.
@ -2148,6 +2159,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
aBuilder->SetContainsBlendMode(false);
nsRect dirtyRectOutsideTransform = dirtyRect;
bool inTransform = aBuilder->IsInTransform();
if (isTransformed) {
const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
if (nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder,
@ -2160,8 +2172,8 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
// If we're in preserve-3d then grab the dirty rect that was given to the root
// and transform using the combined transform.
if (Combines3DTransformWithAncestors()) {
dirtyRect = aBuilder->GetPreserves3DDirtyRect(this);
if (combines3DTransformWithAncestors) {
dirtyRect = aBuilder->GetPreserves3DRects();
}
nsRect untransformedDirtyRect;
@ -2269,19 +2281,19 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
clipState.EnterStackingContextContents(clearClip);
nsDisplayListCollection set;
nsDisplayListCollection set(aBuilder);
{
DisplayListClipState::AutoSaveRestore nestedClipState(aBuilder);
nsDisplayListBuilder::AutoInTransformSetter
inTransformSetter(aBuilder, inTransform);
nsDisplayListBuilder::AutoSaveRestorePerspectiveIndex
perspectiveIndex(aBuilder, this);
perspectiveIndex(aBuilder, childrenHavePerspective);
CheckForApzAwareEventHandlers(aBuilder, this);
Maybe<nsRect> clipPropClip = GetClipPropClipRect(disp, effects, GetSize());
if (clipPropClip) {
dirtyRect.IntersectRect(dirtyRect, *clipPropClip);
aBuilder->IntersectDirtyRect(*clipPropClip);
nestedClipState.ClipContentDescendants(
*clipPropClip + aBuilder->ToReferenceFrame(this));
}
@ -2294,7 +2306,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
aBuilder->MarkPreserve3DFramesForDisplayList(this);
}
MarkAbsoluteFramesForDisplayList(aBuilder, dirtyRect);
MarkAbsoluteFramesForDisplayList(aBuilder);
nsDisplayLayerEventRegions* eventRegions = nullptr;
if (aBuilder->IsBuildingLayerEventRegions()) {
@ -2303,7 +2315,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
aBuilder->SetLayerEventRegions(eventRegions);
}
aBuilder->AdjustWindowDraggingRegion(this);
BuildDisplayList(aBuilder, dirtyRect, set);
BuildDisplayList(aBuilder, set);
if (eventRegions) {
// If the event regions item ended up empty, throw it away rather than
// adding it to the display list.
@ -2409,7 +2421,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
clipState.ExitStackingContextContents(&containerItemScrollClip);
}
// Revert to the post-filter dirty rect.
buildingDisplayList.SetDirtyRect(dirtyRectOutsideSVGEffects);
aBuilder->SetDirtyRect(dirtyRectOutsideSVGEffects);
// Skip all filter effects while generating glyph mask.
if (usingFilter && !aBuilder->IsForGenerateGlyphMask()) {
@ -2474,8 +2486,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
while (nsDisplayItem* item = resultList.RemoveBottom()) {
if (ItemParticipatesIn3DContext(this, item) && !item->GetClip().HasClip()) {
// The frame of this item participates the same 3D context.
WrapSeparatorTransform(aBuilder, this, dirtyRect,
&nonparticipants, &participants, index++);
WrapSeparatorTransform(aBuilder, this, &nonparticipants, &participants, index++);
participants.AppendToTop(item);
} else {
// The frame of the item doesn't participate the current
@ -2488,8 +2499,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
nonparticipants.AppendToTop(item);
}
}
WrapSeparatorTransform(aBuilder, this, dirtyRect,
&nonparticipants, &participants, index++);
WrapSeparatorTransform(aBuilder, this, &nonparticipants, &participants, index++);
resultList.AppendToTop(&participants);
}
@ -2500,7 +2510,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
}
// Revert to the dirtyrect coming in from the parent, without our transform
// taken into account.
buildingDisplayList.SetDirtyRect(dirtyRectOutsideTransform);
aBuilder->SetDirtyRect(dirtyRectOutsideTransform);
// Revert to the outer reference frame and offset because all display
// items we create from now on are outside the transform.
nsPoint toOuterReferenceFrame;
@ -2601,10 +2611,63 @@ WrapInWrapList(nsDisplayListBuilder* aBuilder,
return item;
}
static bool DescendIntoChild(nsDisplayListBuilder* aBuilder,
const nsIFrame* aChild, const nsRect& aDirty) {
if (aChild->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO) {
return true;
}
// If the child is a scrollframe that we want to ignore, then we need
// to descend into it because its scrolled child may intersect the dirty
// area even if the scrollframe itself doesn't.
if (aChild == aBuilder->GetIgnoreScrollFrame()) {
return true;
}
// There are cases where the "ignore scroll frame" on the builder is not set
// correctly, and so we additionally want to catch cases where the child is
// a root scrollframe and we are ignoring scrolling on the viewport.
if (aChild == aBuilder->GetPresShellIgnoreScrollFrame()) {
return true;
}
const nsRect overflow = aChild->GetVisualOverflowRect();
if (aDirty.Intersects(overflow)) {
return true;
}
if (aChild->IsFrameOfType(nsIFrame::eTablePart)) {
// Relative positioning and transforms can cause table parts to move, but we
// will still paint the backgrounds for their ancestor parts under them at
// their 'normal' position. That means that we must consider the overflow
// rects at both positions.
// We convert the overflow rect into the nsTableFrame's coordinate
// space, applying the normal position offset at each step. Then we
// compare that against the builder's cached dirty rect in table
// coordinate space.
const nsIFrame* f = aChild;
nsRect normalPositionOverflowRelativeToTable = overflow;
while (f->IsFrameOfType(nsIFrame::eTablePart)) {
normalPositionOverflowRelativeToTable += f->GetNormalPosition();
f = f->GetParent();
}
nsDisplayTableBackgroundSet* tableBGs = aBuilder->GetTableBackgroundSet();
if (tableBGs &&
tableBGs->GetDirtyRect().Intersects(normalPositionOverflowRelativeToTable)) {
return true;
}
}
return false;
}
void
nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
nsIFrame* aChild,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
uint32_t aFlags) {
// If painting is restricted to just the background of the top level frame,
@ -2623,12 +2686,13 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
if (child->GetStateBits() & NS_FRAME_TOO_DEEP_IN_FRAME_TREE)
return;
bool isSVG = (child->GetStateBits() & NS_FRAME_SVG_LAYOUT);
const bool isSVG = child->GetStateBits() & NS_FRAME_SVG_LAYOUT;
// true if this is a real or pseudo stacking context
bool pseudoStackingContext =
(aFlags & DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT) != 0;
if (!isSVG &&
if (!pseudoStackingContext &&
!isSVG &&
(aFlags & DISPLAY_CHILD_INLINE) &&
!child->IsFrameOfType(eLineParticipant)) {
// child is a non-inline frame in an inline context, i.e.,
@ -2637,12 +2701,14 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
pseudoStackingContext = true;
}
// dirty rect in child-relative coordinates
nsRect dirty = aDirtyRect - child->GetOffsetTo(this);
nsIAtom* childType = child->GetType();
nsDisplayListBuilder::OutOfFlowDisplayData* savedOutOfFlowData = nullptr;
bool isPlaceholder = false;
// dirty rect in child-relative coordinates
NS_ASSERTION(aBuilder->GetCurrentFrame() == this, "Wrong coord space!");
nsRect dirty = aBuilder->GetDirtyRect() - child->GetOffsetTo(this);
if (childType == nsGkAtoms::placeholderFrame) {
isPlaceholder = true;
nsPlaceholderFrame* placeholder = static_cast<nsPlaceholderFrame*>(child);
@ -2689,35 +2755,10 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
!aChild->IsSelected()) {
return;
}
if (aBuilder->GetIncludeAllOutOfFlows() &&
(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
if (aBuilder->GetIncludeAllOutOfFlows() && isPlaceholder) {
dirty = child->GetVisualOverflowRect();
} else if (!(child->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
// No need to descend into child to catch placeholders for visible
// positioned stuff. So see if we can short-circuit frame traversal here.
// We can stop if child's frame subtree's intersection with the
// dirty area is empty.
// If the child is a scrollframe that we want to ignore, then we need
// to descend into it because its scrolled child may intersect the dirty
// area even if the scrollframe itself doesn't.
// There are cases where the "ignore scroll frame" on the builder is not set
// correctly, and so we additionally want to catch cases where the child is
// a root scrollframe and we are ignoring scrolling on the viewport.
nsIPresShell* shell = PresContext()->PresShell();
bool keepDescending = child == aBuilder->GetIgnoreScrollFrame() ||
(shell->IgnoringViewportScrolling() && child == shell->GetRootScrollFrame());
if (!keepDescending) {
nsRect childDirty;
if (!childDirty.IntersectRect(dirty, child->GetVisualOverflowRect()))
return;
// Usually we could set dirty to childDirty now but there's no
// benefit, and it can be confusing. It can especially confuse
// situations where we're going to ignore a scrollframe's clipping;
// we wouldn't want to clip the dirty area to the scrollframe's
// bounds in that case.
}
} else if (!DescendIntoChild(aBuilder, child, dirty)) {
return;
}
// XXX need to have inline-block and inline-table set pseudoStackingContext
@ -2741,7 +2782,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
const nsStyleDisplay* disp = child->StyleDisplay();
const nsStyleEffects* effects = child->StyleEffects();
const nsStylePosition* pos = child->StylePosition();
bool isVisuallyAtomic = child->HasOpacity()
const bool isVisuallyAtomic = child->HasOpacity()
|| child->IsTransformed()
// strictly speaking, 'perspective' doesn't require visual atomicity,
// but the spec says it acts like the rest of these
@ -2749,28 +2790,28 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|| effects->mMixBlendMode != NS_STYLE_BLEND_NORMAL
|| nsSVGIntegrationUtils::UsingEffectsForFrame(child);
bool isPositioned = disp->IsAbsPosContainingBlock(child);
bool isStackingContext =
const bool isPositioned = disp->IsAbsPosContainingBlock(child);
const bool isStackingContext =
(isPositioned && (disp->IsPositionForcingStackingContext() ||
pos->mZIndex.GetUnit() == eStyleUnit_Integer)) ||
(disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
disp->mIsolation != NS_STYLE_ISOLATION_AUTO ||
isVisuallyAtomic || (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
if (isVisuallyAtomic || isPositioned || (!isSVG && disp->IsFloating(child)) ||
((effects->mClipFlags & NS_STYLE_CLIP_RECT) &&
IsSVGContentWithCSSClip(child)) ||
disp->mIsolation != NS_STYLE_ISOLATION_AUTO ||
(disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
(aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
if (pseudoStackingContext || isStackingContext || isPositioned ||
(!isSVG && disp->IsFloating(child)) ||
(isSVG && (effects->mClipFlags & NS_STYLE_CLIP_RECT) &&
IsSVGContentWithCSSClip(child))) {
// If you change this, also change IsPseudoStackingContextFromStyle()
pseudoStackingContext = true;
}
NS_ASSERTION(!isStackingContext || pseudoStackingContext,
"Stacking contexts must also be pseudo-stacking-contexts");
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child, dirty, pseudoStackingContext);
DisplayListClipState::AutoClipMultiple clipState(aBuilder);
CheckForApzAwareEventHandlers(aBuilder, child);
@ -2783,7 +2824,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
savedOutOfFlowData->mContainingBlockScrollClip);
} else if (GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO &&
isPlaceholder) {
NS_ASSERTION(dirty.IsEmpty(), "should have empty dirty rect");
NS_ASSERTION(dirty.IsEmpty(), "should have empty visible rect");
// Every item we build from now until we descent into an out of flow that
// does have saved out of flow data should be invisible. This state gets
// restored when AutoBuildingDisplayList gets out of scope.
@ -2819,18 +2860,18 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// True stacking context.
// For stacking contexts, BuildDisplayListForStackingContext handles
// clipping and MarkAbsoluteFramesForDisplayList.
child->BuildDisplayListForStackingContext(aBuilder, dirty, &list);
aBuilder->DisplayCaret(child, dirty, &list);
child->BuildDisplayListForStackingContext(aBuilder, &list);
aBuilder->DisplayCaret(child, &list);
} else {
Maybe<nsRect> clipPropClip =
child->GetClipPropClipRect(disp, effects, child->GetSize());
if (clipPropClip) {
dirty.IntersectRect(dirty, *clipPropClip);
aBuilder->IntersectDirtyRect(*clipPropClip);
clipState.ClipContentDescendants(
*clipPropClip + aBuilder->ToReferenceFrame(child));
}
child->MarkAbsoluteFramesForDisplayList(aBuilder, dirty);
child->MarkAbsoluteFramesForDisplayList(aBuilder);
if (aBuilder->IsBuildingLayerEventRegions()) {
// If this frame has a different animated geometry root than its parent,
@ -2862,8 +2903,8 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// return early.
aBuilder->AdjustWindowDraggingRegion(child);
child->BuildDisplayList(aBuilder, dirty, aLists);
aBuilder->DisplayCaret(child, dirty, aLists.Content());
child->BuildDisplayList(aBuilder, aLists);
aBuilder->DisplayCaret(child, aLists.Content());
#ifdef DEBUG
DisplayDebugBorders(aBuilder, child, aLists);
#endif
@ -2874,10 +2915,10 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// We allow positioned descendants of the child to escape to our parent
// stacking context's positioned descendant list, because they might be
// z-index:non-auto
nsDisplayListCollection pseudoStack;
nsDisplayListCollection pseudoStack(aBuilder);
aBuilder->AdjustWindowDraggingRegion(child);
child->BuildDisplayList(aBuilder, dirty, pseudoStack);
aBuilder->DisplayCaret(child, dirty, pseudoStack.Content());
child->BuildDisplayList(aBuilder, pseudoStack);
aBuilder->DisplayCaret(child, pseudoStack.Content());
list.AppendToTop(pseudoStack.BorderBackground());
list.AppendToTop(pseudoStack.BlockBorderBackgrounds());
@ -2927,11 +2968,10 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
}
void
nsIFrame::MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect)
nsIFrame::MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder)
{
if (IsAbsoluteContainer()) {
aBuilder->MarkFramesForDisplayList(this, GetAbsoluteContainingBlock()->GetChildList(), aDirtyRect);
aBuilder->MarkFramesForDisplayList(this, GetAbsoluteContainingBlock()->GetChildList());
}
}

View File

@ -100,7 +100,6 @@ public:
nsIFrame::Cursor& aCursor) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
@ -149,7 +148,6 @@ public:
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,
@ -672,10 +670,9 @@ nsHTMLFramesetFrame::GetCursor(const nsPoint& aPoint,
void
nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
if (mDragger && aBuilder->IsForEventDelivery()) {
aLists.Content()->AppendNewToTop(
@ -1429,7 +1426,6 @@ void nsDisplayFramesetBorder::Paint(nsDisplayListBuilder* aBuilder,
void
nsHTMLFramesetBorderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
aLists.Content()->AppendNewToTop(
@ -1640,7 +1636,6 @@ void nsDisplayFramesetBlank::Paint(nsDisplayListBuilder* aBuilder,
void
nsHTMLFramesetBlankFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
aLists.Content()->AppendNewToTop(

View File

@ -97,7 +97,6 @@ public:
nsIFrame::Cursor& aCursor) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,

View File

@ -3031,7 +3031,6 @@ struct HoveredStateComparator
void
ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
bool aCreateLayer,
bool aPositioned)
@ -3093,23 +3092,25 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
// zoomable, and where the scrollbar sizes are bounded by the widget.
nsRect dirty = mIsRoot && mOuter->PresContext()->IsRootContentDocument()
? scrollParts[i]->GetVisualOverflowRectRelativeToParent()
: aDirtyRect;
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, scrollParts[i],
dirty + mOuter->GetOffsetTo(scrollParts[i]), true);
: aBuilder->GetDirtyRect();
// Always create layers for overlay scrollbars so that we don't create a
// giant layer covering the whole scrollport if both scrollbars are visible.
bool isOverlayScrollbar = (flags != 0) && overlayScrollbars;
bool createLayer = aCreateLayer || isOverlayScrollbar;
nsDisplayListBuilder::AutoCurrentScrollbarInfoSetter
infoSetter(aBuilder, scrollTargetId, flags, createLayer);
nsDisplayListCollection partList;
mOuter->BuildDisplayListForChild(
aBuilder, scrollParts[i], dirty, partList,
nsIFrame::DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
nsDisplayListCollection partList(aBuilder);
{
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, mOuter,
dirty, true);
nsDisplayListBuilder::AutoCurrentScrollbarInfoSetter
infoSetter(aBuilder, scrollTargetId, flags, createLayer);
mOuter->BuildDisplayListForChild(
aBuilder, scrollParts[i], partList,
nsIFrame::DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
}
if (createLayer) {
appendToTopFlags |= APPEND_OWN_LAYER;
}
@ -3117,11 +3118,18 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
appendToTopFlags |= APPEND_POSITIONED;
}
{
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, scrollParts[i],
dirty + mOuter->GetOffsetTo(scrollParts[i]), true);
nsDisplayListBuilder::AutoCurrentScrollbarInfoSetter
infoSetter(aBuilder, scrollTargetId, flags, createLayer);
// DISPLAY_CHILD_FORCE_STACKING_CONTEXT put everything into
// partList.PositionedDescendants().
::AppendToTop(aBuilder, aLists,
partList.PositionedDescendants(), scrollParts[i],
appendToTopFlags);
}
}
}
@ -3246,7 +3254,6 @@ ClipListsExceptCaret(nsDisplayListCollection* aLists,
void
ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (aBuilder->IsForFrameVisibility()) {
@ -3283,7 +3290,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// had dirty rects saved for them by their parent frames calling
// MarkOutOfFlowChildrenForDisplayList, so it's safe to restrict our
// dirty rect here.
nsRect dirtyRect = aDirtyRect;
nsRect dirtyRect = aBuilder->GetDirtyRect();
if (!ignoringThisScrollFrame) {
dirtyRect = dirtyRect.Intersect(mScrollPort);
}
@ -3325,20 +3332,20 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (addScrollBars) {
// Add classic scrollbars.
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists,
createLayersForScrollbars, false);
AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, false);
}
nsDisplayListBuilder::AutoBuildingDisplayList
building(aBuilder, mOuter, dirtyRect, aBuilder->IsAtRootOfPseudoStackingContext());
// Don't clip the scrolled child, and don't paint scrollbars/scrollcorner.
// The scrolled frame shouldn't have its own background/border, so we
// can just pass aLists directly.
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame,
dirtyRect, aLists);
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, aLists);
if (addScrollBars) {
// Add overlay scrollbars.
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists,
createLayersForScrollbars, true);
AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, true);
}
return;
@ -3376,8 +3383,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Note that this does not apply for overlay scrollbars; those are drawn
// in the positioned-elements layer on top of everything else by the call
// to AppendScrollPartsTo(..., true) further down.
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists,
createLayersForScrollbars, false);
AppendScrollPartsTo(aBuilder, aLists, createLayersForScrollbars, false);
const nsStyleDisplay* disp = mOuter->StyleDisplay();
if (disp && (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_SCROLL)) {
@ -3414,7 +3420,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsIScrollableFrame* sf = do_QueryFrame(mOuter);
MOZ_ASSERT(sf);
nsDisplayListCollection scrolledContent;
nsDisplayListCollection scrolledContent(aBuilder);
{
// Note that setting the current scroll parent id here means that positioned children
// of this scroll info layer will pick up the scroll info layer as their scroll handoff
@ -3506,7 +3512,10 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
scrolledRectClipState.ClipContainingBlockDescendants(
scrolledRectClip + aBuilder->ToReferenceFrame(mOuter));
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, dirtyRect, scrolledContent);
nsDisplayListBuilder::AutoBuildingDisplayList
building(aBuilder, mOuter, dirtyRect, aBuilder->IsAtRootOfPseudoStackingContext());
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, scrolledContent);
}
if (contentBoxClipForNonCaretContent) {
@ -3593,8 +3602,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
// Now display overlay scrollbars and the resizer, if we have one.
AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent,
createLayersForScrollbars, true);
AppendScrollPartsTo(aBuilder, scrolledContent, createLayersForScrollbars, true);
scrolledContent.MoveTo(aLists);
}
@ -6175,3 +6184,4 @@ ScrollFrameHelper::UsesContainerScrolling() const
}
return false;
}

View File

@ -70,11 +70,9 @@ public:
void Destroy();
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
void AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
bool aCreateLayer,
bool aPositioned);
@ -687,9 +685,8 @@ public:
}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {
mHelper.BuildDisplayList(aBuilder, aDirtyRect, aLists);
mHelper.BuildDisplayList(aBuilder, aLists);
}
bool TryLayout(ScrollReflowInput* aState,
@ -1105,9 +1102,8 @@ public:
bool aClipAllDescendants);
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {
mHelper.BuildDisplayList(aBuilder, aDirtyRect, aLists);
mHelper.BuildDisplayList(aBuilder, aLists);
}
// XXXldb Is this actually used?

View File

@ -6643,12 +6643,11 @@ nsGridContainerFrame::GetType() const
void
nsGridContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DisplayBorderBackgroundOutline(aBuilder, aLists);
if (GetPrevInFlow()) {
DisplayOverflowContainers(aBuilder, aDirtyRect, aLists);
DisplayOverflowContainers(aBuilder, aLists);
}
// Our children are all grid-level boxes, which behave the same as
@ -6662,8 +6661,7 @@ nsGridContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
GridItemCSSOrderIterator::eIncludeAll, order);
for (; !iter.AtEnd(); iter.Next()) {
nsIFrame* child = *iter;
BuildDisplayListForChild(aBuilder, child, aDirtyRect, aLists,
::GetDisplayFlagsForGridItem(child));
BuildDisplayListForChild(aBuilder, child, aLists, ::GetDisplayFlagsForGridItem(child));
}
}

View File

@ -98,7 +98,6 @@ public:
}
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
nscoord GetLogicalBaseline(mozilla::WritingMode aWM) const override

View File

@ -367,7 +367,6 @@ nsHTMLCanvasFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
void
nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))

View File

@ -45,7 +45,6 @@ public:
nsIFrame* aPrevInFlow) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,

View File

@ -1451,21 +1451,14 @@ public:
* BuildDisplayListForChild.
*
* See nsDisplayList.h for more information about display lists.
*
* @param aDirtyRect content outside this rectangle can be ignored; the
* rectangle is in frame coordinates
*/
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) {}
/**
* Displays the caret onto the given display list builder. The caret is
* painted on top of the rest of the display list items.
*
* @param aDirtyRect is the dirty rectangle that we're repainting.
*/
void DisplayCaret(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
nsDisplayList* aList);
/**
@ -1499,11 +1492,8 @@ public:
/**
* Builds a display list for the content represented by this frame,
* treating this frame as the root of a stacking context.
* @param aDirtyRect content outside this rectangle can be ignored; the
* rectangle is in frame coordinates
*/
void BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
nsDisplayList* aList);
enum {
@ -1522,7 +1512,6 @@ public:
*/
void BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
nsIFrame* aChild,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
uint32_t aFlags = 0);
@ -3551,7 +3540,7 @@ private:
nsIFrame* mNextSibling; // doubly-linked list of frames
nsIFrame* mPrevSibling; // Do not touch outside SetNextSibling!
void MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect);
void MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder);
static void DestroyPaintedPresShellList(nsTArray<nsWeakPtr>* list) {
list->Clear();

View File

@ -1730,7 +1730,6 @@ nsImageFrame::PaintImage(nsRenderingContext& aRenderingContext, nsPoint aPt,
void
nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))

View File

@ -82,7 +82,6 @@ public:
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;

View File

@ -243,10 +243,9 @@ nsInlineFrame::StealFrame(nsIFrame* aChild)
void
nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
BuildDisplayListForInline(aBuilder, aDirtyRect, aLists);
BuildDisplayListForInline(aBuilder, aLists);
// The sole purpose of this is to trigger display of the selection
// window for Named Anchors, which don't have any children and

View File

@ -31,7 +31,6 @@ public:
// nsIFrame overrides
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
#ifdef ACCESSIBILITY

View File

@ -24,7 +24,6 @@ public:
// nsIFrame replacements
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override {
DO_GLOBAL_REFLOW_COUNT_DSP("nsLeafFrame");
DisplayBorderBackgroundOutline(aBuilder, aLists);

View File

@ -437,7 +437,7 @@ PruneDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
static void
BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
nsPageFrame* aPage, nsIFrame* aExtraPage,
const nsRect& aDirtyRect, nsDisplayList* aList)
nsDisplayList* aList)
{
// The only content in aExtraPage we care about is out-of-flow content whose
// placeholders have occurred in aPage. If
@ -447,7 +447,7 @@ BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder,
return;
}
nsDisplayList list;
aExtraPage->BuildDisplayListForStackingContext(aBuilder, aDirtyRect, &list);
aExtraPage->BuildDisplayListForStackingContext(aBuilder, &list);
PruneDisplayListForExtraPage(aBuilder, aPage, aExtraPage, &list);
aList->AppendToTop(&list);
}
@ -517,10 +517,9 @@ protected:
//------------------------------------------------------------------------------
void
nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsDisplayListCollection set;
nsDisplayListCollection set(aBuilder);
if (PresContext()->IsScreen()) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
@ -558,7 +557,10 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipState.ClipContainingBlockDescendants(clipRect, nullptr);
nsRect dirtyRect = child->GetVisualOverflowRectRelativeToSelf();
child->BuildDisplayListForStackingContext(aBuilder, dirtyRect, &content);
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child, dirtyRect,
aBuilder->IsAtRootOfPseudoStackingContext());
child->BuildDisplayListForStackingContext(aBuilder, &content);
// We may need to paint out-of-flow frames whose placeholders are
// on other pages. Add those pages to our display list. Note that
@ -569,8 +571,12 @@ nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// following placeholders to their out-of-flows) end up on the list.
nsIFrame* page = child;
while ((page = GetNextPage(page)) != nullptr) {
BuildDisplayListForExtraPage(aBuilder, this, page,
dirtyRect + child->GetOffsetTo(page), &content);
nsRect childDirty = dirtyRect + child->GetOffsetTo(page);
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, page, childDirty,
aBuilder->IsAtRootOfPseudoStackingContext());
BuildDisplayListForExtraPage(aBuilder, this, page, &content);
}
// Invoke AutoBuildingDisplayList to ensure that the correct dirtyRect

View File

@ -29,7 +29,6 @@ public:
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
/**

View File

@ -239,7 +239,6 @@ PaintDebugPlaceholder(nsIFrame* aFrame, DrawTarget* aDrawTarget,
void
nsPlaceholderFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DO_GLOBAL_REFLOW_COUNT_DSP("nsPlaceholderFrame");

View File

@ -107,7 +107,6 @@ public:
#if defined(DEBUG) || (defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF))
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
#endif // DEBUG || (MOZ_REFLOW_PERF_DSP && MOZ_REFLOW_PERF)

View File

@ -1182,7 +1182,6 @@ nsPluginFrame::IsTransparentMode() const
void
nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// XXX why are we painting collapsed object frames?

View File

@ -81,7 +81,6 @@ public:
const ReflowInput* aReflowInput,
nsDidReflowStatus aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult HandleEvent(nsPresContext* aPresContext,

View File

@ -63,14 +63,13 @@ nsRubyTextFrame::GetFrameName(nsAString& aResult) const
/* virtual */ void
nsRubyTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (IsAutoHidden()) {
return;
}
nsRubyContentFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsRubyContentFrame::BuildDisplayList(aBuilder, aLists);
}
/* virtual */ void

View File

@ -34,7 +34,6 @@ public:
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Reflow(nsPresContext* aPresContext,

View File

@ -808,7 +808,6 @@ ComputePageSequenceTransform(nsIFrame* aFrame, float aAppUnitsPerPixel)
void
nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DisplayBorderBackgroundOutline(aBuilder, aLists);
@ -822,13 +821,16 @@ nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipState.Clear();
nsIFrame* child = PrincipalChildList().FirstChild();
nsRect dirty = aDirtyRect;
nsRect dirty = aBuilder->GetDirtyRect();
dirty.ScaleInverseRoundOut(PresContext()->GetPrintPreviewScale());
while (child) {
if (child->GetVisualOverflowRectRelativeToParent().Intersects(dirty)) {
child->BuildDisplayListForStackingContext(aBuilder,
dirty - child->GetPosition(), &content);
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child,
dirty - child->GetPosition(),
aBuilder->IsAtRootOfPseudoStackingContext());
child->BuildDisplayListForStackingContext(aBuilder, &content);
aBuilder->ResetMarkedFramesForDisplayList();
}
child = child->GetNextSibling();

View File

@ -69,7 +69,6 @@ public:
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
// nsIPageSequenceFrame

View File

@ -327,7 +327,6 @@ WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
void
nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))
@ -343,7 +342,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
bool pointerEventsNone =
StyleUserInterface()->mPointerEvents == NS_STYLE_POINTER_EVENTS_NONE;
if (!aBuilder->IsForEventDelivery() || !pointerEventsNone) {
nsDisplayListCollection decorations;
nsDisplayListCollection decorations(aBuilder);
DisplayBorderBackgroundOutline(aBuilder, decorations);
if (rfp) {
// Wrap background colors of <iframe>s with remote subdocuments in their
@ -368,7 +367,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
if (rfp) {
rfp->BuildDisplayList(aBuilder, this, aDirtyRect, aLists);
rfp->BuildDisplayList(aBuilder, this, aLists);
return;
}
@ -393,17 +392,18 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsIFrame* savedIgnoreScrollFrame = nullptr;
if (subdocRootFrame) {
// get the dirty rect relative to the root frame of the subdoc
dirty = aDirtyRect + GetOffsetToCrossDoc(subdocRootFrame);
dirty = aBuilder->GetDirtyRect() + GetOffsetToCrossDoc(subdocRootFrame);
// and convert into the appunits of the subdoc
dirty = dirty.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD);
if (nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame()) {
nsIScrollableFrame* rootScrollableFrame = presShell->GetRootScrollFrameAsScrollable();
MOZ_ASSERT(rootScrollableFrame);
// Use a copy, so the dirty rect doesn't get modified to the display port.
nsRect copy = dirty;
// Use a copy, so the rects don't get modified.
nsRect copyOfDirty = dirty;
haveDisplayPort = rootScrollableFrame->DecideScrollableLayer(aBuilder,
&copy, /* aAllowCreateDisplayPort = */ true);
&copyOfDirty,
/* aAllowCreateDisplayPort = */ true);
if (!gfxPrefs::LayoutUseContainersForRootFrames()) {
haveDisplayPort = false;
}
@ -417,7 +417,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aBuilder->EnterPresShell(subdocRootFrame, pointerEventsNone);
} else {
dirty = aDirtyRect;
dirty = aBuilder->GetDirtyRect();
}
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
@ -456,6 +456,13 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nestedClipState.EnterStackingContextContents(true);
}
// Invoke AutoBuildingDisplayList to ensure that the correct dirty rect
// is used to compute the visible rect if AddCanvasBackgroundColorItem
// creates a display item.
nsIFrame* frame = subdocRootFrame ? subdocRootFrame : this;
nsDisplayListBuilder::AutoBuildingDisplayList
building(aBuilder, frame, dirty, true);
if (subdocRootFrame) {
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
nsDisplayListBuilder::AutoCurrentScrollParentIdSetter idSetter(
@ -466,7 +473,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aBuilder->SetAncestorHasApzAwareEventHandler(false);
subdocRootFrame->
BuildDisplayListForStackingContext(aBuilder, dirty, &childItems);
BuildDisplayListForStackingContext(aBuilder, &childItems);
}
if (!aBuilder->IsForEventDelivery()) {
@ -485,15 +492,8 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// painted on the page itself.
if (nsLayoutUtils::NeedsPrintPreviewBackground(presContext)) {
presShell->AddPrintPreviewBackgroundItem(
*aBuilder, childItems, subdocRootFrame ? subdocRootFrame : this,
bounds);
*aBuilder, childItems, frame, bounds);
} else {
// Invoke AutoBuildingDisplayList to ensure that the correct dirty rect
// is used to compute the visible rect if AddCanvasBackgroundColorItem
// creates a display item.
nsIFrame* frame = subdocRootFrame ? subdocRootFrame : this;
nsDisplayListBuilder::AutoBuildingDisplayList
building(aBuilder, frame, dirty, true);
// Add the canvas background color to the bottom of the list. This
// happens after we've built the list so that AddCanvasBackgroundColorItem
// can monkey with the contents if necessary.

View File

@ -79,7 +79,6 @@ public:
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,

View File

@ -4997,7 +4997,6 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
void
nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))

View File

@ -65,7 +65,6 @@ public:
// nsIFrame
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void Init(nsIContent* aContent,

View File

@ -446,7 +446,6 @@ public:
void
nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
if (!IsVisibleForPainting(aBuilder))
@ -482,14 +481,15 @@ nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// but only want to draw mPosterImage conditionally. Others we
// always add to the display list.
for (nsIFrame* child : mFrames) {
if (child->GetContent() != mPosterImage || shouldDisplayPoster) {
child->BuildDisplayListForStackingContext(aBuilder,
aDirtyRect - child->GetOffsetTo(this),
aLists.Content());
} else if (child->GetType() == nsGkAtoms::boxFrame) {
child->BuildDisplayListForStackingContext(aBuilder,
aDirtyRect - child->GetOffsetTo(this),
aLists.Content());
if (child->GetContent() != mPosterImage || shouldDisplayPoster ||
child->GetType() == nsGkAtoms::boxFrame) {
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, child,
aBuilder->GetDirtyRect() - child->GetOffsetTo(this),
aBuilder->IsAtRootOfPseudoStackingContext());
child->BuildDisplayListForStackingContext(aBuilder, aLists.Content());
}
}
}

View File

@ -45,7 +45,6 @@ public:
NS_DECL_FRAMEARENA_HELPERS
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult AttributeChanged(int32_t aNameSpaceID,

View File

@ -49,7 +49,6 @@ ViewportFrame::Init(nsIContent* aContent,
void
ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
PROFILER_LABEL("ViewportFrame", "BuildDisplayList",
@ -59,7 +58,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// make the kid's BorderBackground our own. This ensures that the canvas
// frame's background becomes our own background and therefore appears
// below negative z-index elements.
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
BuildDisplayListForChild(aBuilder, kid, aLists);
}
nsDisplayList topLayerList;
@ -110,8 +109,12 @@ BuildDisplayListForTopLayerFrame(nsDisplayListBuilder* aBuilder,
clipState.SetScrollClipForContainingBlockDescendants(
aBuilder, savedOutOfFlowData->mContainingBlockScrollClip);
}
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, aFrame, dirty,
aBuilder->IsAtRootOfPseudoStackingContext());
nsDisplayList list;
aFrame->BuildDisplayListForStackingContext(aBuilder, dirty, &list);
aFrame->BuildDisplayListForStackingContext(aBuilder, &list);
aList->AppendToTop(&list);
}

View File

@ -56,7 +56,6 @@ public:
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
void BuildDisplayListForTopLayer(nsDisplayListBuilder* aBuilder,

View File

@ -266,7 +266,6 @@ RenderFrameParent::GetLayerTreeId() const
void
RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// We're the subdoc for <browser remote="true"> and it has

View File

@ -64,7 +64,6 @@ public:
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,

View File

@ -1992,7 +1992,8 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
if (styleContext != parentContext &&
NS_GET_A(backg->mBackgroundColor) > 0) {
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, aForFrame, mRect, aLists.BorderBackground(),
aBuilder, aForFrame, mRect + aBuilder->ToReferenceFrame(aForFrame),
aLists.BorderBackground(),
/* aAllowWillPaintBorderOptimization */ true, styleContext);
}
//else

View File

@ -618,7 +618,6 @@ nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(nsIFrame* aPa
void
nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// report an error if something wrong was found in this frame
@ -633,8 +632,7 @@ nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
DisplayBorderBackgroundOutline(aBuilder, aLists);
BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists,
DISPLAY_CHILD_INLINE);
BuildDisplayListForNonBlockChildren(aBuilder, aLists, DISPLAY_CHILD_INLINE);
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
// for visual debug

View File

@ -126,7 +126,6 @@ public:
}
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;

View File

@ -71,14 +71,13 @@ nsMathMLSelectedFrame::SetInitialChildList(ChildListID aListID,
// Only paint the selected child...
void
nsMathMLSelectedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Report an error if something wrong was found in this frame.
// We can't call nsDisplayMathMLError from here,
// so ask nsMathMLContainerFrame to do the work for us.
if (NS_MATHML_HAS_ERROR(mPresentationData.flags)) {
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
return;
}
@ -89,7 +88,7 @@ nsMathMLSelectedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Put the child's background directly onto the content list
nsDisplayListSet set(aLists, aLists.Content());
// The children should be in content order
BuildDisplayListForChild(aBuilder, childFrame, aDirtyRect, set);
BuildDisplayListForChild(aBuilder, childFrame, set);
}
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)

View File

@ -26,7 +26,6 @@ public:
ChildListChanged(int32_t aModType) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult

View File

@ -201,12 +201,11 @@ nsMathMLmencloseFrame::TransmitAutomaticData()
void
nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
/////////////
// paint the menclosed content
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
if (NS_MATHML_HAS_ERROR(mPresentationData.flags))
return;

View File

@ -70,7 +70,6 @@ public:
GetAdditionalStyleContext(int32_t aIndex) const override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
NS_IMETHOD

View File

@ -161,12 +161,11 @@ nsMathMLmfencedFrame::CreateFencesAndSeparators(nsPresContext* aPresContext)
void
nsMathMLmfencedFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
/////////////
// display the content
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
////////////
// display fences and separators

View File

@ -41,7 +41,6 @@ public:
nsReflowStatus& aStatus) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual void

View File

@ -149,12 +149,11 @@ nsMathMLmfracFrame::CalcLineThickness(nsPresContext* aPresContext,
void
nsMathMLmfracFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
/////////////
// paint the numerator and denominator
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
/////////////
// paint the fraction line

View File

@ -67,7 +67,6 @@ public:
ReflowOutput& aDesiredSize) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
virtual nsresult

View File

@ -78,14 +78,13 @@ nsMathMLmoFrame::UseMathMLChar()
void
nsMathMLmoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
bool useMathMLChar = UseMathMLChar();
if (!useMathMLChar) {
// let the base class do everything
nsMathMLTokenFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLTokenFrame::BuildDisplayList(aBuilder, aLists);
} else {
DisplayBorderBackgroundOutline(aBuilder, aLists);

View File

@ -29,7 +29,6 @@ public:
GetAdditionalStyleContext(int32_t aIndex) const override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
NS_IMETHOD

View File

@ -77,12 +77,11 @@ nsMathMLmrootFrame::TransmitAutomaticData()
void
nsMathMLmrootFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
/////////////
// paint the content we are square-rooting
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
/////////////
// paint the sqrt symbol

View File

@ -51,7 +51,6 @@ public:
ReflowOutput& aDesiredSize) override;
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
uint8_t

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<table>
<col style="background:green">
<tr>
<td style="width:20px; height:20px"></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<body>
<table>
<col style="background:green">
<tr>
<td style="position:relative; left:-100px; width:20px; height:20px"></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<body style="overflow:hidden">
<table style="position:relative; top:-50px">
<col style="background:green; width: 40px;">
<tr style="position:relative; left:-100px; height: 40px">
<td rowspan=2></td>
</tr>
<tr style="height: 40px"></tr>
</table>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<body style="overflow:hidden">
<table style="position:relative; top:-50px">
<tbody style="background:green">
<tr style="position:relative; left:-100px; height: 40px">
<td rowspan=2 style="width: 40px;"></td>
</tr>
<tr style="height: 40px"></tr>
</tbody>
</table>
</body>
</html>

View File

@ -7,3 +7,6 @@
== table-separate-3.html table-separate-3-ref.html
== table-separate-4.html table-separate-4-ref.html
== 1115999-1.html 1115999-1-ref.html
== 1409114-1.html 1409114-1-ref.html
!= 1409114-2.html about:blank
!= 1409114-3.html about:blank

View File

@ -10,8 +10,6 @@
html, body { margin: 0; padding: 0; border: 0; font-size: 16px; }
body { padding: 15px; }
.o { opacity: 0.5; }
/*
table {
margin: 0px 3px 2px 4px;
@ -55,8 +53,8 @@
</head>
<body>
<div class="color o"></div>
<div class="imagetl o"></div>
<div class="color"></div>
<div class="imagetl"></div>
<div class="imagebr"></div>
</body>

Some files were not shown because too many files have changed in this diff Show More