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

Side by Side Diff: third_party/WebKit/PerformanceTests/DOM/textarea-dom.html

Issue 1367923004: blink_perf.dom.textarea-dom: vary text nodes added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <style> 3 <style>
4 textarea:valid { 4 textarea:valid {
5 background-color: lime; 5 background-color: lime;
6 } 6 }
7 textarea:invalid { 7 textarea:invalid {
8 background-color: red; 8 background-color: red;
9 } 9 }
10 </style> 10 </style>
11 <script src="../resources/runner.js"></script> 11 <script src="../resources/runner.js"></script>
12 <textarea maxlength=2147483647 id="container"></textarea> 12 <textarea maxlength=2147483647 id="container"></textarea>
13 <script> 13 <script>
14 var container = document.getElementById('container'); 14 var container = document.getElementById('container');
15 var nodes = []; 15 var nodes = [];
16 var childCount = 1000; 16 var childCount = 1000;
17 // Vary the text nodes added, avoiding secondary effects of using identical stri ngs and allocation reuse.
17 for (var i = 0; i < childCount; ++i) 18 for (var i = 0; i < childCount; ++i)
18 nodes.push(document.createTextNode('A quick brown fox jumps over the lazy do g.\n')); 19 nodes.push(document.createTextNode('A quick brown fox jumps over the ' + i + 'th lazy dog.\n'));
19 20
20 PerfTestRunner.measureRunsPerSecond({ 21 PerfTestRunner.measureRunsPerSecond({
21 description: "Measures performance of adding text nodes to a textarea, then clearing it.", 22 description: "Measures performance of adding text nodes to a textarea, then clearing it.",
22 run: function() { 23 run: function() {
23 for (var i = 0; i < childCount; ++i) 24 for (var i = 0; i < childCount; ++i)
24 container.appendChild(nodes[i]); 25 container.appendChild(nodes[i]);
25 container.innerHTML = ''; 26 container.innerHTML = '';
26 } 27 }
27 }); 28 });
28 </script> 29 </script>
29 </body> 30 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698