Bug 1062732 - Avoid tracking descendants for restyling if we are force restyling the entire subtree. r=dbaron
authorCameron McCormack <cam@mcc.id.au>
Fri, 19 Sep 2014 11:12:31 +1000
changeset 206123 f481cfe4478372513eb50f681e90fc5fa834f5ee
parent 206122 4738068430a9d734e2c70ccf7b0a052e09623568
child 206124 7b175263c92dc3d8a31ec56d3bd285a5b7e6ac4a
push id27513
push usercbook@mozilla.com
push dateFri, 19 Sep 2014 12:15:35 +0000
treeherdermozilla-central@dadafedc0760 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1062732
milestone35.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 1062732 - Avoid tracking descendants for restyling if we are force restyling the entire subtree. r=dbaron
layout/base/RestyleTracker.h
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -467,17 +467,22 @@ RestyleTracker::AddPendingRestyle(Elemen
       //
       // 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");
-      curData->mDescendants.AppendElement(aElement);
+      // 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->mRestyleHint & eRestyle_ForceDescendants)) {
+        curData->mDescendants.AppendElement(aElement);
+      }
     }
   }
 
   mHaveLaterSiblingRestyles =
     mHaveLaterSiblingRestyles || (aRestyleHint & eRestyle_LaterSiblings) != 0;
   return hadRestyleLaterSiblings;
 }