OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../resources/testharness.js"></script> | |
3 <script src="../resources/testharnessreport.js"></script> | |
4 <div id="anim"></div> | |
5 <script> | |
6 test(() => assert_not_equals(window.internals, undefined, "No window.interna ls."), "Needs window.internals for testing"); | |
7 anim.offsetTop; | |
8 </script> | |
9 <style> | |
10 @keyframes unused { | |
11 from { color: pink } | |
12 to { color: orange } | |
13 } | |
14 </style> | |
15 <script> | |
16 test(() => | |
17 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, " Incorrect element recalc count.") | |
18 , "Check that adding @keyframes does not cause a style recalc of the anim el ement when no animations are running."); | |
19 </script> | |
20 <style> | |
21 #anim { | |
22 color: red; | |
23 animation-name: later; | |
24 animation-duration: 100s; | |
25 animation-timing-function: step-end; | |
26 } | |
27 </style> | |
28 <script> | |
29 test(() => | |
30 assert_equals(getComputedStyle(anim).color, "rgb(255, 0, 0)", "Color of #anim is not red.") | |
31 , "Check initial color of #anim."); | |
32 | |
33 anim.offsetTop; | |
34 </script> | |
35 <style> | |
36 @keyframes later { | |
37 from { color: green } | |
38 to { color: red } | |
39 } | |
alancutter (OOO until 2018)
2016/06/29 12:41:53
We should test that adding a second "@keyframes la
rune
2016/06/29 21:09:46
Done.
| |
40 </style> | |
41 <script> | |
42 test(() => | |
43 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 13, "Incorrect full document recalc count") | |
44 , "Check that adding @keyframes after keyframe resolution failed, recalculat es whole document"); | |
45 | |
46 test(() => | |
47 assert_equals(getComputedStyle(anim).color, "rgb(0, 128, 0)", "Color of #anim during animation is not green.") | |
48 , "Check that @keyframes rule applies."); | |
49 | |
50 anim.offsetTop; | |
51 </script> | |
52 <style> | |
53 @keyframes unused2 { | |
54 from { color: pink } | |
55 to { color: orange } | |
56 } | |
57 </style> | |
58 <script> | |
59 test(() => | |
60 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, " Incorrect recalc count.") | |
alancutter (OOO until 2018)
2016/06/29 12:41:53
I don't agree with using failure messages for the
rune
2016/06/29 21:09:46
Done.
| |
61 , "Check that adding @keyframes causes a style recalc of the anim element wh en an animation is running."); | |
62 </script> | |
OLD | NEW |