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

Side by Side 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 5 years, 11 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <style>
5 @keyframes anim {
6 0% { left: 0px; }
7 50% { left: 500px; }
8 100% { left: 100px; }
9 }
10
11 #target1 {
12 animation: anim 10s -3s linear paused;
13 }
14
15 #target2 {
16 animation: anim 10s -2s linear paused;
17 }
18 </style>
19 <div id="target1"></div>
20 <div id="target2"></div>
21 <script>
22 test(function() {
23 assert_equals(parseInt(getComputedStyle(target1).left), 300, 'left offset');
24 assert_equals(parseInt(getComputedStyle(target2).left), 200, 'left offset');
25
26 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.
27 for (var i = 0; i < rules.length; i++) {
28 if (rules[i].type == CSSRule.KEYFRAMES_RULE) {
29 rules[i].appendRule('20% { left: 500px; }');
30 rules[i].deleteRule('50%');
31 }
32 }
33
34 assert_equals(parseInt(getComputedStyle(target1).left), 450, 'left offset');
35 assert_equals(parseInt(getComputedStyle(target2).left), 500, 'left offset');
36
37 }, "Check that appendRule and deleteRule update paused animations");
38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698