diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 70ca1bf6f608..bb8fd1b8595b 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -405,8 +405,8 @@ static void BuildDisplayListForExtraPage(nsDisplayListBuilder* aBuilder, nsPageFrame* aPage, nsIFrame* aExtraPage, nsDisplayList* aList) { - // The only content in aExtraPage we care about is out-of-flow content from - // aPage, whose placeholders have occurred in aExtraPage. If + // The only content in aExtraPage we care about is out-of-flow content whose + // placeholders have occurred in aPage. If // NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO is not set, then aExtraPage has // no such content. if (!aExtraPage->HasAnyStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) { @@ -520,27 +520,13 @@ void nsPageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // these extra pages are pruned so that only display items for the // page we currently care about (which we would have reached by // following placeholders to their out-of-flows) end up on the list. - // - // Stacking context frames that wrap content on their normal page, - // as well as OOF content for this page will have their container - // items duplicated. We tell the builder to include our page number - // in the unique key for any extra page items so that they can be - // differentiated from the ones created on the normal page. - NS_ASSERTION(mPageNum <= 255, "Too many pages to handle OOFs"); - if (mPageNum <= 255) { - uint8_t oldPageNum = aBuilder->GetBuildingExtraPagesForPageNum(); - aBuilder->SetBuildingExtraPagesForPageNum(mPageNum); + nsIFrame* page = child; + while ((page = GetNextPage(page)) != nullptr) { + nsRect childVisible = visibleRect + child->GetOffsetTo(page); - nsIFrame* page = child; - while ((page = GetNextPage(page)) != nullptr) { - nsRect childVisible = visibleRect + child->GetOffsetTo(page); - - nsDisplayListBuilder::AutoBuildingDisplayList buildingForChild( - aBuilder, page, childVisible, childVisible); - BuildDisplayListForExtraPage(aBuilder, this, page, &content); - } - - aBuilder->SetBuildingExtraPagesForPageNum(oldPageNum); + nsDisplayListBuilder::AutoBuildingDisplayList buildingForChild( + aBuilder, page, childVisible, childVisible); + BuildDisplayListForExtraPage(aBuilder, this, page, &content); } // Invoke AutoBuildingDisplayList to ensure that the correct visibleRect diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 71269ac7af74..74b8f54e2170 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1221,7 +1221,6 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame, mRootAGR(AnimatedGeometryRoot::CreateAGRForFrame( aReferenceFrame, nullptr, true, aRetainingDisplayList)), mCurrentAGR(mRootAGR), - mBuildingExtraPagesForPageNum(0), mUsedAGRBudget(0), mDirtyRect(-1, -1, -1, -1), mGlassDisplayItem(nullptr), diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 24bde4b17dc2..1a69e6ee3ea8 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -1699,13 +1699,6 @@ class nsDisplayListBuilder { mBuildingInvisibleItems = aBuildingInvisibleItems; } - void SetBuildingExtraPagesForPageNum(uint8_t aPageNum) { - mBuildingExtraPagesForPageNum = aPageNum; - } - uint8_t GetBuildingExtraPagesForPageNum() const { - return mBuildingExtraPagesForPageNum; - } - /** * This is a convenience function to ease the transition until AGRs and ASRs * are unified. @@ -1896,8 +1889,6 @@ class nsDisplayListBuilder { nsDataHashtable, FrameWillChangeBudget> mWillChangeBudgetSet; - uint8_t mBuildingExtraPagesForPageNum; - // Area of animated geometry root budget already allocated uint32_t mUsedAGRBudget; // Set of frames already counted in budget @@ -2074,7 +2065,6 @@ MOZ_ALWAYS_INLINE T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, F* aFrame, } item->SetPerFrameKey(item->CalculatePerFrameKey()); - item->SetExtraPageForPageNum(aBuilder->GetBuildingExtraPagesForPageNum()); nsPaintedDisplayItem* paintedItem = item->AsPaintedDisplayItem(); if (paintedItem) { @@ -2087,7 +2077,8 @@ MOZ_ALWAYS_INLINE T* MakeDisplayItem(nsDisplayListBuilder* aBuilder, F* aFrame, } #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED - if (aBuilder->IsRetainingDisplayList() && aBuilder->IsBuilding()) { + if (aBuilder->IsRetainingDisplayList() && !aBuilder->IsInPageSequence() && + aBuilder->IsBuilding()) { AssertUniqueItem(item); } @@ -2229,12 +2220,11 @@ class nsDisplayItemBase : public nsDisplayItemLink { * uniquely identifies this display item in the display item tree. */ uint32_t GetPerFrameKey() const { - // The top 8 bits are the page index + // The top 8 bits are currently unused. // The middle 16 bits of the per frame key uniquely identify the display // item when there are more than one item of the same type for a frame. // The low 8 bits are the display item type. - return (static_cast(mExtraPageForPageNum) << (TYPE_BITS + (sizeof(mKey) * 8))) | - (static_cast(mKey) << TYPE_BITS) | + return (static_cast(mKey) << TYPE_BITS) | static_cast(mType); } @@ -2341,7 +2331,6 @@ class nsDisplayItemBase : public nsDisplayItemLink { : mFrame(aOther.mFrame), mItemFlags(aOther.mItemFlags), mType(aOther.mType), - mExtraPageForPageNum(aOther.mExtraPageForPageNum), mKey(aOther.mKey) { MOZ_COUNT_CTOR(nsDisplayItemBase); } @@ -2356,15 +2345,6 @@ class nsDisplayItemBase : public nsDisplayItemLink { void SetType(const DisplayItemType aType) { mType = aType; } void SetPerFrameKey(const uint16_t aKey) { mKey = aKey; } - // Display list building for printing can build duplicate - // container display items when they contain a mixture of - // OOF and normal content that is spread across multiple - // pages. We include the page number for the duplicates - // to make our GetPerFrameKey unique. - void SetExtraPageForPageNum(const uint8_t aPageNum) { - mExtraPageForPageNum = aPageNum; - } - void SetDeletedFrame(); nsIFrame* mFrame; // 8 @@ -2383,7 +2363,6 @@ class nsDisplayItemBase : public nsDisplayItemLink { mozilla::EnumSet mItemFlags; // 1 DisplayItemType mType; // 1 - uint8_t mExtraPageForPageNum = 0; // 1 uint16_t mKey; // 2 OldListIndex mOldListIndex; // 4 uintptr_t mOldList = 0; // 8 diff --git a/layout/reftests/bugs/1558937-1-ref.html b/layout/reftests/bugs/1558937-1-ref.html deleted file mode 100644 index 0e0bd4eb7296..000000000000 --- a/layout/reftests/bugs/1558937-1-ref.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
-
Hi
-
- - diff --git a/layout/reftests/bugs/1558937-1.html b/layout/reftests/bugs/1558937-1.html deleted file mode 100644 index a40b19964123..000000000000 --- a/layout/reftests/bugs/1558937-1.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -
-
-
Hi
-
Hi
-
- - diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index e67c813fe0bc..7d5d881e3d58 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -2109,4 +2109,3 @@ fuzzy-if(!webrender,0-6,0-34) fails-if(webrender) fuzzy-if(geckoview,9-9,44-44) skip-if(!asyncPan) fuzzy-if(geckoview,1-1,165-165) == 1544895.html 1544895-ref.html == 1548809.html 1548809-ref.html != 1552789-1.html 1552789-ref-1.html -== 1558937-1.html 1558937-1-ref.html