Bug 1357142: Always append descendants to RestyleTracker. r=bz,heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 18 Apr 2017 01:49:49 +0200
changeset 402878 c37a6aba9245a51e8c4ffdbd5e28ad28767581b1
parent 402877 210986a3b355c89dfd2621b21267da0f904d7f9e
child 402879 16a917f9afbcf8f75191f8189d5abccbe03b1c6b
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, heycam
bugs1357142
milestone55.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 1357142: Always append descendants to RestyleTracker. r=bz,heycam MozReview-Commit-ID: 80ORql9Zixg
layout/base/RestyleTracker.h
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -340,23 +340,22 @@ RestyleTracker::AddPendingRestyle(Elemen
       // after we deal with cur.
       //
       // As with the mRestyleRoots array, mDescendants maintains the
       // invariant that if two elements appear in the array and one
       // is an ancestor of the other, that the ancestor appears after
       // the descendant.
       RestyleData* curData;
       mPendingRestyles.Get(cur, &curData);
-      NS_ASSERTION(curData, "expected to find a RestyleData for cur");
-      // If cur has an eRestyle_ForceDescendants restyle hint, then we
-      // know that we will get to all descendants.  Don't bother
-      // recording the descendant to restyle in that case.
-      if (curData && !(curData->mRestyleHint & eRestyle_ForceDescendants)) {
-        curData->mDescendants.AppendElement(aElement);
-      }
+
+      // Even if cur has a ForceDescendants restyle hint, we're not guaranteed
+      // to reach aElement in the case the PresShell posts a restyle event from
+      // PostRecreateFramesFor, so we need to track it here.
+      MOZ_ASSERT(curData, "expected to find a RestyleData for cur");
+      curData->mDescendants.AppendElement(aElement);
     }
   }
 
   mHaveLaterSiblingRestyles =
     mHaveLaterSiblingRestyles || (aRestyleHint & eRestyle_LaterSiblings) != 0;
   return hadRestyleLaterSiblings;
 }