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

Unified 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698