Bug 1394935: Assert that if we find a common ancestor using the dirty bits, it is the actual common flattened tree ancestor. r?bholley draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 31 Aug 2017 09:42:25 +0200
changeset 656818 3c220b14d8529b38d8ea4749e4fcd086bee3bae8
parent 656817 5ef53b0cdeba4b5374d3861b4a1ae9912703bc83
child 656819 f3ce2f3272260067e08bca31d74da101ad173a55
child 656823 1916e3e95bee85c0222a795cd60ff44385789ce8
child 656848 7ae5c4d81447c1a4fbdda758b309d5fdcded9199
push id77325
push userbmo:emilio@crisal.io
push dateThu, 31 Aug 2017 18:09:13 +0000
reviewersbholley
bugs1394935
milestone57.0a1
Bug 1394935: Assert that if we find a common ancestor using the dirty bits, it is the actual common flattened tree ancestor. r?bholley MozReview-Commit-ID: GRJ539QXS9e
dom/base/Element.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -4385,16 +4385,19 @@ NoteDirtyElement(Element* aElement, uint
       // make sure the bit we propagated is also registered on the root.
       doc->SetServoRestyleRoot(existingRoot, existingBits | aBit);
   } else {
     // We reached the root without crossing the pre-existing restyle root. We
     // now need to find the nearest common ancestor, so climb up from the
     // existing root, extending bits along the way.
     Element* rootParent = existingRoot->GetFlattenedTreeParentElementForStyle();
     if (Element* commonAncestor = PropagateBits(rootParent, existingBits, aElement)) {
+      MOZ_ASSERT(commonAncestor == aElement ||
+                 commonAncestor == nsContentUtils::GetCommonFlattenedTreeAncestorForStyle(aElement, rootParent));
+
       // We found a common ancestor. Make that the new style root, and clear the
       // bits between the new style root and the document root.
       doc->SetServoRestyleRoot(commonAncestor, existingBits | aBit);
       Element* curr = commonAncestor;
       while ((curr = curr->GetFlattenedTreeParentElementForStyle())) {
         MOZ_ASSERT(curr->HasFlag(aBit));
         curr->UnsetFlags(aBit);
       }