Bug 1394935: Assert that the content we're marking dirty is under the restyle root. r?bholley draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 31 Aug 2017 09:42:21 +0200
changeset 656815 2253ef9871c6d1ea3c3de8e8d5f20a529e9083cf
parent 656814 3134045df751c2d6a251cff182131c8fc4df7ea1
child 656816 44811bfa011dd9330bef4b9a1d8852fa9db45d79
push id77325
push userbmo:emilio@crisal.io
push dateThu, 31 Aug 2017 18:09:13 +0000
reviewersbholley
bugs1394935
milestone57.0a1
Bug 1394935: Assert that the content we're marking dirty is under the restyle root. r?bholley This would also have catched the bug earlier. MozReview-Commit-ID: 8uNXPnpXk6m
dom/base/Element.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -4382,16 +4382,19 @@ NoteDirtyElement(Element* aElement, uint
       // We didn't find a common ancestor element. That means we're descended
       // from two different document style roots, so the common ancestor is the
       // document.
       doc->SetServoRestyleRoot(doc, existingBits | aBit);
     }
   }
 
   MOZ_ASSERT(aElement == doc->GetServoRestyleRoot() ||
+             nsContentUtils::ContentIsFlattenedTreeDescendantOfForStyle(
+               aElement, doc->GetServoRestyleRoot()));
+  MOZ_ASSERT(aElement == doc->GetServoRestyleRoot() ||
              BitIsPropagated(parent, aBit, doc->GetServoRestyleRoot()));
   MOZ_ASSERT(doc->GetServoRestyleRootDirtyBits() & aBit);
 }
 
 void
 Element::NoteDirtyForServo()
 {
   NoteDirtyElement(this, ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO);