Bug 1634297 [wpt PR 23336] - [shadow-dom] rename slotable to slottable, a=testonly
authorPhilip Jägenstedt <philip@foolip.org>
Wed, 13 May 2020 09:40:11 +0000
changeset 531064 370152132527de3182e9974ef691621a0019c534
parent 531063 f3510d3450b9ccf58e386ca5276d94cc64a6cddb
child 531065 857c51299905764a8eb94829badeae12f264588e
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1634297, 23336
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1634297 [wpt PR 23336] - [shadow-dom] rename slotable to slottable, a=testonly Automatic update from web-platform-tests DOM: rename slotable to slottable Follows https://github.com/whatwg/dom/pull/845. -- wpt-commits: a35a7400d6e34863e34b0cd5d708ad68286878b8 wpt-pr: 23336
testing/web-platform/tests/shadow-dom/Slotable-interface.html
testing/web-platform/tests/shadow-dom/Slottable-mixin.html
testing/web-platform/tests/shadow-dom/slotchange-event.html
testing/web-platform/tests/shadow-dom/slots-imperative-slot-api.tentative.html
deleted file mode 100644
--- a/testing/web-platform/tests/shadow-dom/Slotable-interface.html
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Shadow DOM: Slotable interface</title>
-<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
-<meta name="assert" content="Element and Text interfaces must implement Slotable interface">
-<link rel="help" href="https://dom.spec.whatwg.org/#slotable">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-</head>
-<body>
-<div id="log"></div>
-<script>
-
-test(function () {
-    assert_true('assignedSlot' in Element.prototype, 'assignedSlot must be defined on Element.prototype');
-    assert_true('assignedSlot' in document.createElement('div'), 'assignedSlot must be defined on a div element');
-
-    assert_true('assignedSlot' in Text.prototype, 'assignedSlot must be defined on Text.prototype');
-    assert_true('assignedSlot' in document.createTextNode(''), 'assignedSlot must be defined on a text node');
-    assert_false('assignedSlot' in document.createComment(''), 'assignedSlot must not be defined on a comment node');
-    assert_false('assignedSlot' in document.createProcessingInstruction('target', 'data'), 'assignedSlot must not be defined on a processing instruction node');
-
-}, 'assignedSlot attribute must be defined on Element and Text interfaces');
-
-test(function () {
-    assert_equals(document.createElement('div').assignedSlot, null, 'assignedSlot must be null when the element is not in any tree');
-
-    var shadowHost = document.createElement('div');
-    var shadowRoot = shadowHost.attachShadow({mode: 'open'});
-
-    var childElement = document.createElement('b');
-    shadowHost.appendChild(childElement);
-    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must be null when a node is not assigned of any slot');
-
-    var childTextNode = document.createTextNode('');
-    shadowHost.appendChild(childTextNode);
-    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node is not assigned of any slot');
-
-    var slot = document.createElement('slot');
-    slot.name = 'foo';
-    shadowRoot.appendChild(slot);
-    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must be null when a node does not match any slot');
-    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node does not match any slot');
-
-}, 'assignedSlot must return null when the node does not have an assigned node');
-
-test(function () {
-    var shadowHost = document.createElement('div');
-    var childElement = document.createElement('b');
-    shadowHost.appendChild(childElement);
-
-    var childTextNode = document.createTextNode('');
-    shadowHost.appendChild(childTextNode);
-
-    var shadowRoot = shadowHost.attachShadow({mode: 'open'});
-    var slot = document.createElement('slot');
-    shadowRoot.appendChild(slot);
-
-    assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the assigned default slot element');
-    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the assigned default slot element');
-
-    slot.name = 'foo';
-    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must null when the element is unassigned from a slot element');
-    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
-
-    childElement.slot = 'foo';
-    assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the re-assigned slot element');
-
-    slot.removeAttribute('name');
-    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the re-assigned slot element');
-
-}, 'assignedSlot must return the assigned slot');
-
-test(function () {
-    var shadowHost = document.createElement('div');
-    var childElement = document.createElement('b');
-    shadowHost.appendChild(childElement);
-
-    var childTextNode = document.createTextNode('');
-    shadowHost.appendChild(childTextNode);
-
-    var shadowRoot = shadowHost.attachShadow({mode: 'closed'});
-    var slot = document.createElement('slot');
-    shadowRoot.appendChild(slot);
-
-    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must return null if the slot is inside a closed shadow tree.');
-    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must return null if the slot is inside a closed shadow tree.');
-
-}, 'assignedSlot must return null when the assigned slot element is inside a closed shadow tree');
-
-</script>
-</body>
-</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/shadow-dom/Slottable-mixin.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Shadow DOM: Slottable mixin</title>
+<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
+<meta name="assert" content="Element and Text interfaces must implement Slottable mixin">
+<link rel="help" href="https://dom.spec.whatwg.org/#slotable">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+
+test(function () {
+    assert_true('assignedSlot' in Element.prototype, 'assignedSlot must be defined on Element.prototype');
+    assert_true('assignedSlot' in document.createElement('div'), 'assignedSlot must be defined on a div element');
+
+    assert_true('assignedSlot' in Text.prototype, 'assignedSlot must be defined on Text.prototype');
+    assert_true('assignedSlot' in document.createTextNode(''), 'assignedSlot must be defined on a text node');
+    assert_false('assignedSlot' in document.createComment(''), 'assignedSlot must not be defined on a comment node');
+    assert_false('assignedSlot' in document.createProcessingInstruction('target', 'data'), 'assignedSlot must not be defined on a processing instruction node');
+
+}, 'assignedSlot attribute must be defined on Element and Text interfaces');
+
+test(function () {
+    assert_equals(document.createElement('div').assignedSlot, null, 'assignedSlot must be null when the element is not in any tree');
+
+    var shadowHost = document.createElement('div');
+    var shadowRoot = shadowHost.attachShadow({mode: 'open'});
+
+    var childElement = document.createElement('b');
+    shadowHost.appendChild(childElement);
+    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must be null when a node is not assigned of any slot');
+
+    var childTextNode = document.createTextNode('');
+    shadowHost.appendChild(childTextNode);
+    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node is not assigned of any slot');
+
+    var slot = document.createElement('slot');
+    slot.name = 'foo';
+    shadowRoot.appendChild(slot);
+    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must be null when a node does not match any slot');
+    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must be null when a node does not match any slot');
+
+}, 'assignedSlot must return null when the node does not have an assigned node');
+
+test(function () {
+    var shadowHost = document.createElement('div');
+    var childElement = document.createElement('b');
+    shadowHost.appendChild(childElement);
+
+    var childTextNode = document.createTextNode('');
+    shadowHost.appendChild(childTextNode);
+
+    var shadowRoot = shadowHost.attachShadow({mode: 'open'});
+    var slot = document.createElement('slot');
+    shadowRoot.appendChild(slot);
+
+    assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the assigned default slot element');
+    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the assigned default slot element');
+
+    slot.name = 'foo';
+    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must null when the element is unassigned from a slot element');
+    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
+
+    childElement.slot = 'foo';
+    assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the re-assigned slot element');
+
+    slot.removeAttribute('name');
+    assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the re-assigned slot element');
+
+}, 'assignedSlot must return the assigned slot');
+
+test(function () {
+    var shadowHost = document.createElement('div');
+    var childElement = document.createElement('b');
+    shadowHost.appendChild(childElement);
+
+    var childTextNode = document.createTextNode('');
+    shadowHost.appendChild(childTextNode);
+
+    var shadowRoot = shadowHost.attachShadow({mode: 'closed'});
+    var slot = document.createElement('slot');
+    shadowRoot.appendChild(slot);
+
+    assert_equals(childElement.assignedSlot, null, 'assignedSlot on an element must return null if the slot is inside a closed shadow tree.');
+    assert_equals(childTextNode.assignedSlot, null, 'assignedSlot on a text node must return null if the slot is inside a closed shadow tree.');
+
+}, 'assignedSlot must return null when the assigned slot element is inside a closed shadow tree');
+
+</script>
+</body>
+</html>
--- a/testing/web-platform/tests/shadow-dom/slotchange-event.html
+++ b/testing/web-platform/tests/shadow-dom/slotchange-event.html
@@ -238,17 +238,17 @@ function testSlotchangeDoesNotFireWhenOt
 
 testSlotchangeDoesNotFireWhenOtherSlotsChange('open', true);
 testSlotchangeDoesNotFireWhenOtherSlotsChange('closed', true);
 testSlotchangeDoesNotFireWhenOtherSlotsChange('open', false);
 testSlotchangeDoesNotFireWhenOtherSlotsChange('closed', false);
 
 function testSlotchangeDoesFireAtInsertedAndDoesNotFireForMutationAfterRemoved(mode, connectedToDocument)
 {
-    var test = async_test('slotchange event must fire on a slot element when a shadow host has a slotable and the slot was inserted'
+    var test = async_test('slotchange event must fire on a slot element when a shadow host has a slottable and the slot was inserted'
                         + ' and must not fire when the shadow host was mutated after the slot was removed inside '
                         + treeName(mode, connectedToDocument));
 
     var host;
     var slot;
     var eventCount = 0;
 
     test.step(function () {
--- a/testing/web-platform/tests/shadow-dom/slots-imperative-slot-api.tentative.html
+++ b/testing/web-platform/tests/shadow-dom/slots-imperative-slot-api.tentative.html
@@ -48,17 +48,17 @@ test(() => {
   assert_equals(tTree.c1.assignedSlot, tTree.s1);
 }, 'Imperative slot API throws exception when not slotAssignment != \'manual\'.');
 
 test(() => {
   let tTree = createTestTree(test_errors);
   assert_throws_dom('NotAllowedError', () => { tTree.s2.assign([tTree.c2]); });
 
   assert_throws_dom('NotAllowedError', () => { tTree.s2.assign([tTree.host1]); });
-}, 'Imperative slot API throws exception when slotable parentNode != slot\'s host.');
+}, 'Imperative slot API throws exception when slottable parentNode != slot\'s host.');
 </script>
 
 <div id="test_assign">
   <div id="host">
     <template id="shadow_root" data-mode="open" data-slot-assignment="manual">
       <slot id="s1"></slot>
       <slot id="s2"></slot>
       <slot id="s3"></slot>
@@ -107,17 +107,17 @@ test(() => {
   assert_equals(tTree.c2.assignedSlot, tTree.s1);
   assert_equals(tTree.c3.assignedSlot, null);
 
   tTree.s1.assign([tTree.c3, tTree.c2, tTree.c1]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c3, tTree.c2, tTree.c1]);
   assert_equals(tTree.c1.assignedSlot, tTree.s1);
   assert_equals(tTree.c2.assignedSlot, tTree.s1);
   assert_equals(tTree.c3.assignedSlot, tTree.s1);
-}, 'Order of slotables is preserved in manual slot assignment.');
+}, 'Order of slottables is preserved in manual slot assignment.');
 
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c2, tTree.c3, tTree.c1]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c2, tTree.c3, tTree.c1]);
 
   tTree.s2.assign([tTree.c2]);
@@ -129,17 +129,17 @@ test(() => {
 
   tTree.s3.assign([tTree.c3]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]);
   assert_array_equals(tTree.s2.assignedNodes(), [tTree.c2]);
   assert_array_equals(tTree.s3.assignedNodes(), [tTree.c3]);
   assert_equals(tTree.c1.assignedSlot, tTree.s1);
   assert_equals(tTree.c2.assignedSlot, tTree.s2);
   assert_equals(tTree.c3.assignedSlot, tTree.s3);
-}, 'Previously assigned slotable is moved to new slot when it\'s reassigned.');
+}, 'Previously assigned slottable is moved to new slot when it\'s reassigned.');
 
 test(() => {
  let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1]);
   tTree.s2.assign([tTree.c2, tTree.c1]);
   tTree.s3.assign([tTree.c1, tTree.c3]);
 
@@ -187,17 +187,17 @@ test(() => {
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]);
 
   tTree.host4.append(tTree.s1);
   assert_array_equals(tTree.s1.assignedNodes(), []);
-}, 'Moving a slot to a new host, the slot loses its previously assigned slotables.');
+}, 'Moving a slot to a new host, the slot loses its previously assigned slottables.');
 
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]);
 
   tTree.shadow_root.insertBefore(tTree.s2, tTree.s1);
@@ -205,32 +205,32 @@ test(() => {
   assert_array_equals(tTree.s2.assignedNodes(), []);
 
   tTree.shadow_root.insertBefore(tTree.s4, tTree.s1);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]);
   assert_array_equals(tTree.s4.assignedNodes(), []);
 
   tTree.ns1.append(tTree.s1);
   assert_array_equals(tTree.s1.assignedNodes(), []);
-}, 'Moving a slot\'s tree order position within a shadow host has no impact on its assigned slotables.');
+}, 'Moving a slot\'s tree order position within a shadow host has no impact on its assigned slottables.');
 
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1, tTree.c2, tTree.c3]);
 
   tTree.host4.append(tTree.c1);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c2, tTree.c3]);
   assert_array_equals(tTree.s4.assignedNodes(), []);
 
   tTree.s4.assign([tTree.c1]);
   assert_array_equals(tTree.s4.assignedNodes(), [tTree.c1]);
   assert_equals(tTree.c1.assignedSlot, tTree.s4);
-}, 'Appending slotable to different host, it loses slot assignment. It can be re-assigned within a new host.');
+}, 'Appending slottable to different host, it loses slot assignment. It can be re-assigned within a new host.');
 
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1]);
   assert_array_equals(tTree.s1.assignedNodes(), [tTree.c1]);
 
   tTree.shadow_root4.insertBefore(tTree.s1, tTree.s4);
@@ -271,17 +271,17 @@ test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1, tTree.c2, tTree.c3]);
   tTree.s1.remove();
 
   assert_equals(tTree.c1.assignedSlot, null);
   assert_equals(tTree.c2.assignedSlot, null);
   assert_equals(tTree.c3.assignedSlot, null);
-}, 'Removing a slot from DOM resets its slotable\'s slot assignment.');
+}, 'Removing a slot from DOM resets its slottable\'s slot assignment.');
 
 test(() => {
   let tTree = createTestTree(test_assign);
 
   tTree.s1.assign([tTree.c1]);
   tTree.s2.assign([tTree.c2]);
   tTree.s3.assign([tTree.c3]);
   tTree.shadow_root.insertBefore(tTree.s2, tTree.s1);