mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
style: Don't optimize ::before/::after away if content/display have been specified via custom properties.
We need to treat them the same way as we treat content: inherit. Differential Revision: https://phabricator.services.mozilla.com/D90222
This commit is contained in:
parent
60d89cfbc0
commit
74a46d96eb
4 changed files with 27 additions and 8 deletions
|
@ -478,6 +478,25 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
|||
.rule_cache_conditions
|
||||
.borrow_mut()
|
||||
.set_uncacheable();
|
||||
|
||||
// NOTE(emilio): We only really need to add the `display` /
|
||||
// `content` flag if the CSS variable has not been specified on our
|
||||
// declarations, but we don't have that information at this point,
|
||||
// and it doesn't seem like an important enough optimization to
|
||||
// warrant it.
|
||||
match declaration.id {
|
||||
LonghandId::Display => {
|
||||
self.context
|
||||
.builder
|
||||
.add_flags(ComputedValueFlags::DISPLAY_DEPENDS_ON_INHERITED_STYLE);
|
||||
},
|
||||
LonghandId::Content => {
|
||||
self.context
|
||||
.builder
|
||||
.add_flags(ComputedValueFlags::CONTENT_DEPENDS_ON_INHERITED_STYLE);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
||||
Cow::Owned(declaration.value.substitute_variables(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue