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

Side by Side Diff: samples/third_party/dromaeo/tests/dom-traverse-htmlidiomatic.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 #library("dom_traverse_html"); 1 #library("dom_traverse_html");
2 #import("dart:html"); 2 #import("dart:html");
3 #import('../common/common.dart'); 3 #import('../common/common.dart');
4 #import("dart:math", prefix: "Math"); 4 #import("dart:math", prefix: "Math");
5 #source("Common.dart"); 5 #source("Common.dart");
6 #source("RunnerSuite.dart"); 6 #source("RunnerSuite.dart");
7 7
8 void main() { 8 void main() {
9 final int num = 40; 9 final int num = 40;
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 }) 46 })
47 .test('lastChild', () { 47 .test('lastChild', () {
48 final nodes = document.body.nodes; 48 final nodes = document.body.nodes;
49 final nl = nodes.length; 49 final nl = nodes.length;
50 50
51 for (int i = 0; i < num; i++) { 51 for (int i = 0; i < num; i++) {
52 for (int j = 0; j < nl; j++) { 52 for (int j = 0; j < nl; j++) {
53 Node cur = nodes[j]; 53 Node cur = nodes[j];
54 while (cur !== null) { 54 while (cur !== null) {
55 cur = cur.nodes.last(); 55 cur = cur.nodes.last;
56 } 56 }
57 ret = cur; 57 ret = cur;
58 } 58 }
59 } 59 }
60 }) 60 })
61 .test('nextSibling', () { 61 .test('nextSibling', () {
62 for (int i = 0; i < num * 2; i++) { 62 for (int i = 0; i < num * 2; i++) {
63 Node cur = document.body.nodes.first; 63 Node cur = document.body.nodes.first;
64 while (cur !== null) { 64 while (cur !== null) {
65 cur = cur.nextNode; 65 cur = cur.nextNode;
66 } 66 }
67 ret = cur; 67 ret = cur;
68 } 68 }
69 }) 69 })
70 .test('previousSibling', () { 70 .test('previousSibling', () {
71 for (int i = 0; i < num * 2; i++) { 71 for (int i = 0; i < num * 2; i++) {
72 Node cur = document.body.nodes.last(); 72 Node cur = document.body.nodes.last;
73 while (cur !== null) { 73 while (cur !== null) {
74 cur = cur.previousNode; 74 cur = cur.previousNode;
75 } 75 }
76 ret = cur; 76 ret = cur;
77 } 77 }
78 }) 78 })
79 .test('childNodes', () { 79 .test('childNodes', () {
80 for (int i = 0; i < num; i++) { 80 for (int i = 0; i < num; i++) {
81 final nodes = document.body.nodes; 81 final nodes = document.body.nodes;
82 for (int j = 0; j < nodes.length; j++) { 82 for (int j = 0; j < nodes.length; j++) {
83 ret = nodes[j]; 83 ret = nodes[j];
84 } 84 }
85 } 85 }
86 }) 86 })
87 .end(); 87 .end();
88 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698