haikuwebkit/LayoutTests/animations/change-transform-style-duri...

81 lines
2.2 KiB
HTML
Raw Permalink Normal View History

[chromium] Ensure that animations continue to run when transform-style is changed https://bugs.webkit.org/show_bug.cgi?id=83283 Source/WebCore: Make sure that we transfer animations when changing layers due to a transform-style change. Unit tested in GraphicsLayerChromiumTest.updateLayerPreserves3DWithAnimations Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. Test: animations/change-transform-style-during-animation.html * platform/graphics/chromium/GraphicsLayerChromium.cpp: (WebCore::GraphicsLayerChromium::updateLayerPreserves3D): * platform/graphics/chromium/LayerChromium.cpp: (WebCore::LayerChromium::setLayerAnimationController): (WebCore::LayerChromium::releaseLayerAnimationController): (WebCore): (WebCore::LayerChromium::notifyAnimationStarted): * platform/graphics/chromium/LayerChromium.h: (LayerChromium): * platform/graphics/chromium/cc/CCLayerAnimationController.cpp: (WebCore::CCLayerAnimationController::CCLayerAnimationController): (WebCore::CCLayerAnimationController::pushAnimationUpdatesTo): (WebCore::CCLayerAnimationController::notifyAnimationStarted): (WebCore::CCLayerAnimationController::setClient): (WebCore): (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread): (WebCore::CCLayerAnimationController::replaceImplThreadAnimations): * platform/graphics/chromium/cc/CCLayerAnimationController.h: (CCLayerAnimationController): (WebCore::CCLayerAnimationController::setForceSync): Source/WebKit/chromium: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * WebKit.gypi: * tests/GraphicsLayerChromiumTest.cpp: Added. (WebKitTests): (MockGraphicsLayerClient): (WebKitTests::MockGraphicsLayerClient::notifyAnimationStarted): (WebKitTests::MockGraphicsLayerClient::notifySyncRequired): (WebKitTests::MockGraphicsLayerClient::paintContents): (WebKitTests::MockGraphicsLayerClient::showDebugBorders): (WebKitTests::MockGraphicsLayerClient::showRepaintCounter): (WebKitTests::TEST): LayoutTests: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * animations/change-transform-style-during-animation-expected.png: Added. * animations/change-transform-style-during-animation-expected.txt: Added. * animations/change-transform-style-during-animation.html: Added. Canonical link: https://commits.webkit.org/103820@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-11 18:04:15 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
#container {
-webkit-transform: translateZ(0px);
-webkit-perspective: 400;
}
#revealed {
position: absolute;
left: 100px;
height: 100px;
width: 100px;
background-color: green;
}
#animated {
position: absolute;
left: 100px;
height: 100px;
width: 100px;
background-color: red;
-webkit-transform: translateZ(10px);
-webkit-transform-style: preserve-3d;
-webkit-animation-duration: 100ms;
-webkit-animation-fill-mode: both;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: 1;
}
@-webkit-keyframes anim {
from { -webkit-transform: translateZ(0px) translateX(0px); }
to { -webkit-transform: translateZ(200px) translateX(-200px); }
}
</style>
<script src="resources/animation-test-helpers.js"></script>
<script>
Clean up accessibility & animations tests to stop calling testRunner.waitUntilDone() twice <https://webkit.org/b/167598> Reviewed by Alexey Proskuryakov. * accessibility/frame-disconnect-textmarker-cache-crash.html: * accessibility/loading-iframe-sends-notification.html: * accessibility/mac/combobox-activedescendant-notifications.html: * accessibility/mac/ordered-textmarker-crash.html: * accessibility/mac/stale-textmarker-crash.html: * accessibility/notification-listeners.html: * accessibility/scroll-to-global-point-iframe-nested.html: * accessibility/scroll-to-global-point-iframe.html: * accessibility/scroll-to-make-visible-iframe.html: * accessibility/svg-element-press.html: - Remove call to testRunner.waitUntilDone() since window.jsTestIsAsync is set to true, and thus waitUntilDone() is called from either js-test.js or js-test-post.js. * animations/animation-delay-changed.html: * animations/change-keyframes-name.html: * animations/font-variations/font-variation-settings-order.html: * animations/font-variations/font-variation-settings-unlike.html: * animations/font-variations/font-variation-settings.html: * animations/longhand-timing-function.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: - Remove call to testRunner.waitUntilDone() since that's moved into animation-test-helpers.js. * animations/resources/animation-test-helpers.js: (runAnimationTest): Call testRunner.waitUntilDone() when this script resource is included instead of when runAnimationTest() is called since runAnimationTest() expects it to be set anyway. * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-internals-api-multiple-keyframes.html: * animations/animation-internals-api.html: * animations/change-transform-style-during-animation.html: * animations/keyframes-iteration-count-non-integer.html: - Remove call to testRunner.waitUntilDone() since that now happens when loading animation-test-helpers.js. These tests don't currently call runAnimationTest(), but they manage their own state by calling testRunner.notifyDone() themselves. * animations/crash-on-removing-animation.html: * animations/resources/crash-on-removing-animation-window.html: Copied from LayoutTests/animations/crash-on-removing-animation.html. - Split this test into a main resource and a window resource. Previously testRunner.waitUntilDone() was being called twice when js-test-post.js was loaded in the main window and then loaded a second time when the window was opened. The new resource file doesn't load either js-test-pre.js or js-test-post.js, avoiding the duplicate call. Canonical link: https://commits.webkit.org/184787@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-02 18:55:23 +00:00
if (window.testRunner)
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
testRunner.dumpAsText();
[chromium] Ensure that animations continue to run when transform-style is changed https://bugs.webkit.org/show_bug.cgi?id=83283 Source/WebCore: Make sure that we transfer animations when changing layers due to a transform-style change. Unit tested in GraphicsLayerChromiumTest.updateLayerPreserves3DWithAnimations Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. Test: animations/change-transform-style-during-animation.html * platform/graphics/chromium/GraphicsLayerChromium.cpp: (WebCore::GraphicsLayerChromium::updateLayerPreserves3D): * platform/graphics/chromium/LayerChromium.cpp: (WebCore::LayerChromium::setLayerAnimationController): (WebCore::LayerChromium::releaseLayerAnimationController): (WebCore): (WebCore::LayerChromium::notifyAnimationStarted): * platform/graphics/chromium/LayerChromium.h: (LayerChromium): * platform/graphics/chromium/cc/CCLayerAnimationController.cpp: (WebCore::CCLayerAnimationController::CCLayerAnimationController): (WebCore::CCLayerAnimationController::pushAnimationUpdatesTo): (WebCore::CCLayerAnimationController::notifyAnimationStarted): (WebCore::CCLayerAnimationController::setClient): (WebCore): (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread): (WebCore::CCLayerAnimationController::replaceImplThreadAnimations): * platform/graphics/chromium/cc/CCLayerAnimationController.h: (CCLayerAnimationController): (WebCore::CCLayerAnimationController::setForceSync): Source/WebKit/chromium: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * WebKit.gypi: * tests/GraphicsLayerChromiumTest.cpp: Added. (WebKitTests): (MockGraphicsLayerClient): (WebKitTests::MockGraphicsLayerClient::notifyAnimationStarted): (WebKitTests::MockGraphicsLayerClient::notifySyncRequired): (WebKitTests::MockGraphicsLayerClient::paintContents): (WebKitTests::MockGraphicsLayerClient::showDebugBorders): (WebKitTests::MockGraphicsLayerClient::showRepaintCounter): (WebKitTests::TEST): LayoutTests: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * animations/change-transform-style-during-animation-expected.png: Added. * animations/change-transform-style-during-animation-expected.txt: Added. * animations/change-transform-style-during-animation.html: Added. Canonical link: https://commits.webkit.org/103820@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-11 18:04:15 +00:00
function animationDone()
{
var animated = document.getElementById('animated');
var result;
var expected = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -200, 0, 200, 1];
var computed = getPropertyValue("webkitTransform", "animated");
if (comparePropertyValue("webkitTransform", computed, expected, 0.002)) {
result = "PASS - Computed final position is correct.";
} else {
result = "FAIL - Computed final position is incorrect. Expected " + expected + ", got " + computed;
}
document.getElementById('result').innerHTML = result;
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
testRunner.notifyDone();
[chromium] Ensure that animations continue to run when transform-style is changed https://bugs.webkit.org/show_bug.cgi?id=83283 Source/WebCore: Make sure that we transfer animations when changing layers due to a transform-style change. Unit tested in GraphicsLayerChromiumTest.updateLayerPreserves3DWithAnimations Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. Test: animations/change-transform-style-during-animation.html * platform/graphics/chromium/GraphicsLayerChromium.cpp: (WebCore::GraphicsLayerChromium::updateLayerPreserves3D): * platform/graphics/chromium/LayerChromium.cpp: (WebCore::LayerChromium::setLayerAnimationController): (WebCore::LayerChromium::releaseLayerAnimationController): (WebCore): (WebCore::LayerChromium::notifyAnimationStarted): * platform/graphics/chromium/LayerChromium.h: (LayerChromium): * platform/graphics/chromium/cc/CCLayerAnimationController.cpp: (WebCore::CCLayerAnimationController::CCLayerAnimationController): (WebCore::CCLayerAnimationController::pushAnimationUpdatesTo): (WebCore::CCLayerAnimationController::notifyAnimationStarted): (WebCore::CCLayerAnimationController::setClient): (WebCore): (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread): (WebCore::CCLayerAnimationController::replaceImplThreadAnimations): * platform/graphics/chromium/cc/CCLayerAnimationController.h: (CCLayerAnimationController): (WebCore::CCLayerAnimationController::setForceSync): Source/WebKit/chromium: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * WebKit.gypi: * tests/GraphicsLayerChromiumTest.cpp: Added. (WebKitTests): (MockGraphicsLayerClient): (WebKitTests::MockGraphicsLayerClient::notifyAnimationStarted): (WebKitTests::MockGraphicsLayerClient::notifySyncRequired): (WebKitTests::MockGraphicsLayerClient::paintContents): (WebKitTests::MockGraphicsLayerClient::showDebugBorders): (WebKitTests::MockGraphicsLayerClient::showRepaintCounter): (WebKitTests::TEST): LayoutTests: Patch by Ian Vollick <vollick@chromium.org> on 2012-05-11 Reviewed by James Robinson. * animations/change-transform-style-during-animation-expected.png: Added. * animations/change-transform-style-during-animation-expected.txt: Added. * animations/change-transform-style-during-animation.html: Added. Canonical link: https://commits.webkit.org/103820@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-11 18:04:15 +00:00
}
function animationStarted()
{
var animated = document.getElementById('animated');
animated.style.webkitTransformStyle = 'flat';
}
function startTest()
{
var animated = document.getElementById('animated');
animated.style.webkitAnimationName = "anim";
animated.addEventListener('webkitAnimationEnd', animationDone);
waitForAnimationToStart(animated, animationStarted);
}
</script>
</head>
<body onload="startTest()">
<div id="container">
<div id="revealed"></div>
<div id="animated"></div>
</div>
<div id="result"></div>
</body>
</html>