Bug 1529831 - Don't create wrap lists for positioned frames that are leaves. r=miko
☠☠ backed out by 3a2ced4fbd98 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 22 Feb 2019 10:36:44 +0000
changeset 518690 65294fe0c614644692640a01497539533aa13b63
parent 518689 f67eca6e9528589d0516916fd66f3e097597a3f5
child 518691 8ca28563b1d02d9ff6c2d43d6c52030c9e6ed90c
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko
bugs1529831
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529831 - Don't create wrap lists for positioned frames that are leaves. r=miko Differential Revision: https://phabricator.services.mozilla.com/D20773
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3397,16 +3397,25 @@ static nsDisplayItem* WrapInWrapList(nsD
   }
 
   if (aCanSkipWrapList) {
     MOZ_ASSERT(!item->GetAbove());
     aList->RemoveBottom();
     return item;
   }
 
+  // If the list contains one item, the frame for that item matches the frame
+  // that would be used for the wrapper, and the frame is a leaf (no
+  // children that might have been skipped this time due to building a
+  // partial DL), then we can skip the wrapper.
+  if (!item->GetAbove() && item->Frame() == aFrame && aFrame->PrincipalChildList().IsEmpty()) {
+    aList->RemoveBottom();
+    return item;
+  }
+
   // Clear clip rect for the construction of the items below. Since we're
   // clipping all their contents, they themselves don't need to be clipped.
   return MakeDisplayItem<nsDisplayWrapList>(aBuilder, aFrame, aList,
                                             aContainerASR, true);
 }
 
 /**
  * Check if a frame should be visited for building display list.