mirror of
https://github.com/servo/servo.git
synced 2025-09-27 15:20:09 +01:00
Update Stylo to 2023-10-16 (#31932)
* Update Stylo to 2023-10-16 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D188216 * Fixup for https://phabricator.services.mozilla.com/D185677 * Fixup for https://phabricator.services.mozilla.com/D188566 * Fixup for https://phabricator.services.mozilla.com/D188727 * Fixup for https://phabricator.services.mozilla.com/D189475 * Fixup for https://phabricator.services.mozilla.com/D189521 * Fixup for https://phabricator.services.mozilla.com/D188812 * Fixup for https://phabricator.services.mozilla.com/D189484 * Update test expectations
This commit is contained in:
parent
a7ad92d9a3
commit
fff9ef87e6
48 changed files with 97 additions and 181 deletions
|
@ -21,9 +21,10 @@ fn srgb_legacy_from_floats(red: f32, green: f32, blue: f32, alpha: f32) -> Absol
|
|||
// Color
|
||||
#[test]
|
||||
fn test_rgba_color_interepolation_preserves_transparent() {
|
||||
let transparent = AbsoluteColor::TRANSPARENT_BLACK;
|
||||
assert_eq!(
|
||||
interpolate_color(AbsoluteColor::TRANSPARENT, AbsoluteColor::TRANSPARENT, 0.5),
|
||||
AbsoluteColor::TRANSPARENT
|
||||
interpolate_color(transparent, transparent, 0.5),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
|
||||
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::{
|
||||
CustomPropertiesBuilder, CustomPropertiesMap, Name, SpecifiedValue,
|
||||
ComputedCustomProperties, CustomPropertiesBuilder, Name, SpecifiedValue,
|
||||
};
|
||||
use style::media_queries::{Device, MediaType};
|
||||
use style::properties::{CustomDeclaration, CustomDeclarationValue};
|
||||
|
@ -19,8 +18,8 @@ use test::{self, Bencher};
|
|||
|
||||
fn cascade(
|
||||
name_and_value: &[(&str, &str)],
|
||||
inherited: Option<&Arc<CustomPropertiesMap>>,
|
||||
) -> Option<Arc<CustomPropertiesMap>> {
|
||||
inherited: &ComputedCustomProperties,
|
||||
) -> ComputedCustomProperties {
|
||||
let declarations = name_and_value
|
||||
.iter()
|
||||
.map(|&(name, value)| {
|
||||
|
@ -39,7 +38,7 @@ fn cascade(
|
|||
Scale::new(1.0),
|
||||
);
|
||||
let stylist = Stylist::new(device, QuirksMode::NoQuirks);
|
||||
let mut builder = CustomPropertiesBuilder::new(inherited, &stylist);
|
||||
let mut builder = CustomPropertiesBuilder::new(inherited, &stylist, false);
|
||||
|
||||
for declaration in &declarations {
|
||||
builder.cascade(
|
||||
|
@ -54,11 +53,14 @@ fn cascade(
|
|||
#[bench]
|
||||
fn cascade_custom_simple(b: &mut Bencher) {
|
||||
b.iter(|| {
|
||||
let parent = cascade(&[("foo", "10px"), ("bar", "100px")], None);
|
||||
let parent = cascade(
|
||||
&[("foo", "10px"), ("bar", "100px")],
|
||||
&ComputedCustomProperties::default(),
|
||||
);
|
||||
|
||||
test::black_box(cascade(
|
||||
&[("baz", "calc(40em + 4px)"), ("bazz", "calc(30em + 4px)")],
|
||||
parent.as_ref(),
|
||||
&parent,
|
||||
))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue