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

Side by Side Diff: sky/benchmarks/dom/creation.sky

Issue 879733002: Replace createTextNode with new Text(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | sky/benchmarks/layout/simple-blocks.sky » ('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 <script> 3 <script>
4 var sky = document.querySelector("sky"); 4 var sky = document.querySelector("sky");
5 5
6 var widgets = 0; 6 var widgets = 0;
7 var basicElements = 0; 7 var basicElements = 0;
8 var texts = 0; 8 var texts = 0;
9 9
10 var WidgetPrototype = Object.create(HTMLElement.prototype); 10 var WidgetPrototype = Object.create(HTMLElement.prototype);
(...skipping 26 matching lines...) Expand all
37 prototype: WidgetPrototype, 37 prototype: WidgetPrototype,
38 }); 38 });
39 39
40 function createElement(tagName) { 40 function createElement(tagName) {
41 basicElements++; 41 basicElements++;
42 return document.createElement(tagName); 42 return document.createElement(tagName);
43 } 43 }
44 44
45 function createText(text) { 45 function createText(text) {
46 texts++; 46 texts++;
47 return document.createTextNode(text); 47 return new Text(text);
48 } 48 }
49 49
50 function createElements(root, depth) { 50 function createElements(root, depth) {
51 for (var i = 0; i < 4; i++) { 51 for (var i = 0; i < 4; i++) {
52 var div = createElement("div"); 52 var div = createElement("div");
53 var span1 = div.appendChild(createElement("span")); 53 var span1 = div.appendChild(createElement("span"));
54 span1.appendChild(createText("foo")); 54 span1.appendChild(createText("foo"));
55 span1.setAttribute("id", "span" + (i * depth)); 55 span1.setAttribute("id", "span" + (i * depth));
56 div.appendChild(createText(" ")); 56 div.appendChild(createText(" "));
57 div.setAttribute("class", "b" + i + " a" + i); 57 div.setAttribute("class", "b" + i + " a" + i);
(...skipping 27 matching lines...) Expand all
85 // console.log("widgets: " + widgets); 85 // console.log("widgets: " + widgets);
86 // console.log("basic elements: " + basicElements); 86 // console.log("basic elements: " + basicElements);
87 // console.log("texts: " + texts); 87 // console.log("texts: " + texts);
88 // CONSOLE: LOG: widgets: 340 88 // CONSOLE: LOG: widgets: 340
89 // CONSOLE: LOG: basic elements: 1021 89 // CONSOLE: LOG: basic elements: 1021
90 // CONSOLE: LOG: texts: 1020 90 // CONSOLE: LOG: texts: 1020
91 done(); 91 done();
92 }); 92 });
93 </script> 93 </script>
94 </sky> 94 </sky>
OLDNEW
« no previous file with comments | « no previous file | sky/benchmarks/layout/simple-blocks.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698