Bug 1292279 - Consult the dirty bits to determine whether we have pending restyles. r=heycam
authorBobby Holley <bobbyholley@gmail.com>
Tue, 16 Aug 2016 14:06:05 -0700
changeset 311354 0efe171aa2ed8225893e9572d6c691f4ba82c018
parent 311353 fa3534af141f1f6fb4105c1a8b86987dcf4c752d
child 311355 bf5c0fb68628289ccab786054925f7eb5fab2802
push id30607
push userryanvm@gmail.com
push dateFri, 26 Aug 2016 13:37:16 +0000
treeherdermozilla-central@a65b35c8e5b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1292279
milestone51.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 1292279 - Consult the dirty bits to determine whether we have pending restyles. r=heycam The current mechanism assumes that everything can be expressed in terms of restyle hints, which has several limitations (in particular, we can't specify that a subtree is dirty without also claiming that the root is dirty, since eRestyleSubtree implies eRestyleSelf). We may eventually decide that restyles hints give us everything we need, but while we're experimenting I'd like the flexibility to do things both ways.
layout/base/ServoRestyleManager.h
--- a/layout/base/ServoRestyleManager.h
+++ b/layout/base/ServoRestyleManager.h
@@ -70,17 +70,22 @@ public:
                         nsIAtom* aAttribute, int32_t aModType,
                         const nsAttrValue* aOldValue)
   {
     MOZ_ASSERT(SnapshotForElement(aElement)->HasAttrs());
   }
 
   nsresult ReparentStyleContext(nsIFrame* aFrame);
 
-  bool HasPendingRestyles() { return !mModifiedElements.IsEmpty(); }
+  bool HasPendingRestyles()
+  {
+    return !mModifiedElements.IsEmpty() ||
+           PresContext()->Document()->HasDirtyDescendantsForServo();
+  }
+
 
   /**
    * Gets the appropriate frame given a content and a pseudo-element tag.
    *
    * Right now only supports a null tag, before or after. If the pseudo-element
    * is not null, the content needs to be an element.
    */
   static nsIFrame* FrameForPseudoElement(nsIContent* aContent,