Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 2 "http://www.w3.org/TR/html4/loose.dtd"> | 2 "http://www.w3.org/TR/html4/loose.dtd"> |
| 3 | 3 |
| 4 <html lang="en"> | 4 <html lang="en"> |
| 5 <head> | 5 <head> |
| 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 7 <title>Test Changing Name of A Keyframes Rule Using CSSOM</title> | 7 <title>Test Changing Name of A Keyframes Rule Using CSSOM</title> |
| 8 <style type="text/css" media="screen"> | 8 <style type="text/css" media="screen"> |
| 9 #box { | 9 #box { |
| 10 position: relative; | 10 position: relative; |
| 11 left: 0; | 11 left: 0; |
| 12 top: 0; | 12 top: 0; |
| 13 height: 100px; | 13 height: 100px; |
| 14 width: 100px; | 14 width: 100px; |
| 15 background-color: blue; | 15 background-color: blue; |
| 16 -webkit-animation-duration: 0.5s; | 16 -webkit-animation-duration: 0.5s; |
|
suzyh_UTC10 (ex-contributor)
2017/01/04 23:29:49
Update to not use the prefixed properties?
| |
| 17 -webkit-animation-timing-function: linear; | 17 -webkit-animation-timing-function: linear; |
| 18 -webkit-animation-name: bar; | 18 -webkit-animation-name: bar; |
| 19 } | 19 } |
| 20 @-webkit-keyframes foo { | 20 @-webkit-keyframes foo { |
| 21 from { left: 100px; } | 21 from { left: 100px; } |
| 22 40% { left: 200px; } | 22 10% { left: 200px; } |
| 23 60% { left: 200px; } | 23 90% { left: 200px; } |
| 24 to { left: 300px; } | 24 to { left: 300px; } |
| 25 } | 25 } |
| 26 </style> | 26 </style> |
| 27 <script src="resources/animation-test-helpers.js" type="text/javascript" cha rset="utf-8"></script> | 27 <script src="resources/animation-test-helpers.js" type="text/javascript" cha rset="utf-8"></script> |
| 28 <script type="text/javascript" charset="utf-8"> | 28 <script type="text/javascript" charset="utf-8"> |
| 29 | 29 |
| 30 const expectedValues = [ | 30 const expectedValues = [ |
| 31 // [time, element-id, property, expected-value, tolerance] | 31 // [time, element-id, property, expected-value, tolerance] |
| 32 [0.25, "box", "left", 200, 20], | 32 [0.25, "box", "left", 200, 0], |
|
suzyh_UTC10 (ex-contributor)
2017/01/04 23:29:49
To make this "0.25" time easier to understand, let
| |
| 33 ]; | 33 ]; |
| 34 | 34 |
| 35 function findKeyframesRule(rule) | 35 function findKeyframesRule(rule) |
| 36 { | 36 { |
| 37 var ss = document.styleSheets; | 37 var ss = document.styleSheets; |
| 38 for (var i = 0; i < ss.length; ++i) { | 38 for (var i = 0; i < ss.length; ++i) { |
| 39 for (var j = 0; j < ss[i].cssRules.length; ++j) { | 39 for (var j = 0; j < ss[i].cssRules.length; ++j) { |
| 40 if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RU LE && ss[i].cssRules[j].name == rule) | 40 if (ss[i].cssRules[j].type == window.CSSRule.WEBKIT_KEYFRAMES_RU LE && ss[i].cssRules[j].name == rule) |
| 41 return ss[i].cssRules[j]; | 41 return ss[i].cssRules[j]; |
| 42 } | 42 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 62 testRunner.waitUntilDone(); | 62 testRunner.waitUntilDone(); |
| 63 } | 63 } |
| 64 requestAnimationFrame(() => { | 64 requestAnimationFrame(() => { |
| 65 requestAnimationFrame(change); | 65 requestAnimationFrame(change); |
| 66 }); | 66 }); |
| 67 } | 67 } |
| 68 | 68 |
| 69 </script> | 69 </script> |
| 70 </head> | 70 </head> |
| 71 <body onload="setup()"> | 71 <body onload="setup()"> |
| 72 This test changes the name of the @keyframes rule so that it matches | 72 This test changes the name of the @keyframes rule so that it matches |
|
suzyh_UTC10 (ex-contributor)
2017/01/04 23:29:49
For clarity of reading can you please indent every
| |
| 73 and makes sure the animation starts running. | 73 and makes sure the animation starts running. |
| 74 <div id="box"> | 74 <div id="box"> |
| 75 </div> | 75 </div> |
| 76 <div id="pre-result"> | 76 <div id="pre-result"> |
|
suzyh_UTC10 (ex-contributor)
2017/01/04 23:29:49
Unused?
| |
| 77 </div> | 77 </div> |
| 78 <div id="result"> | 78 <div id="result"> |
| 79 </div> | 79 </div> |
| 80 </body> | 80 </body> |
| 81 </html> | 81 </html> |
| OLD | NEW |