Bug 1520229 - [css-logical] Implement the inset shorthand. r=mats
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 20 Jan 2019 16:48:19 +0100
changeset 514618 824c36902a3750a88425288e7be78cccbaaaf2db
parent 514610 666abafd77b1e8a5e8cb83824480ed99635f9684
child 514619 a5b887c68abdec7fa7ba0d43565dfdb6527d3f48
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1520229
milestone66.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 1520229 - [css-logical] Implement the inset shorthand. r=mats Reviewers: mats Reviewed By: mats Bug #: 1520229 Differential Revision: https://phabricator.services.mozilla.com/D16704
devtools/shared/css/generated/properties-db.js
layout/style/test/property_database.js
servo/components/style/properties/shorthands/position.mako.rs
testing/web-platform/meta/css/css-logical/logical-box-inset.html.ini
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -6692,16 +6692,32 @@ exports.CSS_PROPERTIES = {
       "auto",
       "inherit",
       "initial",
       "max-content",
       "min-content",
       "unset"
     ]
   },
+  "inset": {
+    "isInherited": false,
+    "subproperties": [
+      "top",
+      "right",
+      "bottom",
+      "left"
+    ],
+    "supports": [],
+    "values": [
+      "auto",
+      "inherit",
+      "initial",
+      "unset"
+    ]
+  },
   "inset-block": {
     "isInherited": false,
     "subproperties": [
       "inset-block-start",
       "inset-block-end"
     ],
     "supports": [],
     "values": [
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6559,16 +6559,28 @@ var gCSSProperties = {
       "calc(2px)",
       "calc(50%)",
       "calc(3*25px)",
       "calc(25px*3)",
       "calc(3*25px + 50%)",
     ],
     invalid_values: [ "none", "5" ]
   },
+  "inset": {
+    domProp: "inset",
+    inherited: false,
+    type: CSS_TYPE_TRUE_SHORTHAND,
+    subproperties: [ "top", "right", "bottom", "left" ],
+    /* FIXME: run tests with multiple prerequisites */
+    prerequisites: { "position": "relative" },
+    initial_values: [ "auto" ],
+    other_values: [ "3px 0", "2em 4px 2pt", "1em 2em 3px 4px", "1em calc(2em + 3px) 4ex 5cm" ],
+    invalid_values: [ "1px calc(nonsense)", "1px red", "3" ],
+    unbalanced_values: [ "1px calc(" ],
+  },
   "inset-block": {
     domProp: "insetBlock",
     inherited: false,
     type: CSS_TYPE_TRUE_SHORTHAND,
     subproperties: [ "inset-block-start", "inset-block-end" ],
     /* FIXME: run tests with multiple prerequisites */
     prerequisites: { "position": "relative" },
     initial_values: [ "auto", "auto auto" ],
--- a/servo/components/style/properties/shorthands/position.mako.rs
+++ b/servo/components/style/properties/shorthands/position.mako.rs
@@ -758,16 +758,25 @@
                 self.justify_items.to_css(dest)?;
             }
 
             Ok(())
         }
     }
 </%helpers:shorthand>
 
+// See https://github.com/w3c/csswg-drafts/issues/3525 for the quirks stuff.
+${helpers.four_sides_shorthand(
+    "inset",
+    "%s",
+    "specified::LengthPercentageOrAuto::parse",
+    spec="https://drafts.csswg.org/css-logical/#propdef-inset",
+    allow_quirks=False,
+)}
+
 % for axis in ["block", "inline"]:
     <%
         spec = "https://drafts.csswg.org/css-logical/#propdef-inset-%s" % axis
     %>
     <%helpers:shorthand
         name="inset-${axis}"
         sub_properties="${' '.join(
             'inset-%s-%s' % (axis, side)
--- a/testing/web-platform/meta/css/css-logical/logical-box-inset.html.ini
+++ b/testing/web-platform/meta/css/css-logical/logical-box-inset.html.ini
@@ -1,40 +1,12 @@
 [logical-box-inset.html]
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: ltr; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: horizontal-tb; direction: rtl; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: rtl; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: rtl; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-rl; direction: ltr; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-rl; direction: ltr; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: rtl; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: ltr; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: vertical-lr; direction: ltr; '.]
-    expected: FAIL
-
-  [Test that inset-* shorthands set the computed value of both logical and physical longhands, with 'writing-mode: sideways-lr; direction: rtl; '.]
-    expected: FAIL
-
   [Test that inset shorthand sets longhands and serializes correctly.]
     expected: FAIL
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=137688
 
   [Test that inset-inline shorthand sets longhands and serializes correctly.]
     expected: FAIL
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=137688
 
   [Test that inset-block shorthand sets longhands and serializes correctly.]
     expected: FAIL
-
+    bug: https://bugzilla.mozilla.org/show_bug.cgi?id=137688