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

Unified Diff: samples/third_party/dromaeo/tests/dom-modify-htmlfast.html

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: Respond to code review comments 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-modify-htmlfast.html
diff --git a/samples/third_party/dromaeo/tests/dom-query.html b/samples/third_party/dromaeo/tests/dom-modify-htmlfast.html
similarity index 96%
copy from samples/third_party/dromaeo/tests/dom-query.html
copy to samples/third_party/dromaeo/tests/dom-modify-htmlfast.html
index bc1d9098a26a295d826e2cbd644f395aa085f298..5849d173b26ce78fd5f2168df643aa7ef726a1c0 100644
--- a/samples/third_party/dromaeo/tests/dom-query.html
+++ b/samples/third_party/dromaeo/tests/dom-modify-htmlfast.html
@@ -1,107 +1,7 @@
<html>
<head>
-<script src="../htmlrunner.js"></script>
-<script>
-window.onload = function(){
-startTest("dom-query");
-
-// Try to force real results
-var ret, tmp;
-var num = 40;
-var html = document.body.innerHTML;
-
- prep(function(){
- html = html.replace(/id="test(\w).*?"/g, 'id="test$1' + num + '"');
- html = html.replace(/name="test.*?"/g, 'name="test' + num + '"');
- html = html.replace(/class="foo.*?"/g, 'class="foo test' + num + ' bar"');
- var div = document.createElement("div");
- div.innerHTML = html;
- document.body.appendChild( div );
- });
-
- test( "getElementById", function(){
- for ( var i = 0; i < num * 30; i++ ) {
- ret = document.getElementById("testA" + num).nodeType;
- ret = document.getElementById("testB" + num).nodeType;
- ret = document.getElementById("testC" + num).nodeType;
- ret = document.getElementById("testD" + num).nodeType;
- ret = document.getElementById("testE" + num).nodeType;
- ret = document.getElementById("testF" + num).nodeType;
- }
- });
-
- test( "getElementById (not in document)", function(){
- for ( var i = 0; i < num * 30; i++ ) {
- ret = document.getElementById("testA");
- ret = document.getElementById("testB");
- ret = document.getElementById("testC");
- ret = document.getElementById("testD");
- ret = document.getElementById("testE");
- ret = document.getElementById("testF");
- }
- });
-
- test( "getElementsByTagName(div)", function(){
- for ( var i = 0; i < num; i++ ) {
- var elems = document.getElementsByTagName("div");
- ret = elems[elems.length-1].nodeType;
- }
- });
-
- test( "getElementsByTagName(p)", function(){
- for ( var i = 0; i < num; i++ ) {
- var elems = document.getElementsByTagName("p");
- ret = elems[elems.length-1].nodeType;
- }
- });
-
- test( "getElementsByTagName(a)", function(){
- for ( var i = 0; i < num; i++ ) {
- var elems = document.getElementsByTagName("a");
- ret = elems[elems.length-1].nodeType;
- }
- });
-
- test( "getElementsByTagName(*)", function(){
- for ( var i = 0; i < num; i++ ) {
- var elems = document.getElementsByTagName("*");
- ret = elems[elems.length-1].nodeType;
- }
- });
-
- test( "getElementsByTagName (not in document)", function(){
- for ( var i = 0; i < num; i++ ) {
- var elems = document.getElementsByTagName("strong");
- ret = elems.length == 0;
- }
- });
-
- test( "getElementsByName", function(){
- for ( var i = 0; i < num * 20; i++ ) {
- var elems = document.getElementsByName("test" + num);
- ret = elems[elems.length-1].nodeType;
- var elems = document.getElementsByName("test" + num);
- ret = elems[elems.length-1].nodeType;
- var elems = document.getElementsByName("test" + num);
- ret = elems[elems.length-1].nodeType;
- var elems = document.getElementsByName("test" + num);
- ret = elems[elems.length-1].nodeType;
- }
- });
-
- test( "getElementsByName (not in document)", function(){
- for ( var i = 0; i < num * 20; i++ ) {
- ret = document.getElementsByName("test").length == 0;
- ret = document.getElementsByName("test").length == 0;
- ret = document.getElementsByName("test").length == 0;
- ret = document.getElementsByName("test").length == 0;
- ret = document.getElementsByName("test").length == 0;
- }
- });
-
-endTest();
-};
-</script>
+<script type="application/dart" src="dom-modify-htmlfast.dart"></script>
+<script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
</head>
<body>
<div class="head">
@@ -248,7 +148,7 @@ endTest();
<div class="subtoc">
- <h2 id="testF10"><a name=contents>Table of contents</a></h2>
+ <h2 id="test1"><a name=contents>Table of contents</a></h2>
<ul class="toc">
<li class="tocline2"><a href="#context">1. Introduction</a>
@@ -339,7 +239,7 @@ endTest();
</div>
- <h2 id="testA10"><a name=context>1. Introduction</a></h2>
+ <h2><a name=context>1. Introduction</a></h2>
<h3><a name=dependencies></a>1.1. Dependencies</h3>
@@ -394,7 +294,7 @@ endTest();
</ul>
-<h2 id="testB10"><a name=selectors></a>2. Selectors</h2>
+<h2><a name=selectors></a>2. Selectors</h2>
<p><em>This section is non-normative, as it merely summarizes the
following sections.</em></p>
@@ -708,14 +608,14 @@ representations.</p>
prepending "matches" to the contents of each cell in the "Meaning"
column.</p>
-<h2 id="testC10"><a name=casesens>3. Case sensitivity</a></h2>
+<h2><a name=casesens>3. Case sensitivity</a></h2>
<p>The case sensitivity of document language element names, attribute
names, and attribute values in selectors depends on the document
language. For example, in HTML, element names are case-insensitive,
but in XML, they are case-sensitive.</p>
-<h2 id="testD10"><a name=selector-syntax>4. Selector syntax</a></h2>
+<h2><a name=selector-syntax>4. Selector syntax</a></h2>
<p>A <dfn><a name=selector>selector</a></dfn> is a chain of one
or more <a href="#sequence">sequences of simple selectors</a>
@@ -763,7 +663,7 @@ simple selectors.</p>
no pseudo-element, is an <a href="#Conformance">invalid
selector</a>.</p>
-<h2 id="testE10"><a name=grouping>5. Groups of selectors</a></h2>
+<h2><a name=grouping>5. Groups of selectors</a></h2>
<p>When several selectors share the same declarations, they may be
grouped into a comma-separated list. (A comma is U+002C.)</p>
@@ -2849,7 +2749,7 @@ matching it. </div>
<td>some selectors and combinators are not allowed in fragment
descriptions on the right side of STTS declarations.</td></tr></tbody></table>
<form>
-<input type="text" name="test10"/>
+<input type="text" name="test1"/>
<input type="text" name="foo"/>
<input type="text" name="foo"/>
<input type="text" name="foo"/>
@@ -2909,7 +2809,7 @@ which is not allowed at the current parsing point.
<li>a group of selectors containing an invalid selector is invalid.</li>
</ul>
-<p class="foo test10 bar">Specifications reusing Selectors must define how to handle parsing
+<p class="foo test1 bar">Specifications reusing Selectors must define how to handle parsing
errors. (In the case of CSS, the entire rule in which the selector is
used is dropped.)</p>

Powered by Google App Engine
This is Rietveld 408576698