Ignore:
Timestamp:
Oct 6, 2018, 6:57:16 AM (7 years ago)
Author:
[email protected]
Message:

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> 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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSValue.cpp

    r236750 r236895  
    116116        return downcast<CSSImageSetValue>(*this).traverseSubresources(handler);
    117117    return false;
     118}
     119
     120void CSSValue::collectDirectComputationalDependencies(HashSet<CSSPropertyID>& values) const
     121{
     122    if (is<CSSPrimitiveValue>(*this))
     123        downcast<CSSPrimitiveValue>(*this).collectDirectComputationalDependencies(values);
     124}
     125
     126void CSSValue::collectDirectRootComputationalDependencies(HashSet<CSSPropertyID>& values) const
     127{
     128    if (is<CSSPrimitiveValue>(*this))
     129        downcast<CSSPrimitiveValue>(*this).collectDirectRootComputationalDependencies(values);
    118130}
    119131
Note: See TracChangeset for help on using the changeset viewer.