aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/matching.rs4
-rw-r--r--components/style/properties/computed_value_flags.rs8
-rw-r--r--components/style/properties/properties.mako.rs2
3 files changed, 11 insertions, 3 deletions
diff --git a/components/style/matching.rs b/components/style/matching.rs
index 895fbe74320..3b3ee3e0196 100644
--- a/components/style/matching.rs
+++ b/components/style/matching.rs
@@ -360,8 +360,8 @@ trait PrivateMatchMethods: TElement {
debug!(" > style difference: {:?}", difference);
// We need to cascade the children in order to ensure the correct
- // propagation of computed value flags.
- if old_values.flags != new_values.flags {
+ // propagation of inherited computed value flags.
+ if old_values.flags.inherited() != new_values.flags.inherited() {
debug!(" > flags changed: {:?} != {:?}", old_values.flags, new_values.flags);
return ChildCascadeRequirement::MustCascadeChildren;
}
diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs
index 0e5e5ecd266..3c1b15474cd 100644
--- a/components/style/properties/computed_value_flags.rs
+++ b/components/style/properties/computed_value_flags.rs
@@ -64,3 +64,11 @@ bitflags! {
const IS_STYLE_IF_VISITED = 1 << 9,
}
}
+
+impl ComputedValueFlags {
+ /// Returns the flags that are inherited.
+ #[inline]
+ pub fn inherited(self) -> Self {
+ self & !(INHERITS_DISPLAY | INHERITS_CONTENT | INHERITS_RESET_STYLE)
+ }
+}
diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs
index b33a91e81df..df19f4d24dd 100644
--- a/components/style/properties/properties.mako.rs
+++ b/components/style/properties/properties.mako.rs
@@ -2872,7 +2872,7 @@ impl<'a> StyleBuilder<'a> {
/* rules = */ None,
parent.custom_properties().cloned(),
parent.writing_mode,
- parent.flags,
+ parent.flags.inherited(),
visited_style,
)
}