Bug 1405544 - Propagate existing bits to the parent element as well when switch the restyle root for invalidation siblings in post-traversal. r?emilio
MozReview-Commit-ID: 8Rmg2FSytlp
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -981,20 +981,22 @@ ServoStyleSet::StyleDocument(ServoTraver
root->HasAnyOfFlags(Element::kAllServoDescendantBits | NODE_NEEDS_FRAME);
if (parent) {
MOZ_ASSERT(root == doc->GetServoRestyleRoot());
if (parent->HasDirtyDescendantsForServo()) {
// If any style invalidation was triggered in our siblings, then we may
// need to post-traverse them, even if the root wasn't restyled after
// all.
+ uint32_t existingBits = doc->GetServoRestyleRootDirtyBits();
+ // We need to propagate the existing bits to the parent.
+ parent->SetFlags(existingBits);
doc->SetServoRestyleRoot(
parent,
- doc->GetServoRestyleRootDirtyBits() |
- ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
+ existingBits | ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
postTraversalRequired = true;
}
}
}
// If there are still animation restyles needed, trigger a second traversal to
// update CSS animations or transitions' styles.
//