Bug 1509579 - Part 2: Do not call MarkNeedsDisplayItemRebuild(), when GetDependentFrame() == Frame() r=mattwoodrow
authorMiko Mynttinen <mikokm@gmail.com>
Thu, 29 Nov 2018 20:40:58 +0000
changeset 505314 57816e067da5bac79091eb33436e2d45c8699079
parent 505313 6a516d21eae63a07573958fedb5ff291e2c393b8
child 505315 1e64f8c3f949bb16b4981f255033021b42118586
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1509579
milestone65.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 1509579 - Part 2: Do not call MarkNeedsDisplayItemRebuild(), when GetDependentFrame() == Frame() r=mattwoodrow Depends on D13279 Differential Revision: https://phabricator.services.mozilla.com/D13280
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1048,18 +1048,25 @@ nsIFrame::MarkNeedsDisplayItemRebuild()
   MOZ_ASSERT(
     PresContext()->LayoutPhaseCount(eLayoutPhase_DisplayListBuilding) == 0);
 
   // Hopefully this is cheap, but we could use a frame state bit to note
   // the presence of dependencies to speed it up.
   DisplayItemArray* items = GetProperty(DisplayItems());
   if (items) {
     for (nsDisplayItem* i : *items) {
-      if (i->GetDependentFrame() == this &&
-          !i->HasDeletedFrame()) {
+      if (i->HasDeletedFrame() || i->Frame() == this) {
+        // Ignore the items with deleted frames, and the items with |this| as
+        // the primary frame.
+        continue;
+      }
+
+      if (i->GetDependentFrame() == this) {
+        // For items with |this| as a dependent frame, mark the primary frame
+        // for rebuild.
         i->Frame()->MarkNeedsDisplayItemRebuild();
       }
     }
   }
 }
 
 // Subclass hook for style post processing
 /* virtual */ void