From f7aac8d22502a176fba0280999c02fe89e223643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Mon, 3 Jul 2017 11:45:04 -0700 Subject: [PATCH] Fix parsing logic of grid-template property Fist line names are parsed on the top of the function already and it shouldn't be parsed again. --- components/style/properties/shorthand/position.mako.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/style/properties/shorthand/position.mako.rs b/components/style/properties/shorthand/position.mako.rs index 8b9b816bc68..3077e4e1d38 100644 --- a/components/style/properties/shorthand/position.mako.rs +++ b/components/style/properties/shorthand/position.mako.rs @@ -313,7 +313,13 @@ } else { let mut template_rows = GridTemplateComponent::parse(context, input)?; if let GenericGridTemplateComponent::TrackList(ref mut list) = template_rows { - list.line_names[0] = first_line_names; // won't panic + // Fist line names are parsed already and it shouldn't be parsed again. + // If line names are not empty, that means given property value is not acceptable + if list.line_names[0].is_empty() { + list.line_names[0] = first_line_names; // won't panic + } else { + return Err(StyleParseError::UnspecifiedError.into()); + } } input.expect_delim('/')?;