Skip to content
Permalink
Browse files

style: Accept percentage for shape-image-threshold.

  • Loading branch information...
BorisChiou authored and emilio committed Jul 24, 2019
1 parent 8e7daa7 commit 4813390e60c4bee605e518f60969e049d66409d8
Showing with 3 additions and 13 deletions.
  1. +3 −2 components/style/properties/longhands/box.mako.rs
  2. +0 −11 components/style/values/specified/mod.rs
@@ -649,9 +649,10 @@ ${helpers.predefined_type(

// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
${helpers.predefined_type(
"shape-image-threshold", "Opacity", "0.0",
"shape-image-threshold",
"Opacity",
"0.0",
engines="gecko",
parse_method="parse_number",
animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
)}
@@ -410,17 +410,6 @@ impl Parse for NonNegativeNumberOrPercentage {
)]
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 {
/// Opacity accepts <number> | <percentage>, so we parse it as NumberOrPercentage,
/// and then convert into an Number if it's a Percentage.

0 comments on commit 4813390

Please sign in to comment.
You can’t perform that action at this time.