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

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

Issue 2513413007: 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="d1"></div> 17 <div id="d1"></div>
18 <div id="d2"></div> 18 <div id="d2"></div>
19 <div id="result"></div> 19 <div id="result"></div>
20 <script> 20 <script>
21 if (window.testRunner) 21 if (window.testRunner)
22 testRunner.waitUntilDone(); 22 testRunner.waitUntilDone();
23 23
24 function getBackgroundColor(element) { 24 function getBackgroundColor(element) {
25 return window.getComputedStyle(element).backgroundColor; 25 return window.getComputedStyle(element).backgroundColor;
26 } 26 }
27 27
28 var shadowRootWithKeyframe = document.getElementById("d1").createShadowRoot(); 28 var shadowRootWithKeyframe = document.getElementById("d1").createShadowRoot();
29 shadowRootWithKeyframe.innerHTML = '<style>@-webkit-keyframes anim {' + 29 shadowRootWithKeyframe.innerHTML = '<style>@keyframes anim {' +
30 'from { background-color:red; } to { background-color: blue; } }' + 30 'from { background-color:red; } to { background-color: blue; } }' +
31 '#box { height: 100px; width: 100px; background: red; ' + 31 '#box { height: 100px; width: 100px; background: red; ' +
32 '-webkit-animation: anim 0.5s both; }</style>' + 32 'animation: anim 0.5s both; }</style>' +
33 '<div id="box"></div>'; 33 '<div id="box"></div>';
34 34
35 var shadowRootWithoutKeyframe = document.getElementById("d2").createShadowRoot() ; 35 var shadowRootWithoutKeyframe = document.getElementById("d2").createShadowRoot() ;
36 shadowRootWithoutKeyframe.innerHTML = '<style>' + 36 shadowRootWithoutKeyframe.innerHTML = '<style>' +
37 '#box { height: 100px; width: 100px; background: red; ' + 37 '#box { height: 100px; width: 100px; background: red; ' +
38 '-webkit-animation: anim 0.5s both; }</style>' + 38 'animation: anim 0.5s both; }</style>' +
39 '<div id="box"></div>'; 39 '<div id="box"></div>';
40 40
41 window.setTimeout(function() { 41 window.setTimeout(function() {
42 shouldBe("getBackgroundColor(shadowRootWithKeyframe.getElementById('box'))", '"rgb(0, 0, 255)"'); 42 shouldBe("getBackgroundColor(shadowRootWithKeyframe.getElementById('box'))", '"rgb(0, 0, 255)"');
43 shouldBe("getBackgroundColor(shadowRootWithoutKeyframe.getElementById('box') )", '"rgb(255, 0, 0)"'); 43 shouldBe("getBackgroundColor(shadowRootWithoutKeyframe.getElementById('box') )", '"rgb(255, 0, 0)"');
44 if (window.testRunner) 44 if (window.testRunner)
45 testRunner.notifyDone(); 45 testRunner.notifyDone();
46 }, 1000); 46 }, 1000);
47 </script> 47 </script>
48 </body> 48 </body>
49 </html> 49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698