From 50a299f82c66aa0267d80d59f25807b42d448cdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 4 Mar 2018 01:03:32 +0100 Subject: [PATCH] style: Don't guard the context opacity keywords with the svg in opentype pref. This is effectively the stylo version of the second patch for bug 1365926, and should fix bug 1442867. --- components/style/values/specified/svg.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/style/values/specified/svg.rs b/components/style/values/specified/svg.rs index f5f89cfc4d7..bca46ef2a88 100644 --- a/components/style/values/specified/svg.rs +++ b/components/style/values/specified/svg.rs @@ -113,17 +113,17 @@ impl Parse for SVGStrokeDashArray { pub type SVGOpacity = generic::SVGOpacity; impl Parse for SVGOpacity { - fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) - -> Result> { + fn parse<'i, 't>( + context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result> { if let Ok(opacity) = input.try(|i| Opacity::parse(context, i)) { - Ok(generic::SVGOpacity::Opacity(opacity)) - } else if is_context_value_enabled() { - try_match_ident_ignore_ascii_case! { input, - "context-fill-opacity" => Ok(generic::SVGOpacity::ContextFillOpacity), - "context-stroke-opacity" => Ok(generic::SVGOpacity::ContextStrokeOpacity), - } - } else { - Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)) + return Ok(generic::SVGOpacity::Opacity(opacity)); + } + + try_match_ident_ignore_ascii_case! { input, + "context-fill-opacity" => Ok(generic::SVGOpacity::ContextFillOpacity), + "context-stroke-opacity" => Ok(generic::SVGOpacity::ContextStrokeOpacity), } } }