diff --git a/servo/components/style/custom_properties.rs b/servo/components/style/custom_properties.rs index f919dc62e399..2e78222ec03c 100644 --- a/servo/components/style/custom_properties.rs +++ b/servo/components/style/custom_properties.rs @@ -930,6 +930,9 @@ impl<'a, 'b: 'a> CustomPropertiesBuilder<'a, 'b> { if let Some(registration) = custom_registration { let mut input = ParserInput::new(&unparsed_value.css); let mut input = Parser::new(&mut input); + // TODO(bug 1856522): Substitute custom property references in font-* + // declarations before computing registered custom properties containing + // font-relative units. if let Ok(value) = SpecifiedRegisteredValue::compute( &mut input, registration, diff --git a/servo/components/style/properties_and_values/value.rs b/servo/components/style/properties_and_values/value.rs index dbd633681101..570baf4893e5 100644 --- a/servo/components/style/properties_and_values/value.rs +++ b/servo/components/style/properties_and_values/value.rs @@ -30,12 +30,10 @@ use style_traits::{ /// A single component of the computed value. pub type ComputedValueComponent = GenericValueComponent< - // TODO(zrhoffman, bug 1856524): Use computed::Length - specified::Length, + computed::Length, computed::Number, computed::Percentage, - // TODO(zrhoffman, bug 1856524): Use computed::LengthPercentage - specified::LengthPercentage, + computed::LengthPercentage, computed::Color, computed::Image, computed::url::ComputedUrl, @@ -143,11 +141,9 @@ impl ToComputedValue for SpecifiedValueComponent { fn to_computed_value(&self, context: &computed::Context) -> Self::ComputedValue { match self { - SpecifiedValueComponent::Length(length) => ComputedValueComponent::Length( - // TODO(zrhoffman, bug 1856524): Compute , which may contain font-relative - // units - length.clone(), - ), + SpecifiedValueComponent::Length(length) => { + ComputedValueComponent::Length(length.to_computed_value(context)) + }, SpecifiedValueComponent::Number(number) => { ComputedValueComponent::Number(number.to_computed_value(context)) }, @@ -155,9 +151,9 @@ impl ToComputedValue for SpecifiedValueComponent { ComputedValueComponent::Percentage(percentage.to_computed_value(context)) }, SpecifiedValueComponent::LengthPercentage(length_percentage) => { - // TODO(zrhoffman, bug 1856524): Compute , which may contain - // font-relative units - ComputedValueComponent::LengthPercentage(length_percentage.clone()) + ComputedValueComponent::LengthPercentage( + length_percentage.to_computed_value(context), + ) }, SpecifiedValueComponent::Color(color) => { ComputedValueComponent::Color(color.to_computed_value(context)) @@ -200,10 +196,9 @@ impl ToComputedValue for SpecifiedValueComponent { fn from_computed_value(computed: &Self::ComputedValue) -> Self { match computed { - ComputedValueComponent::Length(length) => SpecifiedValueComponent::Length( - // TODO(zrhoffman, bug 1856524): Use computed - length.clone(), - ), + ComputedValueComponent::Length(length) => { + SpecifiedValueComponent::Length(ToComputedValue::from_computed_value(length)) + }, ComputedValueComponent::Number(number) => { SpecifiedValueComponent::Number(ToComputedValue::from_computed_value(number)) }, @@ -211,8 +206,9 @@ impl ToComputedValue for SpecifiedValueComponent { ToComputedValue::from_computed_value(percentage), ), ComputedValueComponent::LengthPercentage(length_percentage) => { - // TODO(zrhoffman, bug 1856524): Use computed - SpecifiedValueComponent::LengthPercentage(length_percentage.clone()) + SpecifiedValueComponent::LengthPercentage(ToComputedValue::from_computed_value( + length_percentage, + )) }, ComputedValueComponent::Color(color) => { SpecifiedValueComponent::Color(ToComputedValue::from_computed_value(color)) diff --git a/testing/web-platform/meta/css/css-properties-values-api/at-property-shadow.html.ini b/testing/web-platform/meta/css/css-properties-values-api/at-property-shadow.html.ini deleted file mode 100644 index 0e2690a6e638..000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/at-property-shadow.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[at-property-shadow.html] - [@property rules in shadow trees should have no effect] - expected: FAIL - diff --git a/testing/web-platform/meta/css/css-properties-values-api/at-property-viewport-units.html.ini b/testing/web-platform/meta/css/css-properties-values-api/at-property-viewport-units.html.ini deleted file mode 100644 index 6907fd5131ae..000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/at-property-viewport-units.html.ini +++ /dev/null @@ -1,72 +0,0 @@ -[at-property-viewport-units.html] - [10vw is 40px] - expected: FAIL - - [10vh is 20px] - expected: FAIL - - [10vi is 40px] - expected: FAIL - - [10vb is 20px] - expected: FAIL - - [10vmin is 20px] - expected: FAIL - - [10vmax is 40px] - expected: FAIL - - [10svw is 40px] - expected: FAIL - - [10svh is 20px] - expected: FAIL - - [10svi is 40px] - expected: FAIL - - [10svb is 20px] - expected: FAIL - - [10svmin is 20px] - expected: FAIL - - [10svmax is 40px] - expected: FAIL - - [10lvw is 40px] - expected: FAIL - - [10lvh is 20px] - expected: FAIL - - [10lvi is 40px] - expected: FAIL - - [10lvb is 20px] - expected: FAIL - - [10lvmin is 20px] - expected: FAIL - - [10lvmax is 40px] - expected: FAIL - - [10dvw is 40px] - expected: FAIL - - [10dvh is 20px] - expected: FAIL - - [10dvi is 40px] - expected: FAIL - - [10dvb is 20px] - expected: FAIL - - [10dvmin is 20px] - expected: FAIL - - [10dvmax is 40px] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini b/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini deleted file mode 100644 index b421abedfc6a..000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[determine-registration.html] - [Computed value becomes token sequence when @property is removed] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini index 05a70f2f639c..bf86b875adff 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini @@ -1,9 +1,3 @@ [registered-properties-inheritance.html] - [Registered properties are correctly inherited (or not) depending on the inherits flag.] - expected: FAIL - [Font-relative units are absolutized before before inheritance] expected: FAIL - - [Calc expressions are resolved before inheritance] - expected: FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-computation.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-computation.html.ini index 0203e8c0594a..b002f23bcaa1 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-computation.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-computation.html.ini @@ -11,30 +11,15 @@ [ values are computed correctly [14em\]] expected: FAIL - [# values are computed correctly [3% , 10vmax , 22px\]] - expected: FAIL - - [ values computed are correctly via var()-reference when font-size is inherited] - expected: FAIL - [# values are computed correctly [8em\]] expected: FAIL - [+ values are computed correctly [3% 10vmax 22px\]] - expected: FAIL - [+ values are computed correctly [4em 9px\]] expected: FAIL - [ values are computed correctly [13vw\]] - expected: FAIL - [# values are computed correctly [calc(50% + 1em), 4px\]] expected: FAIL - [ values are computed correctly [15vmin\]] - expected: FAIL - [ values are computed correctly [calc(19em - 2%)\]] expected: FAIL @@ -44,9 +29,6 @@ [ values computed are correctly via var()-reference] expected: FAIL - [ values are computed correctly when font-size is inherited [14em\]] - expected: FAIL - [ values are computed correctly [calc(16px - 7em + 10vh)\]] expected: FAIL @@ -59,23 +41,5 @@ [ values are computed correctly [translateX(10em)\]] expected: FAIL - [ values are computed correctly when font-size is inherited [calc(14em + 10px)\]] - expected: FAIL - - [ values are computed correctly [25.4mm\]] - expected: FAIL - - [ values are computed correctly [6pc\]] - expected: FAIL - - [ values are computed correctly [1in\]] - expected: FAIL - - [ values are computed correctly [72pt\]] - expected: FAIL - - [ values are computed correctly [2.54cm\]] - expected: FAIL - [ values are computed correctly [10lh\]] expected: FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini index 2f018717022d..ebfe04ea094d 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini @@ -1,25 +1,4 @@ [registered-property-initial.html] - [Initial value for correctly computed [calc(10px + 15px)\]] - expected: FAIL - - [Initial non-inherited value can be substituted [calc(10px + 15px), --x\]] - expected: FAIL - - [Initial value for correctly computed [2.54cm\]] - expected: FAIL - - [Initial value for correctly computed [72pt\]] - expected: FAIL - - [Initial value for correctly computed [25.4mm\]] - expected: FAIL - - [Initial value for correctly computed [6pc\]] - expected: FAIL - - [Initial value for correctly computed [1in\]] - expected: FAIL - [Initial value for correctly computed [url(a)\]] expected: FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini index d07e1fc8061f..79f8345ffaa1 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini @@ -1,7 +1,4 @@ [var-reference-registered-properties.html] - [var() references work with registered properties] - expected: FAIL - [Calc expressions are resolved when substituting] expected: FAIL