Skip to content
Permalink
Browse files
[css-ui] Parsing support for accent-color
https://bugs.webkit.org/show_bug.cgi?id=231334
rdar://83955508

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* web-platform-tests/css/css-ui/accent-color-computed-expected.txt:
* web-platform-tests/css/css-ui/accent-color-parsing-expected.txt:
* web-platform-tests/css/css-ui/animation/accent-color-interpolation-expected.txt:
* web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

Source/WebCore:

Add parsing support for accent-color as specified in
https://www.w3.org/TR/css-ui-4/#widget-accent. The grammar is
"accent-color: auto | <color>".

Implemented behind a disabled-by-default experimental setting.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSProperties.json:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
(WebCore::CSSParserContext::isPropertyRuntimeDisabled const):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseColorWithAuto):
(WebCore::CSSParserFastPaths::maybeParseValue):
(WebCore::parseCaretColor): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeColorWithAuto):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeCaretColor): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::rareInheritedDataChangeRequiresRepaint):
(WebCore::RenderStyle::unresolvedColorForProperty const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setAccentColor):
(WebCore::RenderStyle::setHasAutoAccentColor):
(WebCore::RenderStyle::accentColor const):
(WebCore::RenderStyle::hasAutoAccentColor const):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialAccentColor):
(WebCore::Style::BuilderCustom::applyInheritAccentColor):
(WebCore::Style::BuilderCustom::applyValueAccentColor):

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:

LayoutTests:

Platform-specific rebaselines.

* platform/gtk/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:


Canonical link: https://commits.webkit.org/242664@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pxlcoder committed Oct 7, 2021
1 parent 2f61067 commit 4d122c7574228992423fbc258a298d0757730e0b
Showing 29 changed files with 398 additions and 225 deletions.
@@ -1,3 +1,21 @@
2021-10-07 Aditya Keerthi <akeerthi@apple.com>

[css-ui] Parsing support for accent-color
https://bugs.webkit.org/show_bug.cgi?id=231334
rdar://83955508

Reviewed by Antti Koivisto.

Platform-specific rebaselines.

* platform/gtk/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* platform/ios/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

2021-10-07 Ayumi Kojima <ayumi_kojima@apple.com>

Cleaning up expectations for iOS 15.
@@ -1,3 +1,18 @@
2021-10-07 Aditya Keerthi <akeerthi@apple.com>

[css-ui] Parsing support for accent-color
https://bugs.webkit.org/show_bug.cgi?id=231334
rdar://83955508

Reviewed by Antti Koivisto.

* web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* web-platform-tests/css/css-ui/accent-color-computed-expected.txt:
* web-platform-tests/css/css-ui/accent-color-parsing-expected.txt:
* web-platform-tests/css/css-ui/animation/accent-color-interpolation-expected.txt:
* web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

2021-10-07 Antti Koivisto <antti@apple.com>

Cascade layer styles should be lower priority than unlayered styles
@@ -2,6 +2,7 @@

PASS setup
PASS stylesheet takes effect
PASS accent-color
PASS align-content
PASS align-items
PASS align-self
@@ -1,12 +1,9 @@
CONSOLE MESSAGE: Error: assert_equals: expected (string) "auto" but got (undefined) undefined

Harness Error (FAIL), message = Error: assert_equals: expected (string) "auto" but got (undefined) undefined

FAIL Property accent-color value 'initial' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value 'inherit' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value 'red' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value 'blue' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value 'auto' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value 'currentcolor' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
FAIL Property accent-color value '#fff' assert_true: accent-color doesn't seem to be supported in the computed style expected true got false
PASS Property accent-color value 'initial'
PASS Property accent-color value 'inherit'
PASS Property accent-color value 'red'
PASS Property accent-color value 'blue'
PASS Property accent-color value 'auto'
PASS Property accent-color value 'currentcolor'
PASS Property accent-color value '#fff'

@@ -1,12 +1,12 @@

FAIL e.style['accent-color'] = "initial" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "inherit" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "unset" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "revert" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "red" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "blue" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "currentcolor" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['accent-color'] = "#fff" should set the property value assert_not_equals: property should be set got disallowed value ""
PASS e.style['accent-color'] = "initial" should set the property value
PASS e.style['accent-color'] = "inherit" should set the property value
PASS e.style['accent-color'] = "unset" should set the property value
PASS e.style['accent-color'] = "revert" should set the property value
PASS e.style['accent-color'] = "auto" should set the property value
PASS e.style['accent-color'] = "red" should set the property value
PASS e.style['accent-color'] = "blue" should set the property value
PASS e.style['accent-color'] = "currentcolor" should set the property value
PASS e.style['accent-color'] = "#fff" should set the property value
PASS e.style['accent-color'] = "auto auto" should not set the property value

0 comments on commit 4d122c7

Please sign in to comment.