| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/runner.js"></script> | 4 <script src="../resources/runner.js"></script> |
| 5 <style> | 5 <style> |
| 6 .root .child {} | 6 .root .child {} |
| 7 </style> | 7 </style> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="root"></div> | 10 <div id="root"></div> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 for (var i = 0 ; i < numRules; i++) { | 36 for (var i = 0 ; i < numRules; i++) { |
| 37 arr[i] = cssStrWithClassSelectors(i); | 37 arr[i] = cssStrWithClassSelectors(i); |
| 38 } | 38 } |
| 39 for (var i = 0 ; i < numRules; i++) { | 39 for (var i = 0 ; i < numRules; i++) { |
| 40 arr[numRules + i] = cssStrWithAttributeSelectors(i); | 40 arr[numRules + i] = cssStrWithAttributeSelectors(i); |
| 41 } | 41 } |
| 42 var styleElement = insertStyleSheet(arr.join(' ')); | 42 var styleElement = insertStyleSheet(arr.join(' ')); |
| 43 | 43 |
| 44 // Force style recalc. | 44 // Force style recalc. |
| 45 document.body.offsetTop; | 45 document.body.offsetTop; |
| 46 | 46 |
| 47 styleElement.parentNode.removeChild(styleElement); | 47 styleElement.parentNode.removeChild(styleElement); |
| 48 } | 48 } |
| 49 | 49 |
| 50 PerfTestRunner.measureRunsPerSecond({run: runFunction}); | 50 PerfTestRunner.measureRunsPerSecond({ |
| 51 description: "Measures performance of inserting a stylesheet of 2000 differe
nt CSS rules, each of which is duplicated 7 times to test duplicate rule optimiz
ations.", |
| 52 run: runFunction |
| 53 }); |
| 51 | 54 |
| 52 </script> | 55 </script> |
| 53 </body> | 56 </body> |
| 54 </html> | 57 </html> |
| OLD | NEW |