Bug 1345699 - stylo: Always re-cascade in native anonymous subtrees. r?emilio
MozReview-Commit-ID: E1PhDnGkNIA
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -694,16 +694,22 @@ pub fn recalc_style_at<E, D>(traversal:
// data in the subtree, notify the caller to early-return.
if data.styles().is_display_none() {
debug!("{:?} style is display:none - clearing data from descendants.",
element);
clear_descendant_data(element, &|e| unsafe { D::clear_element_data(&e) });
}
}
+ // We must always cascade native anonymous subtrees, since they inherit styles
+ // from their first non-NAC ancestor.
+ if element.is_native_anonymous() {
+ cascade_hint |= RECASCADE_SELF;
+ }
+
// Now that matching and cascading is done, clear the bits corresponding to
// those operations and compute the propagated restyle hint.
let mut propagated_hint = match data.get_restyle_mut() {
None => StoredRestyleHint::empty(),
Some(r) => {
debug_assert!(context.shared.traversal_flags.for_animation_only() ||
!r.hint.has_animation_hint(),
"animation restyle hint should be handled during \