Bug 1047928 patch 1 - Add more comments explaining eRestyle_Subtree vs. eRestyle_ForceDescendants. r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Wed, 08 Oct 2014 14:26:57 -0700
changeset 209467 05102e8d7362d76265a039aa065e51b83e80c961
parent 209466 7037d68868eb89e509fe75a974287eb4b07355fd
child 209468 7f4682912226d28d97c29b6bd6e9797ad874c068
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbzbarsky
bugs1047928
milestone35.0a1
Bug 1047928 patch 1 - Add more comments explaining eRestyle_Subtree vs. eRestyle_ForceDescendants. r=bzbarsky
layout/base/nsChangeHint.h
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -285,16 +285,19 @@ inline nsChangeHint NS_HintsNotHandledFo
 enum nsRestyleHint {
   // Rerun selector matching on the element.  If a new style context
   // results, update the style contexts of descendants.  (Irrelevant if
   // eRestyle_Subtree is also set, since that implies a superset of the
   // work.)
   eRestyle_Self = (1<<0),
 
   // Rerun selector matching on the element and all of its descendants.
+  // (Implies eRestyle_ForceDescendants, which ensures that we continue
+  // the restyling process for all descendants, but doesn't cause
+  // selector matching.)
   eRestyle_Subtree = (1<<1),
 
   // Rerun selector matching on all later siblings of the element and
   // all of their descendants.
   eRestyle_LaterSiblings = (1<<2),
 
   // Replace the style data coming from CSS transitions without updating
   // any other style data.  If a new style context results, update style
@@ -337,17 +340,19 @@ enum nsRestyleHint {
   eRestyle_ChangeAnimationPhase = (1 << 7),
 
   // Continue the restyling process to the current frame's children even
   // if this frame's restyling resulted in no style changes.
   eRestyle_Force = (1<<8),
 
   // Continue the restyling process to all of the current frame's
   // descendants, even if any frame's restyling resulted in no style
-  // changes.  (Implies eRestyle_Force.)
+  // changes.  (Implies eRestyle_Force.)  Note that this is weaker than
+  // eRestyle_Subtree, which makes us rerun selector matching on all
+  // descendants rather than just continuing the restyling process.
   eRestyle_ForceDescendants = (1<<9),
 };
 
 // The functions below need an integral type to cast to to avoid
 // infinite recursion.
 typedef decltype(nsRestyleHint(0) + nsRestyleHint(0)) nsRestyleHint_size_t;
 
 inline nsRestyleHint operator|(nsRestyleHint aLeft, nsRestyleHint aRight)