[webkit-changes] [WebKit/WebKit] c3229c: [@property] Handle dependency cycles involving roo...

Antti Koivisto noreply at github.com
Tue Jan 17 08:46:44 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c3229c227bf84f8e8577ec0e6ded842ddc36e527
      https://github.com/WebKit/WebKit/commit/c3229c227bf84f8e8577ec0e6ded842ddc36e527
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-01-17 (Tue, 17 Jan 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt
    M Source/WebCore/css/CSSPrimitiveValue.cpp
    M Source/WebCore/css/CSSPrimitiveValue.h
    M Source/WebCore/css/CSSValue.cpp
    M Source/WebCore/css/CSSValue.h
    M Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp
    M Source/WebCore/css/calc/CSSCalcExpressionNode.h
    M Source/WebCore/css/calc/CSSCalcInvertNode.h
    M Source/WebCore/css/calc/CSSCalcNegateNode.h
    M Source/WebCore/css/calc/CSSCalcOperationNode.cpp
    M Source/WebCore/css/calc/CSSCalcOperationNode.h
    M Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp
    M Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.h
    M Source/WebCore/css/calc/CSSCalcValue.cpp
    M Source/WebCore/css/calc/CSSCalcValue.h
    M Source/WebCore/css/parser/CSSParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.h
    M Source/WebCore/style/CustomPropertyRegistry.cpp
    M Source/WebCore/style/PropertyCascade.cpp

  Log Message:
  -----------
  [@property] Handle dependency cycles involving root style
https://bugs.webkit.org/show_bug.cgi?id=250703
rdar://104324136

Reviewed by Alan Baradlay.

'rem' unit and others can create dependency cycles that apply to the document element style only.

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt:
* Source/WebCore/css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::collectComputedStyleDependencies const):

Use Vector instead of a HashMap since there are never very many of these properties.

(WebCore::CSSPrimitiveValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSPrimitiveValue::collectDirectRootComputationalDependencies const): Deleted.

Factor these to a single function that collect both root and normal dependencies.

* Source/WebCore/css/CSSPrimitiveValue.h:
* Source/WebCore/css/CSSValue.cpp:
(WebCore::CSSValue::computedStyleDependencies const):
(WebCore::CSSValue::collectComputedStyleDependencies const):
(WebCore::CSSValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSValue::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/CSSValue.h:
(WebCore::ComputedStyleDependencies::isEmpty const):
* Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* Source/WebCore/css/calc/CSSCalcExpressionNode.h:
* Source/WebCore/css/calc/CSSCalcInvertNode.h:
* Source/WebCore/css/calc/CSSCalcNegateNode.h:
* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::collectComputedStyleDependencies const):
(WebCore::CSSCalcOperationNode::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcOperationNode::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcOperationNode.h:
* Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.cpp:
(WebCore::CSSCalcPrimitiveValueNode::collectComputedStyleDependencies const):
(WebCore::CSSCalcPrimitiveValueNode::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcPrimitiveValueNode::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcPrimitiveValueNode.h:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
(WebCore::CSSCalcValue::collectComputedStyleDependencies const):
(WebCore::CSSCalcValue::collectDirectComputationalDependencies const): Deleted.
(WebCore::CSSCalcValue::collectDirectRootComputationalDependencies const): Deleted.
* Source/WebCore/css/calc/CSSCalcValue.h:
* Source/WebCore/css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCustomPropertyValueWithVariableReferences):

Check for root style dependencies if needed.
Always mark all cycles. This could have impact in some sort of multi-property cycle case.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/style/CustomPropertyRegistry.cpp:
(WebCore::Style::CustomPropertyRegistry::registerFromStylesheet):
* Source/WebCore/style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::shouldApplyAfterAnimation):

Canonical link: https://commits.webkit.org/258985@main




More information about the webkit-changes mailing list