Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a057efa227ef67458a1c367bbd06cf5e91e141d6 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html |
| @@ -0,0 +1,50 @@ |
| +<!DOCTYPE html> |
| +<script src='../../../resources/testharness.js'></script> |
| +<script src='../../../resources/testharnessreport.js'></script> |
| +<script src='resources/shadow-dom.js'></script> |
| +<div id='host'> |
| + <template data-mode='v0'> |
| + <slot name='slot1'> |
| + <div id='fallback1'></div> |
| + </slot> |
| + <slot name='slot2'> |
| + <div id='fallback2'></div> |
| + </slot> |
| + </template> |
| + <slot id='slot0'> |
| + <div id='fallback0'></div> |
| + </slot> |
| + <div id='child1' slot='slot1'></div> |
| +</div> |
| +<script> |
| +'use strict'; |
| +convertTemplatesToShadowRootsWithin(host); |
| +removeWhiteSpaceOnlyTextNodes(host); |
| +document.body.offsetLeft; |
| + |
| +const slot1 = host.shadowRoot.querySelector('[name=slot1]'); |
| +const slot2 = host.shadowRoot.querySelector('[name=slot2]'); |
| +const fallback1 = host.shadowRoot.querySelector('#fallback2'); |
|
kochi
2016/01/05 07:44:11
#fallback1
hayato
2016/01/06 05:49:09
Done.
|
| +const fallback2 = host.shadowRoot.querySelector('#fallback2'); |
| + |
| +test(() => { |
| + assert_equals(fallback0.assignedSlot, null); |
| + assert_equals(fallback1.assignedSlot, null); |
| + assert_equals(fallback2.assignedSlot, null); |
| + assert_equals(child1.assignedSlot, null); |
| +}, "assignedSlot"); |
| + |
| +test(() => { |
| + assert_array_equals(slot0.getAssignedNodes(), []); |
| + assert_array_equals(slot1.getAssignedNodes(), []); |
| + assert_array_equals(slot2.getAssignedNodes(), []); |
| +}, "getAssignedNodes"); |
| + |
| +// TODO(hayato): Support slots fallback feature in the document tree and v0 shadow 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
|
| +// e.g. |
| +// test(() => { |
| +// assert_array_equals(slot0.getDistributedNodes(), [fallback0], "Slot fallback in document tree"); |
| +// assert_array_equals(slot1.getDistributedNodes(), [fallback1], "Slots fallback in v0 shadow tree); |
| +// assert_array_equals(slot2.getDistributedNodes(), [fallback2], "Slots fallback in v0 shadow tree); |
| +// }, "getDistributedNodes"); |
| +</script> |