| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <body> | 2 <body> |
| 3 <script src="../resources/runner.js"></script> | 3 <script src="../resources/runner.js"></script> |
| 4 <script> | 4 <script> |
| 5 var spec = PerfTestRunner.loadFile("resources/html5.html"); | 5 var spec = PerfTestRunner.loadFile("resources/html5.html"); |
| 6 | 6 |
| 7 PerfTestRunner.measureTime({run: function() { | 7 PerfTestRunner.measureTime({ |
| 8 var iframe = document.createElement("iframe"); | 8 description: "Measures performance of the HTML parser.", |
| 9 iframe.style.display = "none"; // Prevent creation of the rendering tree, s
o we only test HTML parsing. | 9 run: function() { |
| 10 iframe.sandbox = 'allow-same-origin'; // Prevent external script loads whic
h could cause write() to return before completing the parse. | 10 var iframe = document.createElement("iframe"); |
| 11 document.body.appendChild(iframe); | 11 iframe.style.display = "none"; // Prevent creation of the rendering tre
e, so we only test HTML parsing. |
| 12 iframe.contentDocument.open(); | 12 iframe.sandbox = 'allow-same-origin'; // Prevent external script loads
which could cause write() to return before completing the parse. |
| 13 iframe.contentDocument.write(spec); | 13 document.body.appendChild(iframe); |
| 14 iframe.contentDocument.close(); | 14 iframe.contentDocument.open(); |
| 15 document.body.removeChild(iframe); | 15 iframe.contentDocument.write(spec); |
| 16 }}); | 16 iframe.contentDocument.close(); |
| 17 document.body.removeChild(iframe); |
| 18 } |
| 19 }); |
| 17 | 20 |
| 18 </script> | 21 </script> |
| 19 </body> | 22 </body> |
| OLD | NEW |