Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / selectors / query-update-distribution.html
bloba05684dd5fd0615fc9db735600b87372a5e64fd0
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
4 <div id="sandbox"></div>
6 <script>
7 description("Should update distribution when needed for querySelector and related methods.");
9 function test(fn)
11 var sandbox = document.getElementById("sandbox");
13 sandbox.innerHTML = "<div id=host><div id=a><div id=b></div></div>";
14 host = document.getElementById("host");
15 hostRoot = host.createShadowRoot();
16 hostRoot.innerHTML = "<div id=c><content></content></div>";
18 a = document.getElementById("a");
19 b = document.getElementById("b");
21 aRoot = a.createShadowRoot();
22 aRoot.innerHTML = "<div id=d><div id=e></div></div>";
24 c = hostRoot.getElementById("c");
25 d = aRoot.getElementById("d");
26 e = aRoot.getElementById("e");
28 sandbox.appendChild(host);
30 fn();
32 sandbox.innerHTML = "";
35 function toArray(list)
37 return Array.prototype.slice.call(list);
40 test(function() {
41 shouldBe("aRoot.querySelector(':host-context(#c) #d')", "d");
42 });
43 test(function() {
44 shouldBe("toArray(aRoot.querySelectorAll(':host-context(#c) #d'))", "[d]");
45 });
46 test(function() {
47 shouldBeNull("hostRoot.querySelector('::content #a')");
48 });
49 test(function() {
50 shouldBe("toArray(hostRoot.querySelectorAll('::content #a'))", "[]");
51 });
52 test(function() {
53 shouldBeFalse("a.matches('::content #a')");
54 });
55 test(function() {
56 shouldBeTrue("d.matches(':host-context(#host) #d')");
57 });
58 test(function() {
59 shouldBeTrue("d.matches(':host-context(#c) #d')");
60 });
61 test(function() {
62 shouldBeNull("b.closest('::content #a')");
63 });
64 test(function() {
65 shouldBe("e.closest(':host-context(#host) #d')", "d");
66 });
67 </script>