Bug 1466008: followup: set the rule type in the custom properties code, since we use it. r=me on a CLOSED TREE
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 01 Jun 2018 16:13:15 +0200
changeset 1528978 24447bd95fbd88c310b93e096f476873364a7ab1
parent 1528971 c16c9198979ace0ac9b7f90031c96e85c0f1020b
child 1528979 38ec627c4758007cbadf94a16ee188f5505bb9af
push id276055
push usersurkov.alexander@gmail.com
push dateFri, 01 Jun 2018 15:22:50 +0000
treeherdertry@b0e8b387f142 [default view] [failures only]
reviewersme
bugs1466008
milestone62.0a1
Bug 1466008: followup: set the rule type in the custom properties code, since we use it. r=me on a CLOSED TREE Though I think it may be slightly fishy if used in, e.g., a @keyframes block. For our purposes right now it doesn't make a difference, I think. MozReview-Commit-ID: A7VCTOqaIuB
servo/components/style/properties/properties.mako.rs
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -1417,20 +1417,22 @@ impl UnparsedValue {
         custom_properties: Option<<&Arc<::custom_properties::CustomPropertiesMap>>,
         quirks_mode: QuirksMode,
     ) -> PropertyDeclaration {
         ::custom_properties::substitute(&self.css, self.first_token_type, custom_properties)
         .ok()
         .and_then(|css| {
             // As of this writing, only the base URL is used for property
             // values.
+            //
+            // FIXME(emilio): These bits are slightly fishy.
             let context = ParserContext::new(
                 Origin::Author,
                 &self.url_data,
-                None,
+                Some(CssRuleType::Style),
                 ParsingMode::DEFAULT,
                 quirks_mode,
             );
 
             let mut input = ParserInput::new(&css);
             Parser::new(&mut input).parse_entirely(|input| {
                 match self.from_shorthand {
                     None => longhand_id.parse_value(&context, input),