[webkit-changes] [WebKit/WebKit] ffe6d8: [@property] Set registered initial values to Rende...

Antti Koivisto noreply at github.com
Fri Feb 3 01:19:27 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ffe6d89e6fa50326715ba03ddd7134bc0d891dbc
      https://github.com/WebKit/WebKit/commit/ffe6d89e6fa50326715ba03ddd7134bc0d891dbc
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-animation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-registered-custom-properties-expected.txt
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSVariableReferenceValue.cpp
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/StyleCustomPropertyData.h
    M Source/WebCore/style/CustomPropertyRegistry.cpp
    M Source/WebCore/style/CustomPropertyRegistry.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  [@property] Set registered initial values to RenderStyle
https://bugs.webkit.org/show_bug.cgi?id=251575
rdar://104953759

Reviewed by Antoine Quint.

Remove the need to provide the registry to RenderStyle::customPropertyValue().

This is done by maintaining a prototype style in CustomPropertyRegistry that is cloned
to make the initial styles in the style resolver.

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-animation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/typedom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-registered-custom-properties-expected.txt:

This also fixes some bugs.

* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendCustomProperty):
(WebCore::CSSPropertyAnimation::propertyRequiresBlendingForAccumulativeIteration):
(WebCore::CSSPropertyAnimation::propertiesEqual):
(WebCore::CSSPropertyAnimation::canPropertyBeInterpolated):
* Source/WebCore/css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::resolveVariableReference const):
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* Source/WebCore/css/typedom/ComputedStylePropertyMapReadOnly.cpp:
(WebCore::ComputedStylePropertyMapReadOnly::entries const):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::createPtrWithRegisteredInitialValues):
(WebCore::RenderStyle::inheritIgnoringCustomPropertiesFrom):
(WebCore::changedCustomPaintWatchedProperty):
(WebCore::RenderStyle::deduplicateCustomProperties):

Also dedupe non-inherited properties.

(WebCore::RenderStyle::setCustomPropertyValue):

Make this a single function.

(WebCore::RenderStyle::customPropertyValue const):
(WebCore::RenderStyle::deduplicateInheritedCustomProperties): Deleted.
(WebCore::RenderStyle::setInheritedCustomPropertyValue): Deleted.
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue): Deleted.
(WebCore::RenderStyle::customPropertyValueWithoutResolvingInitial const): Deleted.
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
* Source/WebCore/style/CustomPropertyRegistry.cpp:
(WebCore::Style::CustomPropertyRegistry::CustomPropertyRegistry):
(WebCore::Style::CustomPropertyRegistry::registerFromAPI):
(WebCore::Style::CustomPropertyRegistry::registerFromStylesheet):
(WebCore::Style::CustomPropertyRegistry::clearRegisteredFromStylesheets):
(WebCore::Style::CustomPropertyRegistry::initialValuePrototypeStyle const):

Maintain the initial value prototype style.

(WebCore::Style::CustomPropertyRegistry::invalidate):
* Source/WebCore/style/CustomPropertyRegistry.h:
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInitialCustomProperty):
(WebCore::Style::BuilderCustom::applyInheritCustomProperty):
(WebCore::Style::BuilderCustom::applyValueCustomProperty):
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::styleForElement):

Clone the initial style from the prototype.

(WebCore::Style::Resolver::styleForPseudoElement):
(WebCore::Style::Resolver::defaultStyleForElement):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

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




More information about the webkit-changes mailing list