Auto merge of #17204 - heycam:recascade-nac, r=emilio

style: always re-cascade in native anonymous subtrees

From https://bugzilla.mozilla.org/show_bug.cgi?id=1345699.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17204)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-07 01:04:08 -07:00 committed by GitHub
commit 644773d492

View file

@ -690,6 +690,12 @@ pub fn recalc_style_at<E, D>(traversal: &D,
ChildCascadeRequirement::CanSkipCascade => {} ChildCascadeRequirement::CanSkipCascade => {}
}; };
// 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;
}
// If we're restyling this element to display:none, throw away all style // If we're restyling this element to display:none, throw away all style
// data in the subtree, notify the caller to early-return. // data in the subtree, notify the caller to early-return.
if data.styles().is_display_none() { if data.styles().is_display_none() {