Bug 1492739 - Unprefix user-select. r=mats
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 17 May 2019 02:43:59 +0000
changeset 474500 807e0fabd519163758bcf5cfa63f7e7d2f1d9611
parent 474498 7b90628fa1e7f153e574c07626b6af5378593a45
child 474501 d806a12ca46833286baf4c2f320db7d667a28883
push id36041
push userccoroiu@mozilla.com
push dateMon, 20 May 2019 21:55:28 +0000
treeherdermozilla-central@29bdbbe89264 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1492739
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 1492739 - Unprefix user-select. r=mats The CSSWG decided that our behavior regarding inheritance is what we want, see [1]. [1]: https://github.com/w3c/csswg-drafts/issues/3344 Differential Revision: https://phabricator.services.mozilla.com/D11585
browser/base/content/test/static/browser_parsable_css.js
devtools/server/actors/animation-type-longhand.js
devtools/shared/css/generated/properties-db.js
dom/animation/test/mozilla/test_moz_prefixed_properties.html
layout/style/test/property_database.js
servo/components/style/properties/longhands/ui.mako.rs
testing/web-platform/meta/css/css-ui/parsing/user-select-computed.html.ini
testing/web-platform/meta/css/css-ui/parsing/user-select-valid.html.ini
--- a/browser/base/content/test/static/browser_parsable_css.js
+++ b/browser/base/content/test/static/browser_parsable_css.js
@@ -8,24 +8,18 @@
  * Every property of the objects in it needs to consist of a regular expression
  * matching the offending error. If an object has multiple regex criteria, they
  * ALL need to match an error in order for that error not to cause a test
  * failure. */
 let whitelist = [
   // CodeMirror is imported as-is, see bug 1004423.
   {sourceName: /codemirror\.css$/i,
    isFromDevTools: true},
-  // The debugger uses cross-browser CSS.
-  {sourceName: /devtools\/client\/debugger\/dist\/vendors.css/i,
-   isFromDevTools: true},
   {sourceName: /devtools\/client\/debugger\/src\/components\/([A-z\/]+).css/i,
   isFromDevTools: true},
-   // Reps uses cross-browser CSS.
-   {sourceName: /devtools-client-shared\/components\/reps\/reps.css/i,
-   isFromDevTools: true},
   // PDFjs rules needed for compat with other UAs.
   {sourceName: /web\/viewer\.css$/i,
    errorMessage: /Unknown property.*(appearance|user-select)/i,
    isFromDevTools: false},
   // Highlighter CSS uses a UA-only pseudo-class, see bug 985597.
   {sourceName: /highlighters\.css$/i,
    errorMessage: /Unknown pseudo-class.*moz-native-anonymous/i,
    isFromDevTools: true},
--- a/devtools/server/actors/animation-type-longhand.js
+++ b/devtools/server/actors/animation-type-longhand.js
@@ -157,17 +157,17 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
     "text-transform",
     "touch-action",
     "transform-box",
     "transform-style",
     "unicode-bidi",
     "-moz-user-focus",
     "-moz-user-input",
     "-moz-user-modify",
-    "-moz-user-select",
+    "user-select",
     "vector-effect",
     "visibility",
     "white-space",
     "will-change",
     "-moz-window-dragging",
     "word-break",
     "writing-mode",
   ])],
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -1404,17 +1404,17 @@ exports.CSS_PROPERTIES = {
       "revert",
       "unset",
       "write-only"
     ]
   },
   "-moz-user-select": {
     "isInherited": false,
     "subproperties": [
-      "-moz-user-select"
+      "user-select"
     ],
     "supports": [],
     "values": [
       "-moz-none",
       "all",
       "auto",
       "inherit",
       "initial",
@@ -2881,17 +2881,17 @@ exports.CSS_PROPERTIES = {
       "step-start",
       "steps",
       "unset"
     ]
   },
   "-webkit-user-select": {
     "isInherited": false,
     "subproperties": [
-      "-moz-user-select"
+      "user-select"
     ],
     "supports": [],
     "values": [
       "-moz-none",
       "all",
       "auto",
       "inherit",
       "initial",
@@ -3289,17 +3289,17 @@ exports.CSS_PROPERTIES = {
       "table-layout",
       "text-overflow",
       "text-decoration-line",
       "text-decoration-style",
       "text-decoration-color",
       "initial-letter",
       "ime-mode",
       "scrollbar-width",
-      "-moz-user-select",
+      "user-select",
       "-moz-window-dragging",
       "-moz-force-broken-image-icon",
       "dominant-baseline",
       "vector-effect",
       "stop-color",
       "stop-opacity",
       "flood-color",
       "flood-opacity",
@@ -10262,16 +10262,34 @@ exports.CSS_PROPERTIES = {
       "isolate",
       "isolate-override",
       "normal",
       "plaintext",
       "revert",
       "unset"
     ]
   },
+  "user-select": {
+    "isInherited": false,
+    "subproperties": [
+      "user-select"
+    ],
+    "supports": [],
+    "values": [
+      "-moz-none",
+      "all",
+      "auto",
+      "inherit",
+      "initial",
+      "none",
+      "revert",
+      "text",
+      "unset"
+    ]
+  },
   "vector-effect": {
     "isInherited": false,
     "subproperties": [
       "vector-effect"
     ],
     "supports": [],
     "values": [
       "inherit",
--- a/dom/animation/test/mozilla/test_moz_prefixed_properties.html
+++ b/dom/animation/test/mozilla/test_moz_prefixed_properties.html
@@ -55,17 +55,17 @@ const testcases = [
   },
   {
     property: "-moz-user-input"
   },
   {
     property: "-moz-user-modify"
   },
   {
-    property: "-moz-user-select"
+    property: "user-select"
   },
   {
     property: "-moz-window-dragging"
   },
 ];
 
 testcases.forEach(testcase => {
   if (testcase.pref && !IsCSSPropertyPrefEnabled(testcase.pref)) {
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2800,16 +2800,23 @@ var gCSSProperties = {
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "read-only" ],
     other_values: [ "read-write", "write-only" ],
     invalid_values: []
   },
   "-moz-user-select": {
     domProp: "MozUserSelect",
     inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    alias_for: "user-select",
+    subproperties: [ "user-select" ],
+  },
+  "user-select": {
+    domProp: "userSelect",
+    inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "auto" ],
     other_values: [ "none", "text", "all", "-moz-none" ],
     invalid_values: []
   },
   "background": {
     domProp: "background",
     inherited: false,
@@ -8378,18 +8385,18 @@ if (IsCSSPropertyPrefEnabled("layout.css
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "align-content",
     subproperties: [ "align-content" ],
   };
   gCSSProperties["-webkit-user-select"] = {
     domProp: "webkitUserSelect",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
-    alias_for: "-moz-user-select",
-    subproperties: [ "-moz-user-select" ],
+    alias_for: "user-select",
+    subproperties: [ "user-select" ],
   };
   gCSSProperties["-webkit-mask"] = {
     domProp: "webkitMask",
     inherited: false,
     type: CSS_TYPE_TRUE_SHORTHAND,
     alias_for: "mask",
     subproperties: [ "mask-clip", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size" , "mask-composite" ],
   };
--- a/servo/components/style/properties/longhands/ui.mako.rs
+++ b/servo/components/style/properties/longhands/ui.mako.rs
@@ -27,22 +27,21 @@
     gecko_enum_prefix="StyleScrollbarWidth",
     animation_value_type="discrete",
     gecko_pref="layout.css.scrollbar-width.enabled",
     enabled_in="chrome",
     spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width"
 )}
 
 ${helpers.predefined_type(
-    "-moz-user-select",
+    "user-select",
     "UserSelect",
     "computed::UserSelect::Auto",
     products="gecko",
-    gecko_ffi_name="mUserSelect",
-    alias="-webkit-user-select",
+    extra_prefixes="moz webkit",
     animation_value_type="discrete",
     needs_context=False,
     spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select",
 )}
 
 // TODO(emilio): This probably should be hidden from content.
 ${helpers.single_keyword(
     "-moz-window-dragging",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-ui/parsing/user-select-computed.html.ini
@@ -0,0 +1,4 @@
+[user-select-computed.html]
+  [Property user-select value 'contain' computes to 'contain']
+    expected: FAIL
+
--- a/testing/web-platform/meta/css/css-ui/parsing/user-select-valid.html.ini
+++ b/testing/web-platform/meta/css/css-ui/parsing/user-select-valid.html.ini
@@ -1,16 +1,4 @@
 [user-select-valid.html]
   [e.style['user-select'\] = "contain" should set the property value]
     expected: FAIL
 
-  [e.style['user-select'\] = "all" should set the property value]
-    expected: FAIL
-
-  [e.style['user-select'\] = "none" should set the property value]
-    expected: FAIL
-
-  [e.style['user-select'\] = "text" should set the property value]
-    expected: FAIL
-
-  [e.style['user-select'\] = "auto" should set the property value]
-    expected: FAIL
-