Skip to content

Commit

Permalink
Bug 1492739 - Unprefix user-select. r=mats
Browse files Browse the repository at this point in the history
The CSSWG decided that our behavior regarding inheritance is what we want,
see [1].

[1]: w3c/csswg-drafts#3344

Differential Revision: https://phabricator.services.mozilla.com/D11585

--HG--
extra : moz-landing-system : lando
  • Loading branch information
emilio committed May 17, 2019
1 parent 36731b4 commit c1954c0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 28 deletions.
6 changes: 0 additions & 6 deletions browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ 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,
Expand Down
2 changes: 1 addition & 1 deletion devtools/server/actors/animation-type-longhand.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
"-moz-user-focus",
"-moz-user-input",
"-moz-user-modify",
"-moz-user-select",
"user-select",
"vector-effect",
"visibility",
"white-space",
Expand Down
24 changes: 21 additions & 3 deletions devtools/shared/css/generated/properties-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ exports.CSS_PROPERTIES = {
"-moz-user-select": {
"isInherited": false,
"subproperties": [
"-moz-user-select"
"user-select"
],
"supports": [],
"values": [
Expand Down Expand Up @@ -2886,7 +2886,7 @@ exports.CSS_PROPERTIES = {
"-webkit-user-select": {
"isInherited": false,
"subproperties": [
"-moz-user-select"
"user-select"
],
"supports": [],
"values": [
Expand Down Expand Up @@ -3294,7 +3294,7 @@ exports.CSS_PROPERTIES = {
"initial-letter",
"ime-mode",
"scrollbar-width",
"-moz-user-select",
"user-select",
"-moz-window-dragging",
"-moz-force-broken-image-icon",
"dominant-baseline",
Expand Down Expand Up @@ -10267,6 +10267,24 @@ exports.CSS_PROPERTIES = {
"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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
property: "-moz-user-modify"
},
{
property: "-moz-user-select"
property: "user-select"
},
{
property: "-moz-window-dragging"
Expand Down
11 changes: 9 additions & 2 deletions layout/style/test/property_database.js
Original file line number Diff line number Diff line change
Expand Up @@ -2805,6 +2805,13 @@ var gCSSProperties = {
"-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" ],
Expand Down Expand Up @@ -8383,8 +8390,8 @@ if (IsCSSPropertyPrefEnabled("layout.css.prefixes.webkit")) {
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",
Expand Down
5 changes: 2 additions & 3 deletions servo/components/style/properties/longhands/ui.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ ${helpers.single_keyword(
)}

${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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[user-select-computed.html]
[Property user-select value 'contain' computes to 'contain']
expected: FAIL

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,3 @@
[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

0 comments on commit c1954c0

Please sign in to comment.