Update CSS Properties and Values API to use new cycle fallback behaviour
authorjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 03:21:15 +0000 (03:21 +0000)
committerjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 03:21:15 +0000 (03:21 +0000)
commit35f5621bdfc362459f97515fa0a7fff7437b8a23
treef9354012456ca7ed8dc28a99a64a3ee5c7d0402c
parent6ebc76ea5c03092e5249c8877aeaf521013058d6
Update CSS Properties and Values API to use new cycle fallback behaviour
https://bugs.webkit.org/show_bug.cgi?id=192800

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Re-import tests and adjust expected results. Some of the tests go from pass to fail because
this patch adds some extra dependency checking to property registrations to fix a crash, but
now unsupported syntaxes like <length-percentage> do not register properly.

* web-platform-tests/css/css-properties-values-api/register-property-expected.txt:
* web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt:
* web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html:
* web-platform-tests/css/css-properties-values-api/register-property.html:
* web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html:
* web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-computation.html:
* web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-cssom.html:
* web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-initial.html:
* web-platform-tests/css/css-properties-values-api/resources/utils.js: Added.
(generate_name):
(any_initial_value):
(generate_property):
(all_syntaxes):
* web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added.
* web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added.
* web-platform-tests/css/css-properties-values-api/self-utils.html: Added.
* web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt:
* web-platform-tests/css/css-properties-values-api/typedom.tentative.html:
* web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:
* web-platform-tests/css/css-properties-values-api/unit-cycles.html:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt:
* web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html:
* web-platform-tests/css/css-properties-values-api/w3c-import.log:

Source/WebCore:

Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing.

* css/CSSCustomPropertyValue.h:
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableReference):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyCascadedCustomProperty):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):

LayoutTests:

* css-custom-properties-api/crash.html:
* css-custom-properties-api/inherits-expected.txt:
* css-custom-properties-api/inherits.html:
* css-custom-properties-api/registerProperty-expected.txt:
* css-custom-properties-api/registerProperty.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
LayoutTests/ChangeLog
LayoutTests/css-custom-properties-api/crash.html
LayoutTests/css-custom-properties-api/inherits-expected.txt
LayoutTests/css-custom-properties-api/inherits.html
LayoutTests/css-custom-properties-api/registerProperty-expected.txt
LayoutTests/css-custom-properties-api/registerProperty.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/register-property.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-computation.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-cssom.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-initial.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/resources/utils.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/self-utils-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/self-utils.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom.tentative.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html
LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCustomPropertyValue.h
Source/WebCore/css/CSSVariableReferenceValue.cpp
Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp