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

Side by Side Diff: LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2.html

Issue 18732004: Add fast path for querySelector(All) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!doctype html>
haraken 2013/07/08 06:13:16 You can simplify the test by using js-test-pre.js
tasak 2013/07/08 09:46:18 Done.
2 <html>
3 <body>
4 <div id="test">
5 <div></div>
6 <div>
7 <div class="target"></div>
8 </div>
9 <div>
10 <div class="target"></div>
11 <div></div>
12 </div>
13 <div id="test2" class="target">line 4</div>
14 <div id="test3"></div>
15 <p>line 5</p>
16 </div>
17
18 <pre id="console"></pre>
19
20 <script>
21 if (window.testRunner)
22 testRunner.dumpAsText();
haraken 2013/07/08 06:13:16 This isn't needed.
tasak 2013/07/08 09:46:18 Done.
23
24 function log(message)
haraken 2013/07/08 06:13:16 Ditto.
tasak 2013/07/08 09:46:18 Done.
25 {
26 document.getElementById('console').appendChild(document.createTextNode(m essage + "\n"));
27 }
28
29 Element.prototype.dump = function()
30 {
31 return this;
32 }
33
34 NodeList.prototype.dump = function()
35 {
36 var result = "";
37 var length = this.length;
38 for (var i = 0; i < length; i++)
39 result += this[i] + ", ";
40 result += "length: " + length;
41 return result;
42 }
43
44 testQuerySelectorAll = function(node, selectorString)
45 {
46 try {
47 log(node.querySelectorAll(selectorString).dump());
48 } catch (e) {
49 log(e);
50 }
51 }
52
53 log("Document.querySelectorAll");
54 log("");
55
56 testQuerySelectorAll(document, ".target + div");
57
58 log("");
59 log("Element.querySelectorAll");
60 log("");
61
62 testQuerySelectorAll(document.getElementById('test'), ".target + div");
63 testQuerySelectorAll(document.getElementById('test2'), ".target + div");
64 testQuerySelectorAll(document.getElementById('test3'), ".target + div");
65
66 </script>
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2-expected.txt » ('j') | Source/core/dom/SelectorQuery.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698