| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 Smoke test for CSS style array index getter and setter. Passes if no crash. |
| 3 <head> | |
| 4 <script src="../resources/runner.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <div id="test"></div> | 3 <div id="test"></div> |
| 8 </body> | |
| 9 <script> | 4 <script> |
| 10 var div = document.getElementById("test"); | 5 var div = document.getElementById("test"); |
| 11 var properties = { | 6 var properties = { |
| 12 'azimuth' : 'right', | 7 'azimuth' : 'right', |
| 13 'backgroundColor' : 'green', | 8 'backgroundColor' : 'green', |
| 14 'backgroundImage' : 'url(\'test.png\')', | 9 'backgroundImage' : 'url(\'test.png\')', |
| 15 'backgroundPosition' : 'top', | 10 'backgroundPosition' : 'top', |
| 16 'backgroundRepeat' : 'repeat-x', | 11 'backgroundRepeat' : 'repeat-x', |
| 17 'background' : '#ffffff url(\'img_tree.png\') no-repeat right top', | 12 'background' : '#ffffff url(\'img_tree.png\') no-repeat right top', |
| 18 'border' : '20px dotted red', | 13 'border' : '20px dotted red', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 'textAlign' : 'center', | 59 'textAlign' : 'center', |
| 65 'textDecoration' : 'blink', | 60 'textDecoration' : 'blink', |
| 66 'textTransform' : 'capitalize', | 61 'textTransform' : 'capitalize', |
| 67 'top' : '25%', | 62 'top' : '25%', |
| 68 'verticalAlign' : 'text-bottom', | 63 'verticalAlign' : 'text-bottom', |
| 69 'visibility' : 'visible', | 64 'visibility' : 'visible', |
| 70 'width' : '300px', | 65 'width' : '300px', |
| 71 'webkitTransform' : 'scale3d(0.5, 0.5, 0.5)', | 66 'webkitTransform' : 'scale3d(0.5, 0.5, 0.5)', |
| 72 'wordSpacing' : '40px', | 67 'wordSpacing' : '40px', |
| 73 }; | 68 }; |
| 74 // The first run will just add the properties but it's fine as the first run of
the benchmark is always ignored. | 69 |
| 75 PerfTestRunner.measureRunsPerSecond({ | 70 if (window.testRunner) |
| 76 description: "Measures performance of the CSS style array index setter (elem
.style[a] = b).", | 71 testRunner.dumpAsText(); |
| 77 run:function() { | 72 |
| 78 for (key in properties) | 73 for (key in properties) { |
| 79 div.style[key] = properties[key]; | 74 var value = div.style[key]; |
| 80 } | 75 div.style[key] = properties[key]; |
| 81 }); | 76 } |
| 77 |
| 78 document.body.offsetHeight; |
| 79 |
| 80 for (key in properties) { |
| 81 var value = div.style[key]; |
| 82 div.style[key] = ''; |
| 83 } |
| 84 |
| 85 document.body.offsetHeight; |
| 86 |
| 87 for (key in properties) { |
| 88 var value = div.style[key]; |
| 89 div.style[key] = properties[key]; |
| 90 } |
| 82 </script> | 91 </script> |
| 83 </html> | |
| OLD | NEW |