mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Accept percentage for shape-image-threshold.
Differential Revision: https://phabricator.services.mozilla.com/D39241
This commit is contained in:
parent
8e7daa77b6
commit
4813390e60
2 changed files with 3 additions and 13 deletions
|
@ -649,9 +649,10 @@ ${helpers.predefined_type(
|
||||||
|
|
||||||
// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
|
// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
"shape-image-threshold", "Opacity", "0.0",
|
"shape-image-threshold",
|
||||||
|
"Opacity",
|
||||||
|
"0.0",
|
||||||
engines="gecko",
|
engines="gecko",
|
||||||
parse_method="parse_number",
|
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
|
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -410,17 +410,6 @@ impl Parse for NonNegativeNumberOrPercentage {
|
||||||
)]
|
)]
|
||||||
pub struct Opacity(Number);
|
pub struct Opacity(Number);
|
||||||
|
|
||||||
impl Opacity {
|
|
||||||
/// Parse number value only.
|
|
||||||
#[inline]
|
|
||||||
pub fn parse_number<'i, 't>(
|
|
||||||
context: &ParserContext,
|
|
||||||
input: &mut Parser<'i, 't>,
|
|
||||||
) -> Result<Self, ParseError<'i>> {
|
|
||||||
Number::parse(context, input).map(Opacity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Parse for Opacity {
|
impl Parse for Opacity {
|
||||||
/// Opacity accepts <number> | <percentage>, so we parse it as NumberOrPercentage,
|
/// Opacity accepts <number> | <percentage>, so we parse it as NumberOrPercentage,
|
||||||
/// and then convert into an Number if it's a Percentage.
|
/// and then convert into an Number if it's a Percentage.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue