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 656706 0b58b85bdbccde1d06751ab2bcda2c58a7c7bfed
parent 656705 ef9733365ec62a05cbf6cb9bd30c0633d4303382
child 656707 da4eeed9ab8a9bee0677bdb8ad5117835173f459
child 656764 d4bb62229bc439942f0fef24d1f9d1f24182a9d6
push id77292
push userbmo:emilio@crisal.io
push dateThu, 31 Aug 2017 15:16:37 +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 ||
+                 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);
       }