Only create wrap lists for non-stacking contexts
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 09 Oct 2017 15:40:50 +1300
changeset 685675 7d57770e60c0cb399a551de51a2d71df65c90f05
parent 685674 a5138c1d1809569a6623a2f3efa4c57f63717cdc
child 685676 1d917ba31e53ff28cbdc063c418615c749895ba1
push id86010
push userbmo:ethlin@mozilla.com
push dateWed, 25 Oct 2017 00:44:42 +0000
milestone58.0a1
Only create wrap lists for non-stacking contexts
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3110,33 +3110,21 @@ WrapInWrapList(nsDisplayListBuilder* aBu
                nsIFrame* aFrame, nsDisplayList* aList,
                const ActiveScrolledRoot* aContainerASR)
 {
   nsDisplayItem* item = aList->GetBottom();
   if (!item) {
     return nullptr;
   }
 
-  // For perspective items we want to treat the 'frame' as being the transform
-  // frame that created it. This stops the transform frame from wrapping another
-  // nsDisplayWrapList around it (with mismatching reference frames), but still
-  // makes the perspective frame create one (so we have an atomic entry for z-index
-  // sorting).
-
-  /*
-  // TODO: Because of the above, this currently causes an assertion in
-  // nsDisplayList.h, nsDisplayWrapList::GetSameCoordinateSystemChildren
-
-  nsIFrame *itemFrame = item->Frame();
-  if (item->GetType() == DisplayItemType::TYPE_PERSPECTIVE) {
-    itemFrame = static_cast<nsDisplayPerspective*>(item)->TransformFrame();
-  }
-  */
-
-  return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList, aContainerASR);
+  if (!aFrame->IsStackingContext()) {
+    return new (aBuilder) nsDisplayWrapList(aBuilder, aFrame, aList, aContainerASR);
+  }
+  aList->RemoveBottom();
+  return item;
 }
 
 /**
  * Check if a frame should be visited for building display list.
  */
 static bool
 DescendIntoChild(nsDisplayListBuilder* aBuilder, nsIFrame *aChild,
                  const nsRect& aDirty, const nsRect& aVisible)