Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[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
- Loading branch information