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

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

Issue 1530643003: Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 11 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
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='open'>
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 <div id='child1' slot='slot1'></div>
15 </div>
16 <script>
17 'use strict';
18 convertTemplatesToShadowRootsWithin(host);
19 removeWhiteSpaceOnlyTextNodes(host);
20 document.body.offsetLeft;
21
22 const slot1 = host.shadowRoot.querySelector('[name=slot1]');
23 const slot2 = host.shadowRoot.querySelector('[name=slot2]');
24 const fallback2 = host.shadowRoot.querySelector('#fallback2');
25
26 test(() => {
27 assert_equals(child1.assignedSlot, slot1);
28 }, "assignedSlot");
29
30 test(() => {
31 assert_array_equals(slot1.getAssignedNodes(), [child1]);
32 assert_array_equals(slot2.getAssignedNodes(), []);
33 }, "getAssignedNodes");
34
35 test(() => {
36 assert_array_equals(slot1.getDistributedNodes(), [child1]);
37 assert_array_equals(slot2.getDistributedNodes(), [fallback2]);
38 }, "getDistributedNodes");
39 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698