Skip to content
Permalink
Browse files
[css-ui] Restrict default-button CSS appearance value to useSystemApp…
…earance

https://bugs.webkit.org/show_bug.cgi?id=240391

Reviewed by Aditya Keerthi.

This appearance value renders a button in its highlighted state to designate a button that is activated by default on macOS.

The most important reason to keep it around is for internal macOS apps, so we restrict it to webviews with useSystemAppearance.

* LayoutTests/editing/deleting/insert-in-orphaned-selection-crash.html:
* LayoutTests/editing/deleting/insert-in-orphaned-selection-crash-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* Source/WebInspectorUI/UserInterface/External/CSSDocumentation/CSSDocumentation-overrides.json:
* Source/WebInspectorUI/UserInterface/External/CSSDocumentation/CSSDocumentation.js:

Canonical link: https://commits.webkit.org/250871@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
nt1m committed May 23, 2022
1 parent 7c0bab5 commit 40d2b149a33f4e682802744a06fd17b7f674f0eb
Showing 8 changed files with 10 additions and 9 deletions.
@@ -1,3 +1,2 @@
CONSOLE MESSAGE: The test PASS if it does not CRASH.
CONSOLE MESSAGE: NotFoundError: The object can not be found here.

@@ -1,5 +1,5 @@
<style>
* { -webkit-appearance:default-button; }
* { -webkit-appearance: button; }
tr { height: 10px; }
td { width: 100px; height: 100px; }
</style>
@@ -32,7 +32,7 @@ PASS -webkit-appearance: checkbox-label (invalid)
PASS -webkit-appearance: checkmenuitem (invalid)
PASS -webkit-appearance: color-well (invalid)
FAIL -webkit-appearance: continuous-capacity-level-indicator (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "continuous-capacity-level-indicator"
FAIL -webkit-appearance: default-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "default-button"
PASS -webkit-appearance: default-button (invalid)
FAIL -webkit-appearance: discrete-capacity-level-indicator (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "discrete-capacity-level-indicator"
PASS -webkit-appearance: dualbutton (invalid)
PASS -webkit-appearance: groupbox (invalid)
@@ -195,7 +195,7 @@ PASS appearance: checkbox-label (invalid)
PASS appearance: checkmenuitem (invalid)
PASS appearance: color-well (invalid)
FAIL appearance: continuous-capacity-level-indicator (invalid) assert_equals: style.appearance expected "" but got "continuous-capacity-level-indicator"
FAIL appearance: default-button (invalid) assert_equals: style.appearance expected "" but got "default-button"
PASS appearance: default-button (invalid)
FAIL appearance: discrete-capacity-level-indicator (invalid) assert_equals: style.appearance expected "" but got "discrete-capacity-level-indicator"
PASS appearance: dualbutton (invalid)
PASS appearance: groupbox (invalid)
@@ -32,7 +32,7 @@ PASS -webkit-appearance: checkbox-label (invalid)
PASS -webkit-appearance: checkmenuitem (invalid)
PASS -webkit-appearance: color-well (invalid)
FAIL -webkit-appearance: continuous-capacity-level-indicator (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "continuous-capacity-level-indicator"
FAIL -webkit-appearance: default-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "default-button"
PASS -webkit-appearance: default-button (invalid)
FAIL -webkit-appearance: discrete-capacity-level-indicator (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected "" but got "discrete-capacity-level-indicator"
PASS -webkit-appearance: dualbutton (invalid)
PASS -webkit-appearance: groupbox (invalid)
@@ -195,7 +195,7 @@ PASS appearance: checkbox-label (invalid)
PASS appearance: checkmenuitem (invalid)
PASS appearance: color-well (invalid)
FAIL appearance: continuous-capacity-level-indicator (invalid) assert_equals: style.appearance expected "" but got "continuous-capacity-level-indicator"
FAIL appearance: default-button (invalid) assert_equals: style.appearance expected "" but got "default-button"
PASS appearance: default-button (invalid)
FAIL appearance: discrete-capacity-level-indicator (invalid) assert_equals: style.appearance expected "" but got "discrete-capacity-level-indicator"
PASS appearance: dualbutton (invalid)
PASS appearance: groupbox (invalid)
@@ -5164,7 +5164,6 @@
"push-button",
"square-button",
"button",
"default-button",
"listbox",
"media-fullscreen-volume-slider",
"media-fullscreen-volume-slider-thumb",
@@ -751,6 +751,9 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
case CSSPropertyVisibility: // visible | hidden | collapse
return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueCollapse;
case CSSPropertyAppearance: {
if (valueID == CSSValueDefaultButton)
return context.useSystemAppearance;

#if ENABLE(ATTACHMENT_ELEMENT)
if (valueID == CSSValueAttachment || valueID == CSSValueBorderlessAttachment)
return context.attachmentEnabled;
@@ -4,6 +4,6 @@
},
"-webkit-appearance": {
"description": "Changes the appearance of buttons and other controls to resemble native controls.",
"syntax": "none | button | checkbox | default-button | listbox | media-slider | media-sliderthumb | media-volume-slider | media-volume-sliderthumb | menulist | menulist-button | meter | progress-bar | push-button | radio | searchfield | slider-horizontal | slider-vertical | square-button | textarea | textfield | -apple-pay-button"
"syntax": "none | button | checkbox | listbox | media-slider | media-sliderthumb | media-volume-slider | media-volume-sliderthumb | menulist | menulist-button | meter | progress-bar | push-button | radio | searchfield | slider-horizontal | slider-vertical | square-button | textarea | textfield | -apple-pay-button"
}
}
@@ -29,7 +29,7 @@ CSSDocumentation = {
},
"-webkit-appearance": {
"description": "Changes the appearance of buttons and other controls to resemble native controls.",
"syntax": "none | button | checkbox | default-button | listbox | media-slider | media-sliderthumb | media-volume-slider | media-volume-sliderthumb | menulist | menulist-button | meter | progress-bar | push-button | radio | searchfield | slider-horizontal | slider-vertical | square-button | textarea | textfield | -apple-pay-button"
"syntax": "none | button | checkbox | listbox | media-slider | media-sliderthumb | media-volume-slider | media-volume-sliderthumb | menulist | menulist-button | meter | progress-bar | push-button | radio | searchfield | slider-horizontal | slider-vertical | square-button | textarea | textfield | -apple-pay-button"
},
"-webkit-backdrop-filter": {
"description": "Applies a filter effect where the first filter in the list takes the element's background image as the input image."

0 comments on commit 40d2b14

Please sign in to comment.