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

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: 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 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..7680cee9142efda007f8f498ab68ff734fa1d8d3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/v1-slots-api-in-v0.html
@@ -0,0 +1,42 @@
+<!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('#fallback1');
+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");
+</script>

Powered by Google App Engine
This is Rietveld 408576698