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

Unified Diff: samples/third_party/dromaeo/tests/dom-traverse-html.dart

Issue 9732019: dart:html perf optimization based on runing Dromaeo benchmarks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: samples/third_party/dromaeo/tests/dom-traverse-html.dart
diff --git a/samples/third_party/dromaeo/tests/dom-traverse-html.dart b/samples/third_party/dromaeo/tests/dom-traverse-html.dart
index a8d324a85af61ed50d2f478fd3681d1fa0ccf343..c72e9d574da463b9c1e4a5af041a33c7d9dd792f 100644
--- a/samples/third_party/dromaeo/tests/dom-traverse-html.dart
+++ b/samples/third_party/dromaeo/tests/dom-traverse-html.dart
@@ -1,8 +1,8 @@
-#library("dom_traverse_html");
+#library("dom_traverse");
#import("dart:html");
#import('../common/common.dart');
-#source("Common.dart");
-#source("RunnerSuite.dart");
+#import('runner.dart');
+
void main() {
final int num = 40;
@@ -27,7 +27,7 @@ void main() {
final div = new Element.tag('div');
div.innerHTML = html;
- document.body.nodes.add(div);
+ document.body.appendChild(div);
})
.test('firstChild', () {
final nodes = document.body.nodes;
@@ -37,7 +37,7 @@ void main() {
for (int j = 0; j < nl; j++) {
Node cur = nodes[j];
while (cur !== null) {
- cur = cur.nodes.first;
+ cur = cur.$dom_firstChild;
}
ret = cur;
}
@@ -51,7 +51,7 @@ void main() {
for (int j = 0; j < nl; j++) {
Node cur = nodes[j];
while (cur !== null) {
- cur = cur.nodes.last();
+ cur = cur.$dom_lastChild;
}
ret = cur;
}
@@ -59,7 +59,7 @@ void main() {
})
.test('nextSibling', () {
for (int i = 0; i < num * 2; i++) {
- Node cur = document.body.nodes.first;
+ Node cur = document.body.$dom_firstChild;
while (cur !== null) {
cur = cur.nextNode;
}
@@ -68,7 +68,7 @@ void main() {
})
.test('previousSibling', () {
for (int i = 0; i < num * 2; i++) {
- Node cur = document.body.nodes.last();
+ Node cur = document.body.$dom_lastChild;
while (cur !== null) {
cur = cur.previousNode;
}

Powered by Google App Engine
This is Rietveld 408576698