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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html

Issue 1530643003: Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip Created 5 years 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../../../resources/testharness.js'></script>
3 <script src='../../../resources/testharnessreport.js'></script>
4 <script src='resources/shadow-dom.js'></script>
5 <div id='host'>
6 <template data-mode='v0'>
7 <slot name='slot1'>
8 <div id='fallback1'></div>
9 </slot>
10 <slot name='slot2'>
11 <div id='fallback2'></div>
12 </slot>
13 </template>
14 <slot id='slot0'>
15 <div id='fallback0'></div>
16 </slot>
17 <div id='child1' slot='slot1'></div>
18 </div>
19 <script>
20 'use strict';
21 convertTemplatesToShadowRootsWithin(host);
22 removeWhiteSpaceOnlyTextNodes(host);
23 document.body.offsetLeft;
24
25 const slot1 = host.shadowRoot.querySelector('[name=slot1]');
26 const slot2 = host.shadowRoot.querySelector('[name=slot2]');
27 const fallback1 = host.shadowRoot.querySelector('#fallback2');
kochi 2016/01/05 07:44:11 #fallback1
hayato 2016/01/06 05:49:09 Done.
28 const fallback2 = host.shadowRoot.querySelector('#fallback2');
29
30 test(() => {
31 assert_equals(fallback0.assignedSlot, null);
32 assert_equals(fallback1.assignedSlot, null);
33 assert_equals(fallback2.assignedSlot, null);
34 assert_equals(child1.assignedSlot, null);
35 }, "assignedSlot");
36
37 test(() => {
38 assert_array_equals(slot0.getAssignedNodes(), []);
39 assert_array_equals(slot1.getAssignedNodes(), []);
40 assert_array_equals(slot2.getAssignedNodes(), []);
41 }, "getAssignedNodes");
42
43 // TODO(hayato): Support slots fallback feature in the document tree and v0 shad ow tree.
kochi 2016/01/05 07:44:11 Isn't this tested in other tests?
hayato 2016/01/06 05:49:09 Let me remove this commented-out tests from this C
44 // e.g.
45 // test(() => {
46 // assert_array_equals(slot0.getDistributedNodes(), [fallback0], "Slot fallbac k in document tree");
47 // assert_array_equals(slot1.getDistributedNodes(), [fallback1], "Slots fallba ck in v0 shadow tree);
48 // assert_array_equals(slot2.getDistributedNodes(), [fallback2], "Slots fallba ck in v0 shadow tree);
49 // }, "getDistributedNodes");
50 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698