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

Side by Side Diff: LayoutTests/fast/selectors/query-update-distribution.html

Issue 1153873004: Handle ::content and :host-context correctly in SelectorQuery. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No really, the right patch. Created 5 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698