Index: LayoutTests/fast/selectors/query-update-distribution.html |
diff --git a/LayoutTests/fast/selectors/query-update-distribution.html b/LayoutTests/fast/selectors/query-update-distribution.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ed40f4732f8dc64a43d867d9437773ceaae912b0 |
--- /dev/null |
+++ b/LayoutTests/fast/selectors/query-update-distribution.html |
@@ -0,0 +1,31 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"></script> |
+ |
+<div id="target"> |
+ <div id="a"> |
+ <div id="b"></div> |
+ </div> |
+</div> |
+ |
+<script> |
+description("Should update distribution when needed for querySelector and related methods."); |
+ |
+var target = document.getElementById("target"); |
+var a = document.getElementById("a"); |
+ |
+var targetRoot = target.createShadowRoot(); |
+targetRoot.innerHTML = "<div id=c><content></content></div>"; |
+var c = targetRoot.getElementById("c"); |
+ |
+var aRoot = a.createShadowRoot(); |
+aRoot.innerHTML = "<div id=d></div>"; |
+var d = aRoot.getElementById("d"); |
+ |
+shouldBe("aRoot.querySelector(':host-context(#c) #d')", "d"); |
+// This does actually match #a, but it's in the wrong scope. |
+shouldBeNull("targetRoot.querySelector('::content #a')"); |
+shouldBeFalse("a.matches('::content #a')"); |
+shouldBeTrue("d.matches(':host-context(#target) #d')"); |
+shouldBeTrue("d.matches(':host-context(#c) #d')"); |
+shouldBeNull("b.closest('::content #a')"); |
kochi
2015/05/25 11:07:04
Hopefully, we have 3 separate cases,
1. createSha
esprehn
2015/05/25 20:52:26
Updated the test to dirty between each test and ad
|
+</script> |