Bug 1394935: Assert that if we find a common ancestor using the dirty bits, it is the actual common flattened tree ancestor. r=bholley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 31 Aug 2017 09:42:25 +0200
changeset 378051 c3f9a3e2ce9649289fd0e2e527e09206426f2730
parent 378050 3b1074717dac63fd1e2d2128f522c35ad9e59899
child 378052 8daf204f77fbf183e3660fd89e170f076967d245
push id50168
push userecoal95@gmail.com
push dateThu, 31 Aug 2017 20:39:34 +0000
treeherderautoland@8daf204f77fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1394935
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);
       }