Files
palemoon27/testing/web-platform/tests/web-animations/keyframe-effect/getComputedTiming.html
T
roytam1 98491d0687 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 382721 - Part 1: Fix spacing of simple 2px dotted border without radius. r=jrmuizel (8e83589f45)
- Bug 382721 - Part 2: Split constants for border rendering to BorderConsts.h. r=jrmuizel (88ae5aee7f)
- Bug 1237805 part 1 - [css-grid] Remove all empty 'auto-fit' tracks, not just those at the end. r=dholbert (1c0530b87b)
- Bug 1237805 part 2 - [css-grid] 'auto-fit' reftest removing empty start/middle tracks. (3bfc688e2b)
- Bug 1239036 - [css-grid] Deal with implicit tracks when computing grid-template-{columns,rows}. r=dholbert (cf36d9193a)
- Bug 1239036 - [css-grid] Tests. (4aaec0499f)
- Bug 1238294 part 1 - [css-grid] Make GridLineEdge() a method on the Tracks class rather than a static function (idempotent change). r=dholbert (ab81994ec6)
- Bug 1238294 part 2 - [css-grid] Treat any gaps at the grid edges as "line thickness" so they behave the same as gaps between tracks for positioning areas. r=dholbert (fafdc1ceef)
- Bug 1230695 - [css-grid] More abs.pos. grid alignment reftests. (330770cf1a)
- Bug 1238294 part 3 - [css-grid] Add/tweak reftests for new behavior of gaps at the grid edges. (58ff8670a1)
- Bug 1240795 - [css-grid] Refactor GetComputedTemplateColumns/Rows to return a self-contained value. r=dholbert (9c5e68418f)
- Bug 1229739 - Use the color of shadow if available for drawing emphasis marks in shadow. r=jfkthame (c19c3deb1c)
- Bug 1191597 part 3 - Convert fullscreen-api-keys to a browser chrome test. r=smaug (ad740d4c4c)
- Bug 1174575 - Part 1: Define CSSPseudoElement interface. r=birtles, r=smaug (1a304d59c4)
- Bug 1214536 - Part 1: Use unrestricted double for iterations. r=birtles (0dbb02e423)
- Bug 1214536 - Part 2: Replace mIterationCount in layers::Animation. r=birtles (8a573046f5)
- Bug 1214536 - Part 3: Store the original value of fill. r=birtles (df548c244a)
- Bug 1214536 - Part 4: Use OwingUnrestrictedDoubleOrString for duration. r=birtles (567cfd1555)
- Bug 1214536 - Part 5: Add AnimationEffectTimingReadOnly interface. r=birtles, r=smaug (47138ec7f0)
- Bug 1214536 - Part 6: Revise AnimationTiming::operator==. r=birtles (616fc2c711)
- Bug 1214536 - Part 7: Rename AnimationTiming as TimingParams. r=birtles, r=smaug (d7de0ec72b)
- Bug 1214536 - Part 8: Add an operator=() for TimingParams. r=birtles (bfe22c6501)
- Bug 1215406 - Part 6: Test. r=birtles (3f16796304)
- Bug 1214536 - Part 9: Test. r=birtles (526419cc1d)
- Bug 1147673 - Unadjust clip before intersecting it with the scroll clip. r=botond (85cd06d2d5)
- Bug 1147673 - Determine more accurately whether an async transform affects a layer's clip rect. r=kats (8ce7d1e887)
- Bug 1096773 part 1 - Make the frames argument to the KeyframeEffectReadOnly constructor NOT optional; r=bz (6e63b08671)
- Bug 1096773 part 2 - Add a KeyframeEffectReadOnly constructor that takes a TimingParams argument; r=boris (24971306e6)
- Bug 1096773 part 3 - Implement Animatable.animate(); r=bz (9d95ea800e)
- Bug 1096773 part 4 - Add tests for Animatable.animate(); r=bz (03b866b2d8)
- Bug 1179627 - Part 1: Implement Animation.id. r=smaug, r=birtles (51bbed6e9d)
- Bug 1096774 - Part 1: Implement Animation Constructor. r=birtles, r=smaug (e09d7fbd7c)
- Bug 1179627 - Part 2: Add animation.id for CSS animations test files. r=bbirtles, r=hiikezoe (329ea31f33)
- Bug 1096774 - Part 2: Fix crash if animation has no timeline. r=birtles (d989b44866)
- Bug 1096774 - Part 3: Tests for Animation Contructor. r=birtles (23786774bc)
- Bug 1240265 - Annotate intentional switch fallthroughs in dom/. r=mrbkap (ffd9da3d5f)
- Bug 1227458. Make setAttributeNode be an alias for setAttributeNodeNS and setNamedItem on the attribute map be an alias for setNamedItemNS. r=smaug (f804d28b93)
- Bug 1226091 - Use MayHaveAnimations in Element::UnbindFromTree; r=smaug (1ec85f75b3)
2023-11-09 09:50:40 +08:00

196 lines
6.4 KiB
HTML

<!DOCTYPE html>
<meta charset=utf-8>
<title>KeyframeEffectReadOnly getComputedTiming() tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffectreadonly-getcomputedtiming">
<link rel="author" title="Boris Chiou" href="mailto:boris.chiou@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
<body>
<div id="log"></div>
<div id="target"></div>
<script>
"use strict";
var target = document.getElementById("target");
test(function(t) {
var effect = new KeyframeEffectReadOnly(target,
{left: ["10px", "20px"]});
var ct = effect.getComputedTiming();
assert_equals(ct.delay, 0, "computed delay");
assert_equals(ct.fill, "none", "computed fill");
assert_equals(ct.iterations, 1.0, "computed iterations");
assert_equals(ct.duration, 0, "computed duration");
assert_equals(ct.direction, "normal", "computed direction");
}, "values of getComputedTiming() when a KeyframeEffectReadOnly is " +
"constructed without any KeyframeEffectOptions object");
var gGetComputedTimingTests = [
{ desc: "an empty KeyframeEffectOption",
input: {},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a normal KeyframeEffectOption",
input: {delay: 1000,
fill: "auto",
iterations: 5.5,
duration: "auto",
direction: "alternate"},
expected: {delay: 1000,
fill: "none",
iterations: 5.5,
duration: 0,
direction: "alternate"} },
{ desc: "a double value",
input: 3000,
timing: {delay: 0,
fill: "auto",
iterations: 1,
duration: 3000,
direction: "normal"},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 3000,
direction: "normal"} },
{ desc: "+Infinity",
input: Infinity,
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: Infinity,
direction: "normal"} },
{ desc: "-Infinity",
input: -Infinity,
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "NaN",
input: NaN,
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a negative value",
input: -1,
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "an Infinity duration",
input: {duration: Infinity},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: Infinity,
direction: "normal"} },
{ desc: "a negative Infinity duration",
input: {duration: -Infinity},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a NaN duration",
input: {duration: NaN},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a negative duration",
input: {duration: -1},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a string duration",
input: {duration: "merrychristmas"},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "an auto duration",
input: {duration: "auto"},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "an Infinity iterations",
input: {iterations: Infinity},
expected: {delay: 0,
fill: "none",
iterations: Infinity,
duration: 0,
direction: "normal"} },
{ desc: "a negative Infinity iterations",
input: {iterations: -Infinity},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a NaN iterations",
input: {iterations: NaN},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a negative iterations",
input: {iterations: -1},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "an auto fill",
input: {fill: "auto"},
expected: {delay: 0,
fill: "none",
iterations: 1,
duration: 0,
direction: "normal"} },
{ desc: "a forwards fill",
input: {fill: "forwards"},
expected: {delay: 0,
fill: "forwards",
iterations: 1,
duration: 0,
direction: "normal"} }
];
gGetComputedTimingTests.forEach(function(stest) {
test(function(t) {
var effect = new KeyframeEffectReadOnly(target,
{left: ["10px", "20px"]},
stest.input);
var ct = effect.getComputedTiming();
assert_equals(ct.delay, stest.expected.delay, "computed delay");
assert_equals(ct.fill, stest.expected.fill, "computed fill");
assert_equals(ct.iterations, stest.expected.iterations,
"computed iterations");
assert_equals(ct.duration, stest.expected.duration, "computed duration");
assert_equals(ct.direction, stest.expected.direction, "computed direction");
}, "values of getComputedTiming() when a KeyframeEffectReadOnly is " +
"constructed by " + stest.desc);
});
done();
</script>
</body>