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

Unified Diff: client/dom/benchmarks/dromaeo/tests/dom-traverse.dart

Issue 8637013: Remove support for attribute event listeners. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/benchmarks/dromaeo/tests/dom-query.dart ('k') | client/dom/generated/monkey_dom.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/benchmarks/dromaeo/tests/dom-traverse.dart
diff --git a/client/dom/benchmarks/dromaeo/tests/dom-traverse.dart b/client/dom/benchmarks/dromaeo/tests/dom-traverse.dart
index 0814cc1bff958d9ced0e121cff80e86004af81e3..0d3cf2259e5ce594ec3654c40ef88989869bed34 100644
--- a/client/dom/benchmarks/dromaeo/tests/dom-traverse.dart
+++ b/client/dom/benchmarks/dromaeo/tests/dom-traverse.dart
@@ -9,80 +9,79 @@ void main() {
// Try to force real results.
var ret;
- window.onload = (Event evt) {
- String html = document.body.innerHTML;
- new Suite(window, 'dom-traverse')
- .prep(() {
- html = BenchUtil.replaceAll(html, 'id="test(\\w).*?"', (Match match) {
- final group = match.group(1);
- return 'id="test${group}${num}"';
- });
- html = BenchUtil.replaceAll(html, 'name="test.*?"', (Match match) {
- return 'name="test${num}"';
- });
- html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) {
- return 'class="foo test${num} bar"';
- });
+ String html = document.body.innerHTML;
- final div = document.createElement('div');
- div.innerHTML = html;
- document.body.appendChild(div);
- })
- .test('firstChild', () {
- final nodes = document.body.childNodes;
- final nl = nodes.length;
+ new Suite(window, 'dom-traverse')
+ .prep(() {
+ html = BenchUtil.replaceAll(html, 'id="test(\\w).*?"', (Match match) {
+ final group = match.group(1);
+ return 'id="test${group}${num}"';
+ });
+ html = BenchUtil.replaceAll(html, 'name="test.*?"', (Match match) {
+ return 'name="test${num}"';
+ });
+ html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) {
+ return 'class="foo test${num} bar"';
+ });
- for (int i = 0; i < num; i++) {
- for (int j = 0; j < nl; j++) {
- Node cur = nodes[j];
- while (cur !== null) {
- cur = cur.firstChild;
- }
- ret = cur;
- }
- }
- })
- .test('lastChild', () {
- final nodes = document.body.childNodes;
- final nl = nodes.length;
+ final div = document.createElement('div');
+ div.innerHTML = html;
+ document.body.appendChild(div);
+ })
+ .test('firstChild', () {
+ final nodes = document.body.childNodes;
+ final nl = nodes.length;
- for (int i = 0; i < num; i++) {
- for (int j = 0; j < nl; j++) {
- Node cur = nodes[j];
- while (cur !== null) {
- cur = cur.lastChild;
- }
- ret = cur;
- }
- }
- })
- .test('nextSibling', () {
- for (int i = 0; i < num * 2; i++) {
- Node cur = document.body.firstChild;
+ for (int i = 0; i < num; i++) {
+ for (int j = 0; j < nl; j++) {
+ Node cur = nodes[j];
while (cur !== null) {
- cur = cur.nextSibling;
+ cur = cur.firstChild;
}
ret = cur;
}
- })
- .test('previousSibling', () {
- for (int i = 0; i < num * 2; i++) {
- Node cur = document.body.firstChild;
+ }
+ })
+ .test('lastChild', () {
+ final nodes = document.body.childNodes;
+ final nl = nodes.length;
+
+ for (int i = 0; i < num; i++) {
+ for (int j = 0; j < nl; j++) {
+ Node cur = nodes[j];
while (cur !== null) {
- cur = cur.previousSibling;
+ cur = cur.lastChild;
}
ret = cur;
}
- })
- .test('childNodes', () {
- for (int i = 0; i < num; i++) {
- final nodes = document.body.childNodes;
- for (int j = 0; j < nodes.length; j++) {
- ret = nodes[j];
- }
+ }
+ })
+ .test('nextSibling', () {
+ for (int i = 0; i < num * 2; i++) {
+ Node cur = document.body.firstChild;
+ while (cur !== null) {
+ cur = cur.nextSibling;
+ }
+ ret = cur;
+ }
+ })
+ .test('previousSibling', () {
+ for (int i = 0; i < num * 2; i++) {
+ Node cur = document.body.firstChild;
+ while (cur !== null) {
+ cur = cur.previousSibling;
+ }
+ ret = cur;
+ }
+ })
+ .test('childNodes', () {
+ for (int i = 0; i < num; i++) {
+ final nodes = document.body.childNodes;
+ for (int j = 0; j < nodes.length; j++) {
+ ret = nodes[j];
}
- })
- .end();
- };
+ }
+ })
+ .end();
}
« no previous file with comments | « client/dom/benchmarks/dromaeo/tests/dom-query.dart ('k') | client/dom/generated/monkey_dom.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698