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

Side by Side Diff: LayoutTests/fast/dom/shadow/shadowroot-host.html

Issue 42723004: ShadowRoot should have a host property. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/shadowroot-host-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <pre id="console"></div>
8 <script>
9 description('Tests ShadowRoot.host property');
10
11 function createRoots(host, n) {
12 var roots = [];
13 for (var i = 0; i < n; i++) {
14 roots.push(host.createShadowRoot());
15 }
16 return roots;
17 }
18
19 var host = document.createElement('table');
20 var root = host.createShadowRoot();
21 shouldBe('root.host', 'host');
22
23 // For elements which has UA shadow root.
24 host = document.createElement('details');
25 root = host.createShadowRoot();
26 shouldBe('root.host', 'host');
27
28 // Multiple shadow roots.
29 host = document.createElement('div');
30 document.body.appendChild(host);
31 roots = createRoots(host, 2);
32 shouldBe('roots[0].host', 'host');
33 shouldBe('roots[1].host', 'host');
34 host.remove();
35
36 // Out of document
37 host = document.createElement('div');
38 var roots = createRoots(host, 2);
39 shouldBe('roots[0].host', 'host');
40 shouldBe('roots[1].host', 'host');
41
42 // Out of document, in nested shadow, accessed out of order
43 host = document.createElement('span');
44 roots[1].appendChild(host);
45 roots = createRoots(host, 7);
46 shouldBe('roots[1].host', 'host');
47 shouldBe('roots[6].host', 'host');
48
49 // Cannot set property
50 host = document.createElement('span');
51 root = host.createShadowRoot();
52 var donor = document.createElement('div');
53 donor.createShadowRoot();
54 root.host = donor;
55 shouldBe('root.host', 'host');
56
57 successfullyParsed = true;
58 </script>
59 <script src="../../js/resources/js-test-post.js"></script>
60 </body>
61 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/shadowroot-host-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698