[webkit-changes] [WebKit/WebKit] 56d4a1: [css-transitions] support transitions of custom pr...

Antoine Quint noreply at github.com
Tue Dec 20 06:59:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 56d4a17a7f6bb0043f4c1f320a5eaf748ac03835
      https://github.com/WebKit/WebKit/commit/56d4a17a7f6bb0043f4c1f320a5eaf748ac03835
  Author: Antoine Quint <graouts at apple.com>
  Date:   2022-12-20 (Tue, 20 Dec 2022)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-angle-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-angle.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-color-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-color.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-custom-ident-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-custom-ident.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-image-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-image.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-inherited-used-by-standard-property-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-inherited-used-by-standard-property.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-integer-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-integer.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-percentage-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-percentage.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-mismatched-list-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-mismatched-list.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-non-inherited-used-by-standard-property-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-non-inherited-used-by-standard-property.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-number-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-number.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-percentage-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-percentage.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-resolution-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-resolution.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-time-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-time.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-function-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-function.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-list-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-list.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-url-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-url.html
    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/resources/utils.js
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/animation/CSSPropertyAnimation.h
    M Source/WebCore/animation/KeyframeEffectStack.cpp
    M Source/WebCore/css/CSSCustomPropertyValue.cpp
    M Source/WebCore/css/CSSCustomPropertyValue.h
    M Source/WebCore/css/CSSToStyleMap.cpp
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/platform/animation/Animation.cpp
    M Source/WebCore/platform/animation/Animation.h
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  [css-transitions] support transitions of custom properties
https://bugs.webkit.org/show_bug.cgi?id=249399
rdar://103404742

Reviewed by Antti Koivisto.

We now account for custom properties when considering what properties are eligible to run
a transition under Styleable::updateCSSTransitions().

The first task to make this possible was to add new mode for custom properties to the
Animation object representing a transition on RenderStyle. We leverage the same mechanism
previously used for unknown properties and make it so we can track a custom property as well.

Then we had to finish the implementation of two CSSPropertyAnimation methods to deal with
custom properties. As we consider properties for a transition in Styleable::updateCSSTransitions(),
we call CSSPropertyAnimation::canPropertyBeInterpolated() and CSSPropertyAnimation::propertiesEqual()
to determine we can even transition between two values of a given property or whether the underlying
value of a property has changed while a transition is in-flight.

We now fully implement the custom property path of these CSSPropertyAnimation methods. This required
a little extra work. First, we had to provide a Document to these methods to access initial values
in the case where explicit values for custom properties are not set on RenderStyle.

Then, we had to determine which syntax value types support interpolation, which is most except for
<custom-ident>, <image> and <url>.

Finally, we had to introduce a new TransformSyntaxValue wrapper for RefPtr<TransformOperation> values
to provide a custom operator== to not run simply pointer equality but actually compare the transform
operations.

We added comprehensive tests for CSS Transitions and custom properties, with two notable new failures
tracked by bugs 249640 and bugs 249641.

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-angle-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-angle.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-color-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-color.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-custom-ident-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-custom-ident.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-image-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-image.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-inherited-used-by-standard-property-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-inherited-used-by-standard-property.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-integer-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-integer.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-percentage-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length-percentage.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-length.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-mismatched-list-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-mismatched-list.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-non-inherited-used-by-standard-property-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-non-inherited-used-by-standard-property.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-number-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-number.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-percentage-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-percentage.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-resolution-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-resolution.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-time-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-time.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-function-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-function.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-list-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-transform-list.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-url-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-transition-url.html: Added.
* 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/resources/utils.js:
(async no_transition_test):
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::blendSyntaxValues):
(WebCore::firstValueInSyntaxValueLists):
(WebCore::blendSyntaxValueLists):
(WebCore::blendCustomProperty):
(WebCore::CSSPropertyAnimation::propertyRequiresBlendingForAccumulativeIteration):
(WebCore::CSSPropertyAnimation::propertiesEqual):
(WebCore::typeOfSyntaxValueCanBeInterpolated):
(WebCore::CSSPropertyAnimation::canPropertyBeInterpolated):
* Source/WebCore/animation/CSSPropertyAnimation.h:
* Source/WebCore/animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::applyKeyframeEffects):
* Source/WebCore/css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
* Source/WebCore/css/CSSCustomPropertyValue.h:
* Source/WebCore/css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationProperty):
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::createTransitionPropertyValue):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
* Source/WebCore/platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
(WebCore::Animation::animationsMatch const):
(WebCore::operator<<):
* Source/WebCore/platform/animation/Animation.h:
(WebCore::Animation::customOrUnknownProperty const):
(WebCore::Animation::setCustomOrUnknownProperty):
(WebCore::Animation::unknownProperty const): Deleted.
(WebCore::Animation::setUnknownProperty): Deleted.
* Source/WebCore/style/Styleable.cpp:
(WebCore::propertyInStyleMatchesValueForTransitionInMap):
(WebCore::transitionMatchesProperty):
(WebCore::compileTransitionPropertiesInStyle):
(WebCore::updateCSSTransitionsForStyleableAndProperty):
(WebCore::Styleable::updateCSSTransitions const):

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




More information about the webkit-changes mailing list