From a1093ea8682f5b5a611902028aecdcd2e8b43dbd Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 7 Jun 2017 13:22:00 +0800 Subject: [PATCH] style: always re-cascade in native anonymous subtrees --- components/style/traversal.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 536ddf69f87..484bce5faad 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -690,6 +690,12 @@ pub fn recalc_style_at(traversal: &D, 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 // data in the subtree, notify the caller to early-return. if data.styles().is_display_none() {