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

Side by Side Diff: sky/benchmarks/layout/simple-blocks.sky

Issue 879733002: Replace createTextNode with new Text(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/benchmarks/dom/creation.sky ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <sky> 1 <sky>
2 <import src="../resources/runner.sky" as="PerfRunner" /> 2 <import src="../resources/runner.sky" as="PerfRunner" />
3 <style> 3 <style>
4 div { 4 div {
5 height: 10px; 5 height: 10px;
6 } 6 }
7 span { 7 span {
8 display: inline; 8 display: inline;
9 } 9 }
10 </style> 10 </style>
11 <div id='content'></div> 11 <div id='content'></div>
12 <script> 12 <script>
13 var content = document.getElementById('content'); 13 var content = document.getElementById('content');
14 14
15 var out = []; 15 var out = [];
16 for (var i = 0; i < 1000; i++) { 16 for (var i = 0; i < 1000; i++) {
17 var div = document.createElement('div'); 17 var div = document.createElement('div');
18 div.appendChild(document.createElement('span')).appendChild(document.createTex tNode('foo')); 18 div.appendChild(document.createElement('span')).appendChild(new Text('foo'));
19 div.appendChild(document.createTextNode(' ')); 19 div.appendChild(new Text(' '));
20 div.appendChild(document.createElement('span')).appendChild(document.createTex tNode('bar')); 20 div.appendChild(document.createElement('span')).appendChild(new Text('bar'));
21 content.appendChild(div); 21 content.appendChild(div);
22 } 22 }
23 23
24 var b = document.querySelector('sky'); 24 var b = document.querySelector('sky');
25 25
26 var runner = new PerfRunner({ 26 var runner = new PerfRunner({
27 setup: function() { 27 setup: function() {
28 b.style.width = '210px'; 28 b.style.width = '210px';
29 getComputedStyle(b).color; 29 getComputedStyle(b).color;
30 b.offsetHeight; 30 b.offsetHeight;
31 31
32 b.style.width = '200px'; 32 b.style.width = '200px';
33 getComputedStyle(b).color; 33 getComputedStyle(b).color;
34 }, 34 },
35 iterations: 10, 35 iterations: 10,
36 unit: 'ms', 36 unit: 'ms',
37 }); 37 });
38 38
39 runner.runAsync(function(done) { 39 runner.runAsync(function(done) {
40 b.offsetHeight; 40 b.offsetHeight;
41 done(); 41 done();
42 }); 42 });
43 </script> 43 </script>
44 </sky> 44 </sky>
OLDNEW
« no previous file with comments | « sky/benchmarks/dom/creation.sky ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698