Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: LayoutTests/transitions/interrupted-immediately.html

Issue 110123005: Web Animations CSS: Record if style recalc is for animation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Ignore new interrupted immediately test when testing legacy animations engine Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/transitions/interrupted-immediately.html
diff --git a/LayoutTests/transitions/interrupted-all-transition.html b/LayoutTests/transitions/interrupted-immediately.html
similarity index 58%
copy from LayoutTests/transitions/interrupted-all-transition.html
copy to LayoutTests/transitions/interrupted-immediately.html
index 3c4e1ecd147312448ea753b53f526e1368a1ea97..a296824741af45b8aad8012b867f343e6d323634 100644
--- a/LayoutTests/transitions/interrupted-all-transition.html
+++ b/LayoutTests/transitions/interrupted-immediately.html
@@ -25,28 +25,33 @@
testRunner.waitUntilDone();
}
+ var id;
+
function startTransition()
{
var box = document.getElementById('box');
+
box.style.left = '300px';
- box.style.opacity = 0.5;
- window.setTimeout(function() {
- box.style.left = '0px';
-
- window.setTimeout(function() {
- var boxPos = parseInt(window.getComputedStyle(box).left);
- document.getElementById('result').innerHTML = (boxPos < 200) ? "PASS" : "FAIL";
- if (window.testRunner)
- testRunner.notifyDone();
- }, 250);
- }, 500);
+ box.offsetTop; // force transition start
+
+ box.style.left = '0px'
+ box.offsetTop; // force transition interruption
+
+ // Force at least one timing update and recalc after the interruption.
+ id = requestAnimationFrame(function() {
+ cancelAnimationFrame(id);
+ var current = internals.numberOfActiveAnimations();
+ document.getElementById('result').innerHTML = (current == 0) ? "PASS" : "FAIL";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
}
window.addEventListener('load', startTransition, false)
</script>
</head>
<body>
-<p>Box should start moving left after left style is reset after 500ms</p>
+<p>Box should stay left as style is reset immediately</p>
<div id="container">
<div id="box">
</div>
« no previous file with comments | « LayoutTests/transitions/cancel-transition.html ('k') | LayoutTests/transitions/interrupted-immediately-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698