OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/js-test.js"></script> | |
3 | |
4 <div id="target"> | |
5 <div id="a"> | |
6 <div id="b"></div> | |
7 </div> | |
8 </div> | |
9 | |
10 <script> | |
11 description("Should update distribution when needed for querySelector and relate d methods."); | |
12 | |
13 var target = document.getElementById("target"); | |
14 var a = document.getElementById("a"); | |
15 | |
16 var targetRoot = target.createShadowRoot(); | |
17 targetRoot.innerHTML = "<div id=c><content></content></div>"; | |
18 var c = targetRoot.getElementById("c"); | |
19 | |
20 var aRoot = a.createShadowRoot(); | |
21 aRoot.innerHTML = "<div id=d></div>"; | |
22 var d = aRoot.getElementById("d"); | |
23 | |
24 shouldBe("aRoot.querySelector(':host-context(#c) #d')", "d"); | |
25 // This does actually match #a, but it's in the wrong scope. | |
26 shouldBeNull("targetRoot.querySelector('::content #a')"); | |
27 shouldBeFalse("a.matches('::content #a')"); | |
28 shouldBeTrue("d.matches(':host-context(#target) #d')"); | |
29 shouldBeTrue("d.matches(':host-context(#c) #d')"); | |
30 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
| |
31 </script> | |
OLD | NEW |