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

Unified Diff: LayoutTests/animations/keyframes-cssom-updates-animation.html

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 6 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/animations/keyframes-cssom-updates-animation.html
diff --git a/LayoutTests/animations/keyframes-cssom-updates-animation.html b/LayoutTests/animations/keyframes-cssom-updates-animation.html
new file mode 100644
index 0000000000000000000000000000000000000000..f6e7f9667d36d7ccf141d606b4a9240aeee7a16b
--- /dev/null
+++ b/LayoutTests/animations/keyframes-cssom-updates-animation.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+ @keyframes anim {
+ 0% { left: 0px; }
+ 50% { left: 500px; }
+ 100% { left: 100px; }
+ }
+
+ #target1 {
+ animation: anim 10s -3s linear paused;
+ }
+
+ #target2 {
+ animation: anim 10s -2s linear paused;
+ }
+</style>
+<div id="target1"></div>
+<div id="target2"></div>
+<script>
+ test(function() {
+ assert_equals(parseInt(getComputedStyle(target1).left), 300, 'left offset');
+ assert_equals(parseInt(getComputedStyle(target2).left), 200, 'left offset');
+
+ var rules = document.styleSheets[0].rules;
dstockwell 2014/12/30 00:59:12 I think we need some more tests: * can we use the
shend 2015/01/02 01:58:29 Done.
+ for (var i = 0; i < rules.length; i++) {
+ if (rules[i].type == CSSRule.KEYFRAMES_RULE) {
+ rules[i].appendRule('20% { left: 500px; }');
+ rules[i].deleteRule('50%');
+ }
+ }
+
+ assert_equals(parseInt(getComputedStyle(target1).left), 450, 'left offset');
+ assert_equals(parseInt(getComputedStyle(target2).left), 500, 'left offset');
+
+ }, "Check that appendRule and deleteRule update paused animations");
+</script>

Powered by Google App Engine
This is Rietveld 408576698