diff --git a/components/script/dom/csskeyframesrule.rs b/components/script/dom/csskeyframesrule.rs index 977c953265c..db0240bf9a2 100644 --- a/components/script/dom/csskeyframesrule.rs +++ b/components/script/dom/csskeyframesrule.rs @@ -115,7 +115,7 @@ impl CSSKeyframesRuleMethods for CSSKeyframesRule { // https://github.com/w3c/csswg-drafts/issues/801 // Setting this property to a CSS-wide keyword or `none` will // throw a Syntax Error. - match_ignore_ascii_case! { value, + match_ignore_ascii_case! { &value, "initial" => return Err(Error::Syntax), "inherit" => return Err(Error::Syntax), "unset" => return Err(Error::Syntax), diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index dd9f5a19643..172171c4e87 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -165,7 +165,7 @@ impl Resolution { _ => return Err(()), }; - Ok(match_ignore_ascii_case! { unit, + Ok(match_ignore_ascii_case! { &unit, "dpi" => Resolution::Dpi(value), "dppx" => Resolution::Dppx(value), "dpcm" => Resolution::Dpcm(value), diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index e145420befd..9b0d2cc6bb3 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -69,7 +69,7 @@ impl TransitionProperty { /// Parse a transition-property value. pub fn parse(input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "all" => Ok(TransitionProperty::All), % for prop in data.longhands: % if prop.animatable: diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index ab4f9ac72a2..25b2bf5616a 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -68,7 +68,7 @@ /// Parse a display value. pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), % for value in values: "${value}" => { Ok(computed_value::T::${to_rust_ident(value)}) @@ -299,7 +299,7 @@ ${helpers.single_keyword("-moz-top-layer", "none top", input.try(|i| specified::LengthOrPercentage::parse(context, i)) .map(SpecifiedValue::LengthOrPercentage) .or_else(|_| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), % for keyword in vertical_align_keywords: "${keyword}" => Ok(SpecifiedValue::${to_rust_ident(keyword)}), % endfor @@ -588,7 +588,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", impl Parse for SpecifiedValue { fn parse(_context: &ParserContext, input: &mut ::cssparser::Parser) -> Result { if let Ok(function_name) = input.try(|input| input.expect_function()) { - return match_ignore_ascii_case! { function_name, + return match_ignore_ascii_case! { &function_name, "cubic-bezier" => { let (mut p1x, mut p1y, mut p2x, mut p2y) = (0.0, 0.0, 0.0, 0.0); try!(input.parse_nested_block(|input| { @@ -618,7 +618,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", if input.try(|input| input.expect_comma()).is_ok() { start_end = try!(match_ignore_ascii_case! { - try!(input.expect_ident()), + &try!(input.expect_ident()), "start" => Ok(StartEnd::Start), "end" => Ok(StartEnd::End), _ => Err(()) @@ -1319,7 +1319,7 @@ ${helpers.predefined_type("scroll-snap-coordinate", Err(_) => break, }; match_ignore_ascii_case! { - name, + &name, "matrix" => { try!(input.parse_nested_block(|input| { let values = try!(input.parse_comma_separated(|input| { diff --git a/components/style/properties/longhand/counters.mako.rs b/components/style/properties/longhand/counters.mako.rs index e44a49233ed..bab3f22e4f8 100644 --- a/components/style/properties/longhand/counters.mako.rs +++ b/components/style/properties/longhand/counters.mako.rs @@ -140,7 +140,7 @@ content.push(ContentItem::String(value.into_owned())) } Ok(Token::Function(name)) => { - content.push(try!(match_ignore_ascii_case! { name, + content.push(try!(match_ignore_ascii_case! { &name, "counter" => input.parse_nested_block(|input| { let name = try!(input.expect_ident()).into_owned(); let style = input.try(|input| { @@ -163,7 +163,7 @@ })); } Ok(Token::Ident(ident)) => { - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "open-quote" => content.push(ContentItem::OpenQuote), "close-quote" => content.push(ContentItem::CloseQuote), "no-open-quote" => content.push(ContentItem::NoOpenQuote), diff --git a/components/style/properties/longhand/effects.mako.rs b/components/style/properties/longhand/effects.mako.rs index a83c80d74f5..e651cc57a2e 100644 --- a/components/style/properties/longhand/effects.mako.rs +++ b/components/style/properties/longhand/effects.mako.rs @@ -339,7 +339,7 @@ ${helpers.predefined_type("clip", % endif if let Ok(function_name) = input.try(|input| input.expect_function()) { filters.push(try!(input.parse_nested_block(|input| { - match_ignore_ascii_case! { function_name, + match_ignore_ascii_case! { &function_name, "blur" => specified::Length::parse_non_negative(input).map(SpecifiedFilter::Blur), "brightness" => parse_factor(input).map(SpecifiedFilter::Brightness), "contrast" => parse_factor(input).map(SpecifiedFilter::Contrast), @@ -445,7 +445,7 @@ pub fn parse_origin(context: &ParserContext, input: &mut Parser) -> Result { if horizontal.is_none() { horizontal = Some(LengthOrPercentage::Percentage(Percentage(0.0))) diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index a860e61ef8f..1add7ea5680 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -63,7 +63,7 @@ } _ => {} } - match_ignore_ascii_case! { input, + match_ignore_ascii_case! { &input, "serif" => return FontFamily::Generic(atom!("serif")), "sans-serif" => return FontFamily::Generic(atom!("sans-serif")), "cursive" => return FontFamily::Generic(atom!("cursive")), @@ -85,7 +85,7 @@ // string (as lowercase) in the static atoms table. We don't have an // API to do that yet though, so we do the simple thing for now. let mut css_wide_keyword = false; - match_ignore_ascii_case! { first_ident, + match_ignore_ascii_case! { &first_ident, "serif" => return Ok(FontFamily::Generic(atom!("serif"))), "sans-serif" => return Ok(FontFamily::Generic(atom!("sans-serif"))), "cursive" => return Ok(FontFamily::Generic(atom!("cursive"))), @@ -254,7 +254,7 @@ ${helpers.single_keyword("font-variant-caps", /// normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { input.try(|input| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "normal" => Ok(SpecifiedValue::Normal), "bold" => Ok(SpecifiedValue::Bold), "bolder" => Ok(SpecifiedValue::Bolder), @@ -557,7 +557,7 @@ ${helpers.single_keyword("font-variant-caps", pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { let mut result = SpecifiedValue { weight: false, style: false }; - match_ignore_ascii_case! {try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "none" => Ok(result), "weight" => { result.weight = true; diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index d1794a11e53..756cc49684b 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -196,7 +196,7 @@ ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", loop { let result = input.try(|i| { - match_ignore_ascii_case! { i.expect_ident()?, + match_ignore_ascii_case! { &i.expect_ident()?, "fill" => Ok(FILL), "stroke" => Ok(STROKE), "markers" => Ok(MARKERS), diff --git a/components/style/properties/longhand/text.mako.rs b/components/style/properties/longhand/text.mako.rs index cfd4b26fa3c..30342595b4b 100644 --- a/components/style/properties/longhand/text.mako.rs +++ b/components/style/properties/longhand/text.mako.rs @@ -60,7 +60,7 @@ impl Parse for Side { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { if let Ok(ident) = input.try(|input| input.expect_ident()) { - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "clip" => Ok(Side::Clip), "ellipsis" => Ok(Side::Ellipsis), _ => Err(()) @@ -179,7 +179,7 @@ ${helpers.single_keyword("unicode-bidi", while input.try(|input| { if let Ok(ident) = input.expect_ident() { - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "underline" => if result.contains(UNDERLINE) { return Err(()) } else { empty = false; result.insert(UNDERLINE) }, "overline" => if result.contains(OVERLINE) { return Err(()) } diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index c3b60b7df0e..2b22cc6ba55 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -455,7 +455,7 @@ impl Parse for CSSWideKeyword { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { let ident = input.expect_ident()?; input.expect_exhausted()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "initial" => Ok(CSSWideKeyword::InitialKeyword), "inherit" => Ok(CSSWideKeyword::InheritKeyword), "unset" => Ok(CSSWideKeyword::UnsetKeyword), diff --git a/components/style/servo/media_queries.rs b/components/style/servo/media_queries.rs index d6c5f281946..453e4edea17 100644 --- a/components/style/servo/media_queries.rs +++ b/components/style/servo/media_queries.rs @@ -106,7 +106,7 @@ impl Expression { let name = try!(input.expect_ident()); try!(input.expect_colon()); // TODO: Handle other media features - Ok(Expression(match_ignore_ascii_case! { name, + Ok(Expression(match_ignore_ascii_case! { &name, "min-width" => { ExpressionKind::Width(Range::Min(try!(specified::Length::parse_non_negative(input)))) }, diff --git a/components/style/supports.rs b/components/style/supports.rs index 455772a9eed..0451204eb1e 100644 --- a/components/style/supports.rs +++ b/components/style/supports.rs @@ -47,7 +47,7 @@ impl SupportsCondition { return Ok(in_parens) } Ok(Token::Ident(ident)) => { - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "and" => ("and", SupportsCondition::And as fn(_) -> _), "or" => ("or", SupportsCondition::Or as fn(_) -> _), _ => return Err(()) diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs index f30c3e2f44b..ee9dc0d288e 100644 --- a/components/style/values/mod.rs +++ b/components/style/values/mod.rs @@ -28,7 +28,7 @@ macro_rules! define_numbered_css_keyword_enum { impl Parse for $name { #[allow(missing_docs)] fn parse(_context: &ParserContext, input: &mut ::cssparser::Parser) -> Result<$name, ()> { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), $( $css => Ok($name::$variant), )+ _ => Err(()) } diff --git a/components/style/values/specified/align.rs b/components/style/values/specified/align.rs index 2c9d961f0f5..faa415da2b5 100644 --- a/components/style/values/specified/align.rs +++ b/components/style/values/specified/align.rs @@ -323,7 +323,7 @@ impl Parse for JustifyItems { // auto | normal | stretch | fn parse_auto_normal_stretch_baseline(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "auto" => Ok(ALIGN_AUTO), "normal" => Ok(ALIGN_NORMAL), "stretch" => Ok(ALIGN_STRETCH), @@ -335,7 +335,7 @@ fn parse_auto_normal_stretch_baseline(input: &mut Parser) -> Result fn parse_normal_stretch_baseline(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "normal" => Ok(ALIGN_NORMAL), "stretch" => Ok(ALIGN_STRETCH), "baseline" => Ok(ALIGN_BASELINE), @@ -346,7 +346,7 @@ fn parse_normal_stretch_baseline(input: &mut Parser) -> Result { // normal | fn parse_normal_or_baseline(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "normal" => Ok(ALIGN_NORMAL), "baseline" => Ok(ALIGN_BASELINE), _ => Err(()) @@ -356,7 +356,7 @@ fn parse_normal_or_baseline(input: &mut Parser) -> Result { // fn parse_content_distribution(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "stretch" => Ok(ALIGN_STRETCH), "space_between" => Ok(ALIGN_SPACE_BETWEEN), "space_around" => Ok(ALIGN_SPACE_AROUND), @@ -386,7 +386,7 @@ fn parse_overflow_content_position(input: &mut Parser) -> Result // fn parse_content_position(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "start" => Ok(ALIGN_START), "end" => Ok(ALIGN_END), "flex-start" => Ok(ALIGN_FLEX_START), @@ -401,7 +401,7 @@ fn parse_content_position(input: &mut Parser) -> Result { // fn parse_overflow_position(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "safe" => Ok(ALIGN_SAFE), "unsafe" => Ok(ALIGN_UNSAFE), _ => Err(()) @@ -429,7 +429,7 @@ fn parse_overflow_self_position(input: &mut Parser) -> Result { // fn parse_self_position(input: &mut Parser) -> Result { let ident = input.expect_ident()?; - match_ignore_ascii_case! { ident, + match_ignore_ascii_case! { &ident, "start" => Ok(ALIGN_START), "end" => Ok(ALIGN_END), "flex-start" => Ok(ALIGN_FLEX_START), @@ -448,14 +448,14 @@ fn parse_legacy(input: &mut Parser) -> Result { let a = input.expect_ident()?; let b = input.expect_ident()?; if a.eq_ignore_ascii_case("legacy") { - match_ignore_ascii_case! { b, + match_ignore_ascii_case! { &b, "left" => Ok(ALIGN_LEGACY | ALIGN_LEFT), "right" => Ok(ALIGN_LEGACY | ALIGN_RIGHT), "center" => Ok(ALIGN_LEGACY | ALIGN_CENTER), _ => Err(()) } } else if b.eq_ignore_ascii_case("legacy") { - match_ignore_ascii_case! { a, + match_ignore_ascii_case! { &a, "left" => Ok(ALIGN_LEGACY | ALIGN_LEFT), "right" => Ok(ALIGN_LEGACY | ALIGN_RIGHT), "center" => Ok(ALIGN_LEGACY | ALIGN_CENTER), diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs index 3d6399cefc5..8c1adef9ee1 100644 --- a/components/style/values/specified/basic_shape.rs +++ b/components/style/values/specified/basic_shape.rs @@ -141,7 +141,7 @@ pub enum BasicShape { impl Parse for BasicShape { fn parse(context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_function()), + match_ignore_ascii_case! { &try!(input.expect_function()), "inset" => { Ok(BasicShape::Inset( try!(input.parse_nested_block(|i| InsetRect::parse_function_arguments(context, i))))) @@ -237,7 +237,7 @@ impl InsetRect { impl Parse for InsetRect { fn parse(context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_function()), + match_ignore_ascii_case! { &try!(input.expect_function()), "inset" => { input.parse_nested_block(|i| InsetRect::parse_function_arguments(context, i)) }, @@ -413,7 +413,7 @@ impl Circle { impl Parse for Circle { fn parse(context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_function()), + match_ignore_ascii_case! { &try!(input.expect_function()), "circle" => { input.parse_nested_block(|i| Circle::parse_function_arguments(context, i)) }, @@ -497,7 +497,7 @@ impl Ellipse { impl Parse for Ellipse { fn parse(context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_function()), + match_ignore_ascii_case! { &try!(input.expect_function()), "ellipse" => { input.parse_nested_block(|i| Ellipse::parse_function_arguments(context, i)) }, @@ -575,7 +575,7 @@ impl Polygon { impl Parse for Polygon { fn parse(context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_function()), + match_ignore_ascii_case! { &try!(input.expect_function()), "polygon" => { input.parse_nested_block(|i| Polygon::parse_function_arguments(context, i)) }, @@ -664,7 +664,7 @@ impl Default for ShapeRadius { impl Parse for ShapeRadius { fn parse(_: &ParserContext, input: &mut Parser) -> Result { input.try(|i| LengthOrPercentage::parse_non_negative(i)).map(ShapeRadius::Length).or_else(|_| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "closest-side" => Ok(ShapeRadius::ClosestSide), "farthest-side" => Ok(ShapeRadius::FarthestSide), _ => Err(()) @@ -832,7 +832,7 @@ impl ComputedValueAsSpecified for FillRule {} impl Parse for FillRule { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "nonzero" => Ok(FillRule::NonZero), "evenodd" => Ok(FillRule::EvenOdd), _ => Err(()) @@ -871,7 +871,7 @@ impl Parse for GeometryBox { if let Ok(shape_box) = input.try(|i| ShapeBox::parse(context, i)) { Ok(GeometryBox::ShapeBox(shape_box)) } else { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "fill-box" => Ok(GeometryBox::Fill), "stroke-box" => Ok(GeometryBox::Stroke), "view-box" => Ok(GeometryBox::View), @@ -908,7 +908,7 @@ pub enum ShapeBox { impl Parse for ShapeBox { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "margin-box" => Ok(ShapeBox::Margin), "border-box" => Ok(ShapeBox::Border), "padding-box" => Ok(ShapeBox::Padding), diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index f63c1ae0ec3..7cd0fc1f51d 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -103,7 +103,7 @@ impl Gradient { /// Parses a gradient from the given arguments. pub fn parse_function(context: &ParserContext, input: &mut Parser) -> Result { let mut repeating = false; - let (gradient_kind, stops) = match_ignore_ascii_case! { try!(input.expect_function()), + let (gradient_kind, stops) = match_ignore_ascii_case! { &try!(input.expect_function()), "linear-gradient" => { try!(input.parse_nested_block(|input| { let kind = try!(GradientKind::parse_linear(context, input)); diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index c2e7cc0dc2f..8293622cbe5 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -1385,7 +1385,7 @@ impl Parse for MaxLength { input.try(ExtremumLength::parse).map(MaxLength::ExtremumLength) .or_else(|()| input.try(LengthOrPercentage::parse_non_negative).map(MaxLength::LengthOrPercentage)) .or_else(|()| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "none" => Ok(MaxLength::None), _ => Err(()) diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 81c3f5e7a79..4dc93972554 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -297,7 +297,7 @@ impl Angle { #[allow(missing_docs)] pub fn parse_border_radius(context: &ParserContext, input: &mut Parser) -> Result { input.try(|i| BorderRadiusSize::parse(context, i)).or_else(|_| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "thin" => Ok(BorderRadiusSize::circle( LengthOrPercentage::Length(NoCalcLength::from_px(1.)))), "medium" => Ok(BorderRadiusSize::circle( @@ -312,7 +312,7 @@ pub fn parse_border_radius(context: &ParserContext, input: &mut Parser) -> Resul #[allow(missing_docs)] pub fn parse_border_width(input: &mut Parser) -> Result { input.try(Length::parse_non_negative).or_else(|()| { - match_ignore_ascii_case! { try!(input.expect_ident()), + match_ignore_ascii_case! { &try!(input.expect_ident()), "thin" => Ok(Length::from_px(1.)), "medium" => Ok(Length::from_px(3.)), "thick" => Ok(Length::from_px(5.)), @@ -335,7 +335,7 @@ impl Parse for BorderWidth { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { match input.try(Length::parse_non_negative) { Ok(length) => Ok(BorderWidth::Width(length)), - Err(_) => match_ignore_ascii_case! { try!(input.expect_ident()), + Err(_) => match_ignore_ascii_case! { &try!(input.expect_ident()), "thin" => Ok(BorderWidth::Thin), "medium" => Ok(BorderWidth::Medium), "thick" => Ok(BorderWidth::Thick), @@ -714,7 +714,7 @@ pub enum SVGPaintKind { impl SVGPaintKind { fn parse_ident(input: &mut Parser) -> Result { - Ok(match_ignore_ascii_case! { input.expect_ident()?, + Ok(match_ignore_ascii_case! { &input.expect_ident()?, "none" => SVGPaintKind::None, "context-fill" => SVGPaintKind::ContextFill, "context-stroke" => SVGPaintKind::ContextStroke, diff --git a/components/style/values/specified/position.rs b/components/style/values/specified/position.rs index e102842cadc..172d7cbf8bb 100644 --- a/components/style/values/specified/position.rs +++ b/components/style/values/specified/position.rs @@ -595,17 +595,17 @@ impl Parse for PositionComponent { .or_else(|()| { match try!(input.next()) { Token::Ident(value) => { - match_ignore_ascii_case! { value, - "center" => Ok(PositionComponent::Keyword(Keyword::Center)), - "left" => Ok(PositionComponent::Keyword(Keyword::Left)), - "right" => Ok(PositionComponent::Keyword(Keyword::Right)), - "top" => Ok(PositionComponent::Keyword(Keyword::Top)), - "bottom" => Ok(PositionComponent::Keyword(Keyword::Bottom)), - "x-start" => Ok(PositionComponent::Keyword(Keyword::XStart)), - "x-end" => Ok(PositionComponent::Keyword(Keyword::XEnd)), - "y-start" => Ok(PositionComponent::Keyword(Keyword::YStart)), - "y-end" => Ok(PositionComponent::Keyword(Keyword::YEnd)), - _ => Err(()) + match_ignore_ascii_case! { &value, + "center" => Ok(PositionComponent::Keyword(Keyword::Center)), + "left" => Ok(PositionComponent::Keyword(Keyword::Left)), + "right" => Ok(PositionComponent::Keyword(Keyword::Right)), + "top" => Ok(PositionComponent::Keyword(Keyword::Top)), + "bottom" => Ok(PositionComponent::Keyword(Keyword::Bottom)), + "x-start" => Ok(PositionComponent::Keyword(Keyword::XStart)), + "x-end" => Ok(PositionComponent::Keyword(Keyword::XEnd)), + "y-start" => Ok(PositionComponent::Keyword(Keyword::YStart)), + "y-end" => Ok(PositionComponent::Keyword(Keyword::YEnd)), + _ => Err(()) } }, _ => Err(()) diff --git a/components/style_traits/cursor.rs b/components/style_traits/cursor.rs index aefd562cc32..447dfe0966e 100644 --- a/components/style_traits/cursor.rs +++ b/components/style_traits/cursor.rs @@ -20,8 +20,8 @@ macro_rules! define_cursor { impl Cursor { /// Given a CSS keyword, get the corresponding cursor enum. pub fn from_css_keyword(keyword: &str) -> Result { - match_ignore_ascii_case! { keyword, - $( concat!($css) => Ok(Cursor::$variant), )+ + match_ignore_ascii_case! { &keyword, + $( $css => Ok(Cursor::$variant), )+ _ => Err(()) } } diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 3bf2505d96f..c06652d06db 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -116,7 +116,8 @@ macro_rules! __define_css_keyword_enum__actual { impl $name { /// Parse this property from a CSS input stream. pub fn parse(input: &mut ::cssparser::Parser) -> Result<$name, ()> { - match_ignore_ascii_case! { try!(input.expect_ident()), + let ident = input.expect_ident()?; + match_ignore_ascii_case! { &ident, $( $css => Ok($name::$variant), )+ _ => Err(()) }