OLD | NEW |
1 #library("dom-traverse.dart"); | 1 #library("dom-traverse.dart"); |
2 #import("dart:dom"); | 2 #import("dart:dom"); |
3 #import('../../common/common.dart'); | 3 #import('../common/common.dart'); |
4 #import('runner.dart'); | 4 #import('runner.dart'); |
5 | 5 |
6 | 6 |
7 void main() { | 7 void main() { |
8 final int num = 40; | 8 final int num = 40; |
9 | 9 |
10 // Try to force real results. | 10 // Try to force real results. |
11 var ret; | 11 var ret; |
12 | 12 |
13 String html = document.body.innerHTML; | 13 String html = document.body.innerHTML; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 for (int i = 0; i < num * 2; i++) { | 61 for (int i = 0; i < num * 2; i++) { |
62 Node cur = document.body.firstChild; | 62 Node cur = document.body.firstChild; |
63 while (cur !== null) { | 63 while (cur !== null) { |
64 cur = cur.nextSibling; | 64 cur = cur.nextSibling; |
65 } | 65 } |
66 ret = cur; | 66 ret = cur; |
67 } | 67 } |
68 }) | 68 }) |
69 .test('previousSibling', () { | 69 .test('previousSibling', () { |
70 for (int i = 0; i < num * 2; i++) { | 70 for (int i = 0; i < num * 2; i++) { |
71 Node cur = document.body.firstChild; | 71 Node cur = document.body.lastChild; |
72 while (cur !== null) { | 72 while (cur !== null) { |
73 cur = cur.previousSibling; | 73 cur = cur.previousSibling; |
74 } | 74 } |
75 ret = cur; | 75 ret = cur; |
76 } | 76 } |
77 }) | 77 }) |
78 .test('childNodes', () { | 78 .test('childNodes', () { |
79 for (int i = 0; i < num; i++) { | 79 for (int i = 0; i < num; i++) { |
80 final nodes = document.body.childNodes; | 80 final nodes = document.body.childNodes; |
81 for (int j = 0; j < nodes.length; j++) { | 81 for (int j = 0; j < nodes.length; j++) { |
82 ret = nodes[j]; | 82 ret = nodes[j]; |
83 } | 83 } |
84 } | 84 } |
85 }) | 85 }) |
86 .end(); | 86 .end(); |
87 } | 87 } |
OLD | NEW |