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 656702 ce953033da836cdae737902e858b747a45d5ebfe
parent 656701 2994bd6ccc09e79d37a545d5752f30a91485449b
child 656703 a7514501d84e9078a2ac84ba13b839e5d9183c78
push id77292
push userbmo:emilio@crisal.io
push dateThu, 31 Aug 2017 15:16:37 +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);