diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2020-05-08 15:20:01 +0300 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-05-20 13:48:52 +0000 |
commit | 71137783ac6927bd0dc02fce1d6e61e6ec027753 (patch) | |
tree | dd21b7bca3f68759de3f0bc96ef465ce0a13c83f /layout/generic/nsGfxScrollFrame.cpp | |
parent | fe0963002fb16b7e3e53f75004af0e79348c861c (diff) | |
download | UXP-71137783ac6927bd0dc02fce1d6e61e6ec027753.tar UXP-71137783ac6927bd0dc02fce1d6e61e6ec027753.tar.gz UXP-71137783ac6927bd0dc02fce1d6e61e6ec027753.tar.lz UXP-71137783ac6927bd0dc02fce1d6e61e6ec027753.tar.xz UXP-71137783ac6927bd0dc02fce1d6e61e6ec027753.zip |
Issue #1355 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList
Also fix build bustage for De-unified layout/xul in nsRootBoxFrame.cpp
Diffstat (limited to 'layout/generic/nsGfxScrollFrame.cpp')
-rw-r--r-- | layout/generic/nsGfxScrollFrame.cpp | 58 |
1 files changed, 34 insertions, 24 deletions
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 3ed3b0bb3..fea4110c0 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -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); - + { + 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)) { @@ -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; } + |