Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[web-animations] add basic interpolation support for <length> custom …
…properties https://bugs.webkit.org/show_bug.cgi?id=249312 Reviewed by Antti Koivisto. Add very basic interpolation support for custom properties starting with only with the <length> type and only dealing with non-additive and non-accumulative animations with explicit keyframe values. We add a new WPT test for <length> that draws the blueprint for the remaining work. * LayoutTests/imported/w3c/web-platform-tests/css/css-animations/animation-important-001-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-animation-length-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-animation-length.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/font-size-animation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-revert-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/resources/utils.js: * Source/WebCore/animation/CSSPropertyAnimation.cpp: (WebCore::blendSyntaxValues): (WebCore::blendedCSSCustomPropertyValue): (WebCore::CSSPropertyAnimation::blendCustomProperty): * Source/WebCore/animation/CSSPropertyAnimation.h: * Source/WebCore/animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Canonical link: https://commits.webkit.org/257906@main
- Loading branch information
Showing
9 changed files
with
132 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
PASS Animating a custom property of type <length> | ||
FAIL Animating a custom property of type <length> with a single keyframe assert_equals: expected "150px" but got "100px" | ||
FAIL Animating a custom property of type <length> with additivity assert_equals: expected "350px" but got "250px" | ||
FAIL Animating a custom property of type <length> with a single keyframe and additivity assert_equals: expected "250px" but got "100px" | ||
FAIL Animating a custom property of type <length> with iterationComposite assert_equals: expected "250px" but got "50px" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../resources/utils.js"></script> | ||
<div id="target"></div> | ||
<script> | ||
|
||
animation_test({ | ||
syntax: "<length>", | ||
inherits: false, | ||
initialValue: "0px" | ||
}, { | ||
keyframes: ["100px", "200px"], | ||
expected: "150px" | ||
}, 'Animating a custom property of type <length>'); | ||
|
||
animation_test({ | ||
syntax: "<length>", | ||
inherits: false, | ||
initialValue: "100px" | ||
}, { | ||
keyframes: "200px", | ||
expected: "150px" | ||
}, 'Animating a custom property of type <length> with a single keyframe'); | ||
|
||
animation_test({ | ||
syntax: "<length>", | ||
inherits: false, | ||
initialValue: "100px" | ||
}, { | ||
composite: "add", | ||
keyframes: ["200px", "300px"], | ||
expected: "350px" | ||
}, 'Animating a custom property of type <length> with additivity'); | ||
|
||
animation_test({ | ||
syntax: "<length>", | ||
inherits: false, | ||
initialValue: "100px" | ||
}, { | ||
composite: "add", | ||
keyframes: "300px", | ||
expected: "250px" | ||
}, 'Animating a custom property of type <length> with a single keyframe and additivity'); | ||
|
||
animation_test({ | ||
syntax: "<length>", | ||
inherits: false, | ||
initialValue: "100px" | ||
}, { | ||
iterationComposite: "accumulate", | ||
keyframes: ["0px", "100px"], | ||
expected: "250px" | ||
}, 'Animating a custom property of type <length> with iterationComposite'); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL Animating font-size handled identically for standard and custom properties assert_equals: expected "400px" but got "250px" | ||
PASS Animating font-size handled identically for standard and custom properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
PASS Inherited registered custom property can be reverted | ||
PASS Non-inherited registered custom property can be reverted | ||
FAIL Non-inherited registered custom property can be reverted in animation assert_equals: expected "50px" but got "100px" | ||
FAIL Inherited registered custom property can be reverted in animation assert_equals: expected "50px" but got "100px" | ||
PASS Non-inherited registered custom property can be reverted in animation | ||
PASS Inherited registered custom property can be reverted in animation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters