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

Unified Diff: LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth.html

Issue 1023393002: Cache element indices for :nth-child and :nth-last-child selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missing initializer and incorrect assert. Created 5 years, 8 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/loose-subtree-nth.html
diff --git a/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth.html b/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth.html
new file mode 100644
index 0000000000000000000000000000000000000000..cda7c1da73dc9a2a9f68e8e60806bc2b8e385c7f
--- /dev/null
+++ b/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script>
+description("Element.querySelector matching nth-child of loose subtree.");
+
+var root = document.createElement("div");
+for (var i = 0; i < 12; i++) {
+ var child = document.createElement("span");
+ if (i == 11)
+ child.id = "pass";
+ root.appendChild(child);
+}
+
+shouldBe('root.querySelector(":nth-child(12)").id', '"pass"');
+</script>

Powered by Google App Engine
This is Rietveld 408576698