Skip to content
Permalink
Browse files
[web-animations] add tests for <length-percentage> custom property in…
…terpolation

https://bugs.webkit.org/show_bug.cgi?id=249403

Reviewed by Antti Koivisto.

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-animation-length-percentage-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/animation/custom-property-animation-length-percentage.html: Added.

Canonical link: https://commits.webkit.org/257931@main
  • Loading branch information
graouts committed Dec 15, 2022
1 parent c7b7097 commit c0462225cee0519a9a1dd0c406448a56456ad523
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
@@ -0,0 +1,7 @@

PASS Animating a custom property of type <length-percentage>
PASS Animating a custom property of type <length-percentage> with a single keyframe
PASS Animating a custom property of type <length-percentage> with additivity
PASS Animating a custom property of type <length-percentage> with a single keyframe and additivity
PASS Animating a custom property of type <length-percentage> with iterationComposite

@@ -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-percentage>",
inherits: false,
initialValue: "0px"
}, {
keyframes: ["100px", "100%"],
expected: "calc(50% + 50px)"
}, 'Animating a custom property of type <length-percentage>');

animation_test({
syntax: "<length-percentage>",
inherits: false,
initialValue: "100px"
}, {
keyframes: "100%",
expected: "calc(50% + 50px)"
}, 'Animating a custom property of type <length-percentage> with a single keyframe');

animation_test({
syntax: "<length-percentage>",
inherits: false,
initialValue: "100px"
}, {
composite: "add",
keyframes: ["200%", "300%"],
expected: "calc(250% + 100px)"
}, 'Animating a custom property of type <length-percentage> with additivity');

animation_test({
syntax: "<length-percentage>",
inherits: false,
initialValue: "100px"
}, {
composite: "add",
keyframes: "300%",
expected: "calc(150% + 100px)"
}, 'Animating a custom property of type <length-percentage> with a single keyframe and additivity');

animation_test({
syntax: "<length-percentage>",
inherits: false,
initialValue: "100px"
}, {
iterationComposite: "accumulate",
keyframes: ["50px", "100%"],
expected: "calc(250% + 25px)"
}, 'Animating a custom property of type <length-percentage> with iterationComposite');

</script>

0 comments on commit c046222

Please sign in to comment.