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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/shadowhost-keyframes.html

Issue 2521163002: CSS Animations: Reduce usage of webkit prefix in layout tests (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style> 4 <style>
5 @-webkit-keyframes anim { 5 @keyframes anim {
6 from { 6 from {
7 background-color: red; 7 background-color: red;
8 } 8 }
9 to { 9 to {
10 background-color: green; 10 background-color: green;
11 } 11 }
12 } 12 }
13 </style> 13 </style>
14 <script src="../../../resources/js-test.js"></script> 14 <script src="../../../resources/js-test.js"></script>
15 </head> 15 </head>
16 <body> 16 <body>
17 <div id="host"></div> 17 <div id="host"></div>
18 <div id="result"></div> 18 <div id="result"></div>
19 <script> 19 <script>
20 if (window.testRunner) 20 if (window.testRunner)
21 testRunner.waitUntilDone(); 21 testRunner.waitUntilDone();
22 22
23 function getColor(element) { 23 function getColor(element) {
24 return window.getComputedStyle(element).color; 24 return window.getComputedStyle(element).color;
25 } 25 }
26 26
27 description('Test if @keyframes works for shadow host when using :host. i.e. crb ug.com/332577'); 27 description('Test if @keyframes works for shadow host when using :host. i.e. crb ug.com/332577');
28 28
29 var host = document.getElementById('host'); 29 var host = document.getElementById('host');
30 var sr = host.createShadowRoot(); 30 var sr = host.createShadowRoot();
31 sr.innerHTML = '<style>@-webkit-keyframes anim {' 31 sr.innerHTML = '<style>@keyframes anim {'
32 + 'from { color: red; } to { color: green; } }' 32 + 'from { color: red; } to { color: green; } }'
33 + ':host { -webkit-animation: anim 0.5s both; color: red; }</style>' 33 + ':host { animation: anim 0.5s both; color: red; }</style>'
34 + 'I should become green'; 34 + 'I should become green';
35 35
36 window.setTimeout(function() { 36 window.setTimeout(function() {
37 shouldBe("getColor(document.getElementById('host'))", '"rgb(0, 128, 0)"'); 37 shouldBe("getColor(document.getElementById('host'))", '"rgb(0, 128, 0)"');
38 if (window.testRunner) 38 if (window.testRunner)
39 testRunner.notifyDone(); 39 testRunner.notifyDone();
40 }, 1000); 40 }, 1000);
41 </script> 41 </script>
42 </body> 42 </body>
43 </html> 43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698