style: Accept percentage for shape-image-threshold.

Differential Revision: https://phabricator.services.mozilla.com/D39241
This commit is contained in:
Boris Chiou 2019-07-24 21:37:22 +00:00 committed by Emilio Cobos Álvarez
parent 8e7daa77b6
commit 4813390e60
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
2 changed files with 3 additions and 13 deletions

View file

@ -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",
)} )}

View file

@ -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.