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
--- 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);
}