aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-10-14 14:44:20 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-10-14 14:48:27 +0200
commitb73b5b581b5ad09b971c496684639d654bc69b50 (patch)
tree31dc25a39fd151018768ba81baa62d7c7b802a08
parent8b366a7441a7a4febcb5e2047807f9ad447c7adb (diff)
downloadservo-b73b5b581b5ad09b971c496684639d654bc69b50.tar.gz
servo-b73b5b581b5ad09b971c496684639d654bc69b50.zip
style: Not all computed value flags are really inherited.
This fixes the fishiness I noticed in: https://bugzilla.mozilla.org/show_bug.cgi?id=1407832
-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,
)
}