mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Upgrade Stylo to 2024-01-16 (#32066)
* Upgrade Stylo to 2024-01-16 * Fixup for https://phabricator.services.mozilla.com/D187736 * Fixup for https://phabricator.services.mozilla.com/D196415 * Fixup for https://phabricator.services.mozilla.com/D197147 * Fixup for https://phabricator.services.mozilla.com/D196194 * Fixup for https://phabricator.services.mozilla.com/D196195 * Update test expectations
This commit is contained in:
parent
93bb276602
commit
a5e97525a0
66 changed files with 105 additions and 9370 deletions
|
@ -4,10 +4,12 @@
|
|||
|
||||
use cssparser::{Parser, ParserInput};
|
||||
use euclid::{Scale, Size2D};
|
||||
use servo_arc::Arc;
|
||||
use style::applicable_declarations::CascadePriority;
|
||||
use style::context::QuirksMode;
|
||||
use style::custom_properties::{
|
||||
ComputedCustomProperties, CustomPropertiesBuilder, Name, SpecifiedValue,
|
||||
ComputedCustomProperties, CustomPropertiesBuilder, DeferFontRelativeCustomPropertyResolution,
|
||||
Name, SpecifiedValue,
|
||||
};
|
||||
use style::font_metrics::FontMetrics;
|
||||
use style::media_queries::{Device, MediaType};
|
||||
|
@ -51,9 +53,9 @@ fn cascade(
|
|||
let mut input = ParserInput::new(value);
|
||||
let mut parser = Parser::new(&mut input);
|
||||
let name = Name::from(name);
|
||||
let value = CustomDeclarationValue::Value(
|
||||
let value = CustomDeclarationValue::Value(Arc::new(
|
||||
SpecifiedValue::parse(&mut parser, &dummy_url_data).unwrap(),
|
||||
);
|
||||
));
|
||||
CustomDeclaration { name, value }
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
@ -69,13 +71,13 @@ fn cascade(
|
|||
let mut builder = StyleBuilder::new(stylist.device(), Some(&stylist), None, None, None, false);
|
||||
builder.custom_properties = inherited.clone();
|
||||
let mut rule_cache_conditions = RuleCacheConditions::default();
|
||||
let context = Context::new(
|
||||
let mut context = Context::new(
|
||||
builder,
|
||||
stylist.quirks_mode(),
|
||||
&mut rule_cache_conditions,
|
||||
ContainerSizeQuery::none(),
|
||||
);
|
||||
let mut builder = CustomPropertiesBuilder::new(&stylist, &context);
|
||||
let mut builder = CustomPropertiesBuilder::new(&stylist, &mut context);
|
||||
|
||||
for declaration in &declarations {
|
||||
builder.cascade(
|
||||
|
@ -84,7 +86,8 @@ fn cascade(
|
|||
);
|
||||
}
|
||||
|
||||
builder.build()
|
||||
builder.build(DeferFontRelativeCustomPropertyResolution::No);
|
||||
context.builder.custom_properties
|
||||
}
|
||||
|
||||
#[bench]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue