Properly determine if css custom property values are computationally independent
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Oct 2018 13:57:16 +0000 (13:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Oct 2018 13:57:16 +0000 (13:57 +0000)
commit0c3d6f49ec20c14b1ea5d386958a658d0f2ef0c9
tree87486fa922c7111b89cbebbaaa1cc1a0b95ec4a4
parent5d23d542cf746a52cf1b5e077a2bc32e7463a858
Properly determine if css custom property values are computationally independent
https://bugs.webkit.org/show_bug.cgi?id=190303

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-06
Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt:
* web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt:

Source/WebCore:

Add getDirectComputationalDependencies method to determine if a value is computationally
dependent. Use this method in CSS.registerProperty to replace existing substring checks.
No new tests are needed because the existing tests cover this behaviour.

* css/CSSCalculationValue.cpp:
(WebCore::determineCategory):
* css/CSSCalculationValue.h:
(WebCore::CSSCalcValue::getDirectComputationalDependencies const):
(WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
* css/CSSCustomPropertyValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
(WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
* css/CSSPrimitiveValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::getDirectComputationalDependencies const):
(WebCore::CSSValue::getDirectRootComputationalDependencies const):
* css/CSSValue.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::resolveVariableReference const):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/imported/w3c/ChangeLog
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/registered-property-computation-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSCustomPropertyValue.cpp
Source/WebCore/css/CSSCustomPropertyValue.h
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/CSSVariableData.cpp
Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp