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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2.html
diff --git a/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2.html b/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2.html
new file mode 100644
index 0000000000000000000000000000000000000000..4f60e9776c9e30cfd0f660ad613fbf4837fd21af
--- /dev/null
+++ b/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2.html
@@ -0,0 +1,68 @@
+<!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.
+<html>
+<body>
+<div id="test">
+ <div></div>
+ <div>
+ <div class="target"></div>
+ </div>
+ <div>
+ <div class="target"></div>
+ <div></div>
+ </div>
+ <div id="test2" class="target">line 4</div>
+ <div id="test3"></div>
+ <p>line 5</p>
+</div>
+
+<pre id="console"></pre>
+
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
haraken 2013/07/08 06:13:16 This isn't needed.
tasak 2013/07/08 09:46:18 Done.
+
+ function log(message)
haraken 2013/07/08 06:13:16 Ditto.
tasak 2013/07/08 09:46:18 Done.
+ {
+ document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
+ }
+
+ Element.prototype.dump = function()
+ {
+ return this;
+ }
+
+ NodeList.prototype.dump = function()
+ {
+ var result = "";
+ var length = this.length;
+ for (var i = 0; i < length; i++)
+ result += this[i] + ", ";
+ result += "length: " + length;
+ return result;
+ }
+
+ testQuerySelectorAll = function(node, selectorString)
+ {
+ try {
+ log(node.querySelectorAll(selectorString).dump());
+ } catch (e) {
+ log(e);
+ }
+ }
+
+ log("Document.querySelectorAll");
+ log("");
+
+ testQuerySelectorAll(document, ".target + div");
+
+ log("");
+ log("Element.querySelectorAll");
+ log("");
+
+ testQuerySelectorAll(document.getElementById('test'), ".target + div");
+ testQuerySelectorAll(document.getElementById('test2'), ".target + div");
+ testQuerySelectorAll(document.getElementById('test3'), ".target + div");
+
+</script>
+</body>
+</html>
« 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