haikuwebkit/LayoutTests/animations/change-one-anim.html

65 lines
2.0 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Animation using matrix()</title>
<style type="text/css" media="screen">
#box {
position: relative;
height: 20px;
width: 20px;
background-color: #9bb;
-webkit-animation-name: horiz, vert;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
-webkit-animation-timing-function: linear;
}
@-webkit-keyframes horiz {
from { left: 0px; }
to { left:300px; }
}
@-webkit-keyframes vert {
from { top: 0px; }
to { top: 300px; }
}
</style>
2011-04-25 Simon Fraser <simon.fraser@apple.com> Reviewed by Daniel Bates. Move animation-test-helpers.js into resources directory https://bugs.webkit.org/show_bug.cgi?id=59365 Move animation-test-helpers.js and fix the tests accordingly. * animations/3d/matrix-transform-type-animation.html: * animations/3d/transform-perspective.html: * animations/animation-direction.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/big-rotation.html: * animations/change-keyframes-name.html: * animations/change-keyframes.html: * animations/change-one-anim.html: * animations/combo-transform-rotate+scale.html: * animations/dynamic-stylesheet-loading.html: * animations/generic-from-to.html: * animations/import.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-comma-separated.html: * animations/keyframes-out-of-order.html: * animations/keyframes.html: * animations/lineheight-animation.html: * animations/longhand-timing-function.html: * animations/matrix-anim.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/missing-keyframe-properties-repeating.html: * animations/missing-keyframe-properties-timing-function.html: * animations/missing-keyframe-properties.html: * animations/missing-values-first-keyframe.html: * animations/missing-values-last-keyframe.html: * animations/multiple-animations.html: * animations/multiple-keyframes.html: * animations/negative-delay.html: * animations/opacity-transform-animation.html: * animations/play-state-suspend.html: * animations/play-state.html: * animations/resources/animation-test-helpers.js: (isCloseEnough): (matrixStringToArray): (checkExpectedValue): (endTest): (startTest): (runAnimationTest.else): (runAnimationTest): (waitForAnimationToStart): * animations/simultaneous-start-left.html: * animations/simultaneous-start-transform.html: * animations/stop-animation-on-suspend.html: * animations/suspend-resume-animation.html: * animations/timing-functions.html: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: * animations/width-using-ems.html: Canonical link: https://commits.webkit.org/74594@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-04-26 03:16:31 +00:00
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
2008-12-10 Pierre-Olivier Latour <pol@apple.com> Reviewed by Darin Adler. Rewrote animations/animation-test-helpers.js to take advantage of the pauseAnimationAtTimeOnElementWithId() API when available in DRT. Updated all animations tests that check for values of animated CSS properties to use these new helper functions. https://bugs.webkit.org/show_bug.cgi?id=22796 * animations/animation-test-helpers.js: (isCloseEnough): (checkExpectedValue): (endTest): (startTest): (runAnimationTest): * animations/big-rotation-expected.txt: * animations/big-rotation.html: * animations/change-keyframes-expected.txt: * animations/change-keyframes-name-expected.txt: * animations/change-keyframes-name.html: * animations/change-keyframes.html: * animations/change-one-anim-expected.txt: * animations/change-one-anim.html: * animations/generic-from-to-expected.txt: * animations/generic-from-to.html: * animations/import-expected.txt: * animations/import.html: * animations/keyframe-timing-functions-expected.txt: * animations/keyframe-timing-functions.html: * animations/keyframes-comma-separated-expected.txt: * animations/keyframes-comma-separated.html: * animations/keyframes-expected.txt: * animations/keyframes-from-missing.html: * animations/keyframes-out-of-order-expected.txt: * animations/keyframes-out-of-order.html: * animations/keyframes-to-missing.html: * animations/keyframes.html: * animations/lineheight-animation-expected.txt: * animations/lineheight-animation.html: * animations/matrix-anim-expected.txt: * animations/matrix-anim.html: * animations/multiple-animations-expected.txt: * animations/multiple-animations.html: * animations/multiple-keyframes-expected.txt: * animations/multiple-keyframes.html: * animations/transition-and-animation-1-expected.txt: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2-expected.txt: * animations/transition-and-animation-2.html: * animations/width-using-ems-expected.txt: * animations/width-using-ems.html: * platform/win/Skipped: Canonical link: https://commits.webkit.org/31391@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-12-11 00:48:35 +00:00
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
[null, 0.75, "box", "left", 150, 40],
[null, 0.75, "box", "top", 225, 40],
2008-12-10 Pierre-Olivier Latour <pol@apple.com> Reviewed by Darin Adler. Rewrote animations/animation-test-helpers.js to take advantage of the pauseAnimationAtTimeOnElementWithId() API when available in DRT. Updated all animations tests that check for values of animated CSS properties to use these new helper functions. https://bugs.webkit.org/show_bug.cgi?id=22796 * animations/animation-test-helpers.js: (isCloseEnough): (checkExpectedValue): (endTest): (startTest): (runAnimationTest): * animations/big-rotation-expected.txt: * animations/big-rotation.html: * animations/change-keyframes-expected.txt: * animations/change-keyframes-name-expected.txt: * animations/change-keyframes-name.html: * animations/change-keyframes.html: * animations/change-one-anim-expected.txt: * animations/change-one-anim.html: * animations/generic-from-to-expected.txt: * animations/generic-from-to.html: * animations/import-expected.txt: * animations/import.html: * animations/keyframe-timing-functions-expected.txt: * animations/keyframe-timing-functions.html: * animations/keyframes-comma-separated-expected.txt: * animations/keyframes-comma-separated.html: * animations/keyframes-expected.txt: * animations/keyframes-from-missing.html: * animations/keyframes-out-of-order-expected.txt: * animations/keyframes-out-of-order.html: * animations/keyframes-to-missing.html: * animations/keyframes.html: * animations/lineheight-animation-expected.txt: * animations/lineheight-animation.html: * animations/matrix-anim-expected.txt: * animations/matrix-anim.html: * animations/multiple-animations-expected.txt: * animations/multiple-animations.html: * animations/multiple-keyframes-expected.txt: * animations/multiple-keyframes.html: * animations/transition-and-animation-1-expected.txt: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2-expected.txt: * animations/transition-and-animation-2.html: * animations/width-using-ems-expected.txt: * animations/width-using-ems.html: * platform/win/Skipped: Canonical link: https://commits.webkit.org/31391@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-12-11 00:48:35 +00:00
];
function removeAnim()
{
var target = document.getElementById("box");
var left = window.getComputedStyle(target).left;
target.style.webkitAnimationName = "vert";
target.style.left = left;
}
2008-12-10 Pierre-Olivier Latour <pol@apple.com> Reviewed by Darin Adler. Rewrote animations/animation-test-helpers.js to take advantage of the pauseAnimationAtTimeOnElementWithId() API when available in DRT. Updated all animations tests that check for values of animated CSS properties to use these new helper functions. https://bugs.webkit.org/show_bug.cgi?id=22796 * animations/animation-test-helpers.js: (isCloseEnough): (checkExpectedValue): (endTest): (startTest): (runAnimationTest): * animations/big-rotation-expected.txt: * animations/big-rotation.html: * animations/change-keyframes-expected.txt: * animations/change-keyframes-name-expected.txt: * animations/change-keyframes-name.html: * animations/change-keyframes.html: * animations/change-one-anim-expected.txt: * animations/change-one-anim.html: * animations/generic-from-to-expected.txt: * animations/generic-from-to.html: * animations/import-expected.txt: * animations/import.html: * animations/keyframe-timing-functions-expected.txt: * animations/keyframe-timing-functions.html: * animations/keyframes-comma-separated-expected.txt: * animations/keyframes-comma-separated.html: * animations/keyframes-expected.txt: * animations/keyframes-from-missing.html: * animations/keyframes-out-of-order-expected.txt: * animations/keyframes-out-of-order.html: * animations/keyframes-to-missing.html: * animations/keyframes.html: * animations/lineheight-animation-expected.txt: * animations/lineheight-animation.html: * animations/matrix-anim-expected.txt: * animations/matrix-anim.html: * animations/multiple-animations-expected.txt: * animations/multiple-animations.html: * animations/multiple-keyframes-expected.txt: * animations/multiple-keyframes.html: * animations/transition-and-animation-1-expected.txt: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2-expected.txt: * animations/transition-and-animation-2.html: * animations/width-using-ems-expected.txt: * animations/width-using-ems.html: * platform/win/Skipped: Canonical link: https://commits.webkit.org/31391@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-12-11 00:48:35 +00:00
function setup()
{
setTimeout("removeAnim()", 500);
}
2008-12-10 Pierre-Olivier Latour <pol@apple.com> Reviewed by Darin Adler. Rewrote animations/animation-test-helpers.js to take advantage of the pauseAnimationAtTimeOnElementWithId() API when available in DRT. Updated all animations tests that check for values of animated CSS properties to use these new helper functions. https://bugs.webkit.org/show_bug.cgi?id=22796 * animations/animation-test-helpers.js: (isCloseEnough): (checkExpectedValue): (endTest): (startTest): (runAnimationTest): * animations/big-rotation-expected.txt: * animations/big-rotation.html: * animations/change-keyframes-expected.txt: * animations/change-keyframes-name-expected.txt: * animations/change-keyframes-name.html: * animations/change-keyframes.html: * animations/change-one-anim-expected.txt: * animations/change-one-anim.html: * animations/generic-from-to-expected.txt: * animations/generic-from-to.html: * animations/import-expected.txt: * animations/import.html: * animations/keyframe-timing-functions-expected.txt: * animations/keyframe-timing-functions.html: * animations/keyframes-comma-separated-expected.txt: * animations/keyframes-comma-separated.html: * animations/keyframes-expected.txt: * animations/keyframes-from-missing.html: * animations/keyframes-out-of-order-expected.txt: * animations/keyframes-out-of-order.html: * animations/keyframes-to-missing.html: * animations/keyframes.html: * animations/lineheight-animation-expected.txt: * animations/lineheight-animation.html: * animations/matrix-anim-expected.txt: * animations/matrix-anim.html: * animations/multiple-animations-expected.txt: * animations/multiple-animations.html: * animations/multiple-keyframes-expected.txt: * animations/multiple-keyframes.html: * animations/transition-and-animation-1-expected.txt: * animations/transition-and-animation-1.html: * animations/transition-and-animation-2-expected.txt: * animations/transition-and-animation-2.html: * animations/width-using-ems-expected.txt: * animations/width-using-ems.html: * platform/win/Skipped: Canonical link: https://commits.webkit.org/31391@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-12-11 00:48:35 +00:00
runAnimationTest(expectedValues, setup);
</script>
</head>
<body>
This test performs two animations, left and top. It animates over 1 second.
At 0.5 second it removes the left animation and the top animation should continue
from where it left off.
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>