mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Ensure to copy over the viewport/font units invalidation bits when reusing reset properties
Differential Revision: https://phabricator.services.mozilla.com/D127262
This commit is contained in:
parent
f17c42110c
commit
3bf9bf696a
1 changed files with 13 additions and 5 deletions
|
@ -853,12 +853,20 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
|
|
||||||
// We're using the same reset style as another element, and we'll skip
|
// We're using the same reset style as another element, and we'll skip
|
||||||
// applying the relevant properties. So we need to do the relevant
|
// applying the relevant properties. So we need to do the relevant
|
||||||
// bookkeeping here to keep these two bits correct.
|
// bookkeeping here to keep these bits correct.
|
||||||
//
|
//
|
||||||
// Note that all the properties involved are non-inherited, so we don't
|
// Note that the border/background properties are non-inherited, so we
|
||||||
// need to do anything else other than just copying the bits over.
|
// don't need to do anything else other than just copying the bits over.
|
||||||
let reset_props_bits = ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND;
|
//
|
||||||
builder.add_flags(cached_style.flags & reset_props_bits);
|
// When using this optimization, we also need to copy whether the old
|
||||||
|
// style specified viewport units / used font-relative lengths, this one
|
||||||
|
// would as well. It matches the same rules, so it is the right thing
|
||||||
|
// to do anyways, even if it's only used on inherited properties.
|
||||||
|
let bits_to_copy = ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND |
|
||||||
|
ComputedValueFlags::DEPENDS_ON_SELF_FONT_METRICS |
|
||||||
|
ComputedValueFlags::DEPENDS_ON_INHERITED_FONT_METRICS |
|
||||||
|
ComputedValueFlags::USES_VIEWPORT_UNITS;
|
||||||
|
builder.add_flags(cached_style.flags & bits_to_copy);
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue