Bug 1394935: Assert that the content we're marking dirty is under the restyle root. r?bholley draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 30 Aug 2017 23:34:34 +0200
changeset 656231 513b2039e111a0f9fdb1ab914590fc9346d4ba6e
parent 656230 b1339e3148ff11286304a002712dda9a68a2cd2e
child 656232 804add0a63efba3b852b27a451d763a1748da2d8
child 656317 83bdf1bd98874f9ca211f0206c1f6c4f462507e9
push id77122
push userbmo:emilio@crisal.io
push dateWed, 30 Aug 2017 21:45:24 +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::ContentIsFlattenedTreeDescendantOf(
+               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);