Backed out changeset c872cc627115 (bug 1558937) for reftest failures at 1558937-1.html.
authorBrindusan Cristian <cbrindusan@mozilla.com>
Mon, 24 Jun 2019 06:09:11 +0300
changeset 542741 48f71175c99922f25dc5311f14db5a72c1b3f726
parent 542740 c872cc62711502907b6c99f6c4d157d254d97bc5
child 542742 0e84cf2872e7002304a700246ae709a8a3a6d9da
child 542768 442d11bc5876b0134ede7abd20c812b9d4ee40a1
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1558937
milestone69.0a1
backs outc872cc62711502907b6c99f6c4d157d254d97bc5
first release with
nightly linux32
48f71175c999 / 69.0a1 / 20190624092246 / files
nightly linux64
48f71175c999 / 69.0a1 / 20190624092246 / files
nightly mac
48f71175c999 / 69.0a1 / 20190624092246 / files
nightly win32
48f71175c999 / 69.0a1 / 20190624092246 / files
nightly win64
48f71175c999 / 69.0a1 / 20190624092246 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset c872cc627115 (bug 1558937) for reftest failures at 1558937-1.html.
layout/generic/nsPageFrame.cpp
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/reftests/bugs/1558937-1-ref.html
layout/reftests/bugs/1558937-1.html
layout/reftests/bugs/reftest.list
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -400,18 +400,18 @@ static void PruneDisplayListForExtraPage
   }
   aList->AppendToTop(&newList);
 }
 
 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)) {
     return;
   }
   nsDisplayList list;
   aExtraPage->BuildDisplayListForStackingContext(aBuilder, &list);
   PruneDisplayListForExtraPage(aBuilder, aPage, aExtraPage, &list);
@@ -515,37 +515,23 @@ void nsPageFrame::BuildDisplayList(nsDis
 
     // We may need to paint out-of-flow frames whose placeholders are
     // on other pages. Add those pages to our display list. Note that
     // out-of-flow frames can't be placed after their placeholders so
     // we don't have to process earlier pages. The display lists for
     // 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
     // is used to compute the visible rect if AddCanvasBackgroundColorItem
     // creates a display item.
     nsDisplayListBuilder::AutoBuildingDisplayList building(
         aBuilder, child, visibleRect, visibleRect);
 
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1216,17 +1216,16 @@ nsDisplayListBuilder::nsDisplayListBuild
       mCurrentActiveScrolledRoot(nullptr),
       mCurrentContainerASR(nullptr),
       mCurrentFrame(aReferenceFrame),
       mCurrentReferenceFrame(aReferenceFrame),
       mNeedsDisplayListBuild{},
       mRootAGR(AnimatedGeometryRoot::CreateAGRForFrame(
           aReferenceFrame, nullptr, true, aRetainingDisplayList)),
       mCurrentAGR(mRootAGR),
-      mBuildingExtraPagesForPageNum(0),
       mUsedAGRBudget(0),
       mDirtyRect(-1, -1, -1, -1),
       mGlassDisplayItem(nullptr),
       mCaretFrame(nullptr),
       mScrollInfoItemsForHoisting(nullptr),
       mFirstClipChainToDestroy(nullptr),
       mActiveScrolledRootForRootScrollframe(nullptr),
       mMode(aMode),
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1694,23 +1694,16 @@ class nsDisplayListBuilder {
   void SavePreserves3DRect() { mPreserves3DCtx.mVisibleRect = mVisibleRect; }
 
   bool IsBuildingInvisibleItems() const { return mBuildingInvisibleItems; }
 
   void SetBuildingInvisibleItems(bool aBuildingInvisibleItems) {
     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.
    */
   AnimatedGeometryRoot* AnimatedGeometryRootForASR(
       const ActiveScrolledRoot* aASR);
 
   bool HitTestIsForVisibility() const { return mHitTestIsForVisibility; }
@@ -1891,18 +1884,16 @@ class nsDisplayListBuilder {
   nsDataHashtable<nsPtrHashKey<nsPresContext>, DocumentWillChangeBudget>
       mWillChangeBudget;
 
   // Any frame listed in this set is already counted in the budget
   // and thus is in-budget.
   nsDataHashtable<nsPtrHashKey<nsIFrame>, FrameWillChangeBudget>
       mWillChangeBudgetSet;
 
-  uint8_t mBuildingExtraPagesForPageNum;
-
   // Area of animated geometry root budget already allocated
   uint32_t mUsedAGRBudget;
   // Set of frames already counted in budget
   nsTHashtable<nsPtrHashKey<nsIFrame>> mAGRBudgetSet;
 
   nsDataHashtable<nsPtrHashKey<RemoteBrowser>, EffectsInfo> mEffectsUpdates;
 
   // Relative to mCurrentFrame.
@@ -2069,30 +2060,30 @@ MOZ_ALWAYS_INLINE T* MakeDisplayItem(nsD
 
   T* item = new (aBuilder) T(aBuilder, aFrame, std::forward<Args>(aArgs)...);
 
   if (type != DisplayItemType::TYPE_GENERIC) {
     item->SetType(type);
   }
 
   item->SetPerFrameKey(item->CalculatePerFrameKey());
-  item->SetExtraPageForPageNum(aBuilder->GetBuildingExtraPagesForPageNum());
 
   nsPaintedDisplayItem* paintedItem = item->AsPaintedDisplayItem();
   if (paintedItem) {
     UpdateDisplayItemData(paintedItem);
   }
 
   if (aBuilder->InInvalidSubtree() ||
       item->FrameForInvalidation()->IsFrameModified()) {
     item->SetModifiedFrame(true);
   }
 
 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
-  if (aBuilder->IsRetainingDisplayList() && aBuilder->IsBuilding()) {
+  if (aBuilder->IsRetainingDisplayList() && !aBuilder->IsInPageSequence() &&
+      aBuilder->IsBuilding()) {
     AssertUniqueItem(item);
   }
 
   // Verify that InInvalidSubtree matches invalidation frame's modified state.
   if (aBuilder->InInvalidSubtree()) {
     MOZ_DIAGNOSTIC_ASSERT(
         AnyContentAncestorModified(item->FrameForInvalidation()));
   }
@@ -2224,22 +2215,21 @@ class nsDisplayItemBase : public nsDispl
     return mType;
   }
 
   /**
    * Pairing this with the Frame() pointer gives a key that
    * 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<uint32_t>(mExtraPageForPageNum) << (TYPE_BITS + (sizeof(mKey) * 8))) |
-           (static_cast<uint32_t>(mKey) << TYPE_BITS) |
+    return (static_cast<uint32_t>(mKey) << TYPE_BITS) |
            static_cast<uint32_t>(mType);
   }
 
   /**
    * Returns the initial per frame key for this display item.
    */
   virtual uint16_t CalculatePerFrameKey() const { return 0; }
 
@@ -2336,40 +2326,30 @@ class nsDisplayItemBase : public nsDispl
     }
   }
 
   nsDisplayItemBase(nsDisplayListBuilder* aBuilder,
                     const nsDisplayItemBase& aOther)
       : mFrame(aOther.mFrame),
         mItemFlags(aOther.mItemFlags),
         mType(aOther.mType),
-        mExtraPageForPageNum(aOther.mExtraPageForPageNum),
         mKey(aOther.mKey) {
     MOZ_COUNT_CTOR(nsDisplayItemBase);
   }
 
   virtual ~nsDisplayItemBase() {
     MOZ_COUNT_DTOR(nsDisplayItemBase);
     if (mFrame) {
       mFrame->RemoveDisplayItem(this);
     }
   }
 
   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
 
  private:
   enum class ItemBaseFlag : uint8_t {
     CantBeReused,
     DeletedFrame,
@@ -2378,17 +2358,16 @@ class nsDisplayItemBase : public nsDispl
 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
     MergedItem,
     PreProcessedItem,
 #endif
   };
 
   mozilla::EnumSet<ItemBaseFlag, uint8_t> mItemFlags;  // 1
   DisplayItemType mType;                               // 1
-  uint8_t mExtraPageForPageNum = 0;                    // 1
   uint16_t mKey;                                       // 2
   OldListIndex mOldListIndex;                          // 4
   uintptr_t mOldList = 0;                              // 8
 
 #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
  public:
   bool IsMergedItem() const {
     return mItemFlags.contains(ItemBaseFlag::MergedItem);
deleted file mode 100644
--- a/layout/reftests/bugs/1558937-1-ref.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-paged">
-<body>
-<div style="height:400px;"></div>
-<div style="height:1000px">
-  <div style="width:100px; height:100px; background:black;">Hi</div>
-</div>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/bugs/1558937-1.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-paged">
-<body>
-<div style="height:400px;"></div>
-<div style="height:1000px; clip-path:border-box">
-  <div style="position:absolute; top:0; left:0; width:100px; height:100px; background:black;">Hi</div>
-  <div style="width:100px; height:100px; background:black;">Hi</div>
-</div>
-</body>
-</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -2104,9 +2104,8 @@ pref(layout.css.supports-selector.enable
 == 1511570.html 1511570-ref.html
 fuzzy-if(!webrender,1-5,66-547) fuzzy-if(geckoview,1-2,64-141) == 1529992-1.html 1529992-1-ref.html
 fuzzy-if(!webrender,0-6,0-34) fails-if(webrender) fuzzy-if(geckoview,9-9,44-44) == 1529992-2.html 1529992-2-ref.html
 == 1535040-1.html 1535040-1-ref.html
 == 1545360-1.xhtml 1545360-1-ref.xhtml
 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