mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Cleanup StyleBuilder.
This is in preparation of a cascade optimization for custom properties. This fixes various fishiness around our StyleBuilder stuff. In particular, StyleBuilder::for_derived_style (renamed to for_animation) is only used to compute specified values, and thus doesn't need to know about rules, visited style, or other things like that. The flag propagation that was done in StyleAdjuster is now done in StyleBuilder, since we know beforehand which ones are always inherited, and it simplified the callers and the StyleAdjuster code. It also fixed some fishiness wrt which flags were propagated to anon boxes and text. The text-decoration-lines bit is interesting, because the way it was implemented in #17722 meant that display: contents elements did get HAS_DECORATION_LINES flags only if its parent also had it, so in practice the Contents check preserves behavior, but it's only an optimization looking at Gecko's call-sites, so we can remove it too. MozReview-Commit-ID: 6BHCyEO2U8c
This commit is contained in:
parent
7fb470c373
commit
349d6e7167
9 changed files with 104 additions and 132 deletions
|
@ -174,12 +174,11 @@ impl<'a> Context<'a> {
|
|||
F: FnOnce(&Context) -> R
|
||||
{
|
||||
let mut conditions = RuleCacheConditions::default();
|
||||
let default_values = device.default_computed_values();
|
||||
let provider = get_metrics_provider_for_product();
|
||||
|
||||
let context = Context {
|
||||
is_root_element: false,
|
||||
builder: StyleBuilder::for_inheritance(device, default_values, None),
|
||||
builder: StyleBuilder::for_inheritance(device, None, None),
|
||||
font_metrics_provider: &provider,
|
||||
cached_system_font: None,
|
||||
in_media_query: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue