Chromium Code Reviews

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: Fixed review issues from sof Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
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