Skip to content

Commit

Permalink
style: Not all computed value flags are really inherited.
Browse files Browse the repository at this point in the history
This fixes the fishiness I noticed in:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1407832
  • Loading branch information
emilio committed Oct 14, 2017
1 parent 8b366a7 commit b73b5b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/style/matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions components/style/properties/computed_value_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion components/style/properties/properties.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ impl<'a> StyleBuilder<'a> {
/* rules = */ None,
parent.custom_properties().cloned(),
parent.writing_mode,
parent.flags,
parent.flags.inherited(),
visited_style,
)
}
Expand Down

0 comments on commit b73b5b5

Please sign in to comment.