Skip to content

Commit

Permalink
Remove non standard -webkit-appearance keywords part 2
Browse files Browse the repository at this point in the history
More appearance keywords have become non-standard and should be
removed from the supported list [1]. First CL can be found at [2].

[1] w3c/csswg-drafts#8506 (comment)
[2] https://chromium-review.googlesource.com/c/chromium/src/+/4437611

Change-Id: Iad058cf01df2d8af25afc11b5d3fb014590d030d
Bug: 1434765
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4638559
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Di Zhang <dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1162493}
  • Loading branch information
dizhang168 authored and Chromium LUCI CQ committed Jun 26, 2023
1 parent 4492fcc commit 03d8708
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 40 deletions.
6 changes: 3 additions & 3 deletions third_party/blink/renderer/core/css/css_value_keywords.json5
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,13 @@
// CSSParserFastPaths::IsValidKeywordPropertyAndValue.
"checkbox",
"radio",
"push-button",
"square-button",
"button",
"listbox",
"-internal-media-control",
"menulist",
"menulist-button",
"meter",
"progress-bar",
"slider-horizontal",
"slider-vertical",
"searchfield",
"textfield",
Expand All @@ -850,6 +847,9 @@
"media-sliderthumb",
"media-volume-slider",
"media-volume-sliderthumb",
"push-button",
"square-button",
"slider-horizontal",
"sliderthumb-horizontal",
"sliderthumb-vertical",
"searchfield-cancel-button",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3739,14 +3739,16 @@ void CountKeywordOnlyPropertyUsage(CSSPropertyID property,
case CSSPropertyID::kAppearance:
// TODO(crbug.com/924486): Remove CSS value slider-horizontal,
// slider-vertical and the associated warnings.
if ((value_id == CSSValueID::kSliderHorizontal ||
value_id == CSSValueID::kSliderVertical) ||
if (value_id == CSSValueID::kSliderVertical ||
(!RuntimeEnabledFeatures::RemoveNonStandardAppearanceValueEnabled() &&
(value_id == CSSValueID::kInnerSpinButton ||
value_id == CSSValueID::kMediaSlider ||
value_id == CSSValueID::kMediaSliderthumb ||
value_id == CSSValueID::kMediaVolumeSlider ||
value_id == CSSValueID::kMediaVolumeSliderthumb ||
value_id == CSSValueID::kPushButton ||
value_id == CSSValueID::kSquareButton ||
value_id == CSSValueID::kSliderHorizontal ||
value_id == CSSValueID::kSliderthumbHorizontal ||
value_id == CSSValueID::kSliderthumbVertical ||
value_id == CSSValueID::kSearchfieldCancelButton))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2919,8 +2919,9 @@
{
// Non-standard appearance values should be removed. This feature removes
// inner-spin-button, media-slider, media-sliderthumb, media-volume-slider
// media-volume-sliderthumb, searchfield-cancel-button,
// sliderthumb-horizontal, sliderthumb-vertical.
// media-volume-sliderthumb, push-button, searchfield-cancel-button,
// slider-horizontal, sliderthumb-horizontal, sliderthumb-vertical,
// square-button.
// https://drafts.csswg.org/css-ui-4/#appearance-switching
name: "RemoveNonStandardAppearanceValue",
status: "experimental",
Expand Down
6 changes: 3 additions & 3 deletions third_party/blink/renderer/platform/theme_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ enum ControlPart {
kAutoPart,
kCheckboxPart,
kRadioPart,
kPushButtonPart,
kSquareButtonPart,
kButtonPart,
kListboxPart,
kMediaControlPart,
kMenulistPart,
kMenulistButtonPart,
kMeterPart,
kProgressBarPart,
kSliderHorizontalPart,
kSliderVerticalPart,
kSearchFieldPart,
kTextFieldPart,
Expand All @@ -56,6 +53,9 @@ enum ControlPart {
kMediaSliderThumbPart,
kMediaVolumeSliderPart,
kMediaVolumeSliderThumbPart,
kPushButtonPart,
kSquareButtonPart,
kSliderHorizontalPart,
kSliderThumbHorizontalPart,
kSliderThumbVerticalPart,
kSearchFieldCancelButtonPart,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CONSOLE WARNING: The keyword 'slider-horizontal' specified to an 'appearance' property is not standardized. It will be removed in the future.
CONSOLE WARNING: The keyword 'slider-vertical' specified to an 'appearance' property is not standardized. It will be removed in the future.
This is a testharness.js-based test.
FAIL There should be console warnings about non-standard appearance keywords assert_true: This should FAIL so we generate a -expected.txt expected true got false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<style>
/* See https://drafts.csswg.org/css-ui-4/#appearance-switching */
/* TODO(dizhangg): this entire test should be deleted once slider-vertical
(crbug.com/924486) and slider-horizontal (crbug.com/crbug.com/924486) are
removed. */
(crbug.com/924486) are removed. */
.t {
appearance: auto;
appearance: checkbox;
Expand All @@ -23,7 +22,7 @@
appearance: menulist-button;
appearance: meter;
appearance: progress-bar;
appearance: slider-horizontal; /* should be warned */
appearance: slider-horizontal;
appearance: slider-vertical; /* should be warned */
appearance: sliderthumb-horizontal;
appearance: sliderthumb-vertical;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
[appearance-cssom-001.html?include=Invalid]
[-webkit-appearance: push-button (invalid)]
expected: FAIL

[-webkit-appearance: slider-horizontal (invalid)]
expected: FAIL

[-webkit-appearance: slider-vertical (invalid)]
expected: FAIL

[-webkit-appearance: square-button (invalid)]
expected: FAIL

[appearance: push-button (invalid)]
expected: FAIL

[appearance: slider-horizontal (invalid)]
expected: FAIL

[appearance: slider-vertical (invalid)]
expected: FAIL

[appearance: square-button (invalid)]
expected: FAIL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is a testharness.js-based test.
Found 300 tests; 292 PASS, 8 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 300 tests; 298 PASS, 2 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS -webkit-appearance: bogus-button (invalid)
PASS -webkit-appearance: attachment (invalid)
PASS -webkit-appearance: button-bevel (invalid)
Expand Down Expand Up @@ -67,7 +67,7 @@ PASS -webkit-appearance: progressbar (invalid)
PASS -webkit-appearance: progressbar-vertical (invalid)
PASS -webkit-appearance: progresschunk (invalid)
PASS -webkit-appearance: progresschunk-vertical (invalid)
FAIL -webkit-appearance: push-button (invalid) assert_in_array: style.WebkitAppearance (uppercase W) value "push-button" not in array [""]
PASS -webkit-appearance: push-button (invalid)
PASS -webkit-appearance: radio-container (invalid)
PASS -webkit-appearance: radio-label (invalid)
PASS -webkit-appearance: radiomenuitem (invalid)
Expand Down Expand Up @@ -98,7 +98,7 @@ PASS -webkit-appearance: searchfield-results-button (invalid)
PASS -webkit-appearance: searchfield-results-decoration (invalid)
PASS -webkit-appearance: separator (invalid)
PASS -webkit-appearance: sheet (invalid)
FAIL -webkit-appearance: slider-horizontal (invalid) assert_in_array: style.WebkitAppearance (uppercase W) value "slider-horizontal" not in array [""]
PASS -webkit-appearance: slider-horizontal (invalid)
FAIL -webkit-appearance: slider-vertical (invalid) assert_in_array: style.WebkitAppearance (uppercase W) value "slider-vertical" not in array [""]
PASS -webkit-appearance: sliderthumb-horizontal (invalid)
PASS -webkit-appearance: sliderthumb-vertical (invalid)
Expand All @@ -108,7 +108,7 @@ PASS -webkit-appearance: spinner-downbutton (invalid)
PASS -webkit-appearance: spinner-textfield (invalid)
PASS -webkit-appearance: spinner-upbutton (invalid)
PASS -webkit-appearance: splitter (invalid)
FAIL -webkit-appearance: square-button (invalid) assert_in_array: style.WebkitAppearance (uppercase W) value "square-button" not in array [""]
PASS -webkit-appearance: square-button (invalid)
PASS -webkit-appearance: statusbar (invalid)
PASS -webkit-appearance: statusbarpanel (invalid)
PASS -webkit-appearance: tab (invalid)
Expand Down Expand Up @@ -217,7 +217,7 @@ PASS appearance: progressbar (invalid)
PASS appearance: progressbar-vertical (invalid)
PASS appearance: progresschunk (invalid)
PASS appearance: progresschunk-vertical (invalid)
FAIL appearance: push-button (invalid) assert_in_array: style.appearance value "push-button" not in array [""]
PASS appearance: push-button (invalid)
PASS appearance: radio-container (invalid)
PASS appearance: radio-label (invalid)
PASS appearance: radiomenuitem (invalid)
Expand Down Expand Up @@ -248,7 +248,7 @@ PASS appearance: searchfield-results-button (invalid)
PASS appearance: searchfield-results-decoration (invalid)
PASS appearance: separator (invalid)
PASS appearance: sheet (invalid)
FAIL appearance: slider-horizontal (invalid) assert_in_array: style.appearance value "slider-horizontal" not in array [""]
PASS appearance: slider-horizontal (invalid)
FAIL appearance: slider-vertical (invalid) assert_in_array: style.appearance value "slider-vertical" not in array [""]
PASS appearance: sliderthumb-horizontal (invalid)
PASS appearance: sliderthumb-vertical (invalid)
Expand All @@ -258,7 +258,7 @@ PASS appearance: spinner-downbutton (invalid)
PASS appearance: spinner-textfield (invalid)
PASS appearance: spinner-upbutton (invalid)
PASS appearance: splitter (invalid)
FAIL appearance: square-button (invalid) assert_in_array: style.appearance value "square-button" not in array [""]
PASS appearance: square-button (invalid)
PASS appearance: statusbar (invalid)
PASS appearance: statusbarpanel (invalid)
PASS appearance: tab (invalid)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
CONSOLE WARNING: The keyword 'slider-horizontal' specified to an 'appearance' property is not standardized. It will be removed in the future.
Checks that slider appearance on regular node doesn't crash.

0 comments on commit 03d8708

Please sign in to comment.