Bug 1549223 - [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands. r=emilio
authorMats Palmgren <mats@mozilla.com>
Mon, 06 May 2019 02:43:50 +0200
changeset 531545 5772a92c49cf6cc746fe0d22a797fe3f08a20f39
parent 531475 c6d806b496845985516cc04342c04988aa1817dd
child 531546 403ea69a03b06c297aad8938b40feffee4f5a5bc
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1549223
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549223 - [css-grid-2] Remove single keyword 'subgrid' as a valid value for the 'grid' and 'grid-template' shorthands. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D29974
devtools/client/inspector/markup/test/browser_markup_display_node_01.js
devtools/client/inspector/markup/test/doc_markup_subgrid.html
layout/style/test/property_database.js
layout/style/test/test_grid_container_shorthands.html
servo/components/style/properties/shorthands/position.mako.rs
--- a/devtools/client/inspector/markup/test/browser_markup_display_node_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_display_node_01.js
@@ -8,17 +8,17 @@
 
 const TEST_URI = `
   <style type="text/css">
     #grid {
       display: grid;
     }
     #subgrid {
       display: grid;
-      grid: subgrid;
+      grid: subgrid / subgrid;
     }
     #flex {
       display: flex;
     }
     #block {
       display: block;
     }
   </style>
--- a/devtools/client/inspector/markup/test/doc_markup_subgrid.html
+++ b/devtools/client/inspector/markup/test/doc_markup_subgrid.html
@@ -18,17 +18,17 @@
 
     header, footer {
       grid-column: span 3;
     }
 
     main {
       grid-column: span 3;
       display: grid;
-      grid: subgrid;
+      grid: subgrid / subgrid;
     }
 
     .aside1 {
       grid-column: 1;
     }
 
     .aside2 {
       grid-column: 3;
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -7227,25 +7227,26 @@ gCSSProperties["grid-template"] = {
     "[foo] [bar] 40px / 100px",
     "[fizz] [buzz] 100px / 40px",
     "[fizz] [buzz] 'foo' / 40px",
     "'foo' / none"
   ]
 };
 if (isGridTemplateSubgridValueEnabled) {
   gCSSProperties["grid-template"].other_values.push(
-    "subgrid",
+    "subgrid / subgrid",
     "subgrid/40px 20px",
     "subgrid [foo] [] [bar baz] / 40px 20px",
     "40px 20px/subgrid",
     "40px 20px/subgrid  [foo] [] repeat(3, [a] [b]) [bar baz]",
     "subgrid/subgrid",
     "subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]"
   );
   gCSSProperties["grid-template"].invalid_values.push(
+    "subgrid",
     "subgrid []",
     "subgrid [] / 'fizz'",
     "subgrid / 'fizz'"
   );
 }
 
 gCSSProperties["grid"] = {
   domProp: "grid",
--- a/layout/style/test/test_grid_container_shorthands.html
+++ b/layout/style/test/test_grid_container_shorthands.html
@@ -141,21 +141,16 @@ var grid_template_test_cases = [
     },
     {
         specified: "[bar] 'fizz' 100px [buzz] \n [a] '.' 200px [b] / [foo] 40px",
         gridTemplateAreas: "\"fizz\" \".\"",
         gridTemplateRows: "[bar] 100px [buzz a] 200px [b]",
         gridTemplateColumns: "[foo] 40px",
     },
     {
-        specified: "subgrid",
-        gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
-        gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
-    },
-    {
         specified: "subgrid / subgrid",
         gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
         gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
     },
     {
         specified: "subgrid [foo] / subgrid",
         gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
         gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid [foo]" : "none",
--- a/servo/components/style/properties/shorthands/position.mako.rs
+++ b/servo/components/style/properties/shorthands/position.mako.rs
@@ -249,33 +249,32 @@
 
 <%helpers:shorthand name="grid-template"
                     sub_properties="grid-template-rows grid-template-columns grid-template-areas"
                     spec="https://drafts.csswg.org/css-grid/#propdef-grid-template"
                     products="gecko">
     use crate::parser::Parse;
     use servo_arc::Arc;
     use crate::values::{Either, None_};
-    use crate::values::generics::grid::{LineNameList, TrackSize, TrackList, TrackListType};
+    use crate::values::generics::grid::{TrackSize, TrackList, TrackListType};
     use crate::values::generics::grid::{TrackListValue, concat_serialize_idents};
     use crate::values::specified::{GridTemplateComponent, GenericGridTemplateComponent};
     use crate::values::specified::grid::parse_line_names;
     use crate::values::specified::position::{TemplateAreas, TemplateAreasArc};
 
     /// Parsing for `<grid-template>` shorthand (also used by `grid` shorthand).
     pub fn parse_grid_template<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<(GridTemplateComponent, GridTemplateComponent, Either<TemplateAreasArc, None_>), ParseError<'i>> {
-        // Other shorthand sub properties also parse `none` and `subgrid` keywords and this
-        // shorthand should know after these keywords there is nothing to parse. Otherwise it
-        // gets confused and rejects the sub properties that contains `none` or `subgrid`.
+        // Other shorthand sub properties also parse the `none` keyword and this shorthand
+        // should know after this keyword there is nothing to parse. Otherwise it gets
+        // confused and rejects the sub properties that contains `none`.
         <% keywords = {
             "none": "GenericGridTemplateComponent::None",
-            "subgrid": "GenericGridTemplateComponent::Subgrid(LineNameList::default())"
         }
         %>
         % for keyword, rust_type in keywords.items():
             if let Ok(x) = input.try(|i| {
                 if i.try(|i| i.expect_ident_matching("${keyword}")).is_ok() {
                     if i.is_exhausted() {
                         return Ok((${rust_type},
                                    ${rust_type},