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

Side by Side Diff: PerformanceTests/DOM/TraverseChildNodes.html

Issue 478003002: Fill in descriptions on relevant blink_perf tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: alancutter nits Created 6 years, 2 months 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 <body> 3 <body>
4 <script src="../resources/runner.js"></script> 4 <script src="../resources/runner.js"></script>
5 <script> 5 <script>
6 var spec = PerfTestRunner.loadFile("../Parser/resources/html5.html"); 6 var spec = PerfTestRunner.loadFile("../Parser/resources/html5.html");
7 var iframe; 7 var iframe;
8 8
9 PerfTestRunner.measureTime({ 9 PerfTestRunner.measureTime({
10 description: "Measures performance of traversing through a large HTML docume nt using elem.childNodes.",
10 setup: function () { 11 setup: function () {
11 if (iframe) 12 if (iframe)
12 document.body.removeChild(iframe); 13 document.body.removeChild(iframe);
13 iframe = document.createElement("iframe"); 14 iframe = document.createElement("iframe");
14 iframe.style.display = "none"; // Prevent creation of the rendering tre e, so we only test HTML parsing. 15 iframe.style.display = "none"; // Prevent creation of the rendering tre e, so we only test HTML parsing.
15 iframe.sandbox = ''; // Prevent external script loads which could cause write() to return before completing the parse. 16 iframe.sandbox = ''; // Prevent external script loads which could cause write() to return before completing the parse.
16 document.body.appendChild(iframe); 17 document.body.appendChild(iframe);
17 iframe.contentDocument.open(); 18 iframe.contentDocument.open();
18 iframe.contentDocument.write(spec); 19 iframe.contentDocument.write(spec);
19 iframe.contentDocument.close(); 20 iframe.contentDocument.close();
20 }, 21 },
21 run: function() { 22 run: function() {
22 var elements = iframe.contentDocument.getElementsByTagName('*'); 23 var elements = iframe.contentDocument.getElementsByTagName('*');
23 for (var i = 0; i < elements.length; i++) { 24 for (var i = 0; i < elements.length; i++) {
24 for (var j = 0; j < elements[i].childNodes.length; j++) 25 for (var j = 0; j < elements[i].childNodes.length; j++)
25 elements[i].childNodes[j]; 26 elements[i].childNodes[j];
26 } 27 }
27 }, 28 },
28 done: function () { document.body.removeChild(iframe); }}); 29 done: function () { document.body.removeChild(iframe); }});
29 30
30 </script> 31 </script>
31 </body> 32 </body>
32 </html> 33 </html>
OLDNEW
« no previous file with comments | « PerformanceTests/Canvas/drawimage-not-pixelaligned.html ('k') | PerformanceTests/DOM/modify-element-classname.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698