<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202873] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202873">202873</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-07-06 13:09:32 -0700 (Wed, 06 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ShadowDOM] assignedSlot property should be on Text, not CharacterData
https://bugs.webkit.org/show_bug.cgi?id=159482
&lt;rdar://problem/27201687&gt;

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

assignedSlot property should be on Text, not CharacterData as per:
- https://dom.spec.whatwg.org/#mixin-slotable

Align with the latest specification.

No new tests, rebaselined existing test.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.idl:
* dom/NonDocumentTypeChildNode.idl:
* dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
* dom/Text.idl:

LayoutTests:

Update / rebaseline a couple of existing tests.

* fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt.
* fast/shadow-dom/Slotable-interface-assignedSlot.html: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html.
* js/dom/dom-static-property-for-in-iteration-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt">trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomElementidl">trunk/Source/WebCore/dom/Element.idl</a></li>
<li><a href="#trunkSourceWebCoredomNonDocumentTypeChildNodeidl">trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl</a></li>
<li><a href="#trunkSourceWebCoredomTextidl">trunk/Source/WebCore/dom/Text.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastshadowdomSlotableinterfaceassignedSlotexpectedtxt">trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomSlotableinterfaceassignedSlothtml">trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html</a></li>
<li><a href="#trunkSourceWebCoredomSlotableidl">trunk/Source/WebCore/dom/Slotable.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlotexpectedtxt">trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlothtml">trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/ChangeLog        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2016-07-06  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
+        https://bugs.webkit.org/show_bug.cgi?id=159482
+        &lt;rdar://problem/27201687&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Update / rebaseline a couple of existing tests.
+
+        * fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt.
+        * fast/shadow-dom/Slotable-interface-assignedSlot.html: Renamed from LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html.
+        * js/dom/dom-static-property-for-in-iteration-expected.txt:
+
+2016-07-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Add support for Node.isConnected
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=159474
</span><span class="cx">         &lt;rdar://problem/27197947&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlotexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1,6 +0,0 @@
</span><del>-
-PASS assignedSlot attribute must be defined on NonDocumentTypeChildNode interface 
-PASS assignedSlot must return null when the node does not have an assigned node 
-PASS assignedSlot must return the assigned slot 
-PASS assignedSlot must return null when the assigned slot element is inside a closed shadow tree 
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlothtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1,119 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;title&gt;Shadow DOM: Extensions to NonDocumentTypeChildNode interface&lt;/title&gt;
-&lt;meta name=&quot;author&quot; title=&quot;Ryosuke Niwa&quot; href=&quot;mailto:rniwa@webkit.org&quot;&gt;
-&lt;meta name=&quot;assert&quot; content=&quot;NonDocumentTypeChildNode interface must have assignedSlot attribute&quot;&gt;
-&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element&quot;&gt;
-&lt;script src=&quot;../../resources/testharness.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
-&lt;link rel='stylesheet' href='../../resources/testharness.css'&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
-&lt;script&gt;
-
-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 CharacterData.prototype, 'assignedSlot must be defined on CharacterData.prototype');
-    assert_true('assignedSlot' in document.createTextNode(''), 'assignedSlot must be defined on a text node');
-    assert_true('assignedSlot' in document.createComment(''), 'assignedSlot must be defined on a comment node');
-
-}, 'assignedSlot attribute must be defined on NonDocumentTypeChildNode interface');
-
-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 commentNode = document.createComment('');
-    shadowHost.appendChild(commentNode);
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment 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');
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment 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 commentNode = document.createComment('');
-    shadowHost.appendChild(commentNode);
-
-    var processingInstructionNode = document.createProcessingInstruction('target', 'data');
-    shadowHost.appendChild(processingInstructionNode);
-
-    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');
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
-    assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
-
-    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');
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a text node must null when the node is unassigned from a slot element');
-    assert_equals(processingInstructionNode.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');
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
-    assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
-
-}, '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 commentNode = document.createTextNode('');
-    shadowHost.appendChild(commentNode);
-
-    var processingInstructionNode = document.createProcessingInstruction('target', 'data');
-    shadowHost.appendChild(processingInstructionNode);
-
-    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.');
-    assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null.');
-    assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a processing instruction must always return null.');
-
-}, 'assignedSlot must return null when the assigned slot element is inside a closed shadow tree');
-
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomSlotableinterfaceassignedSlotexpectedtxtfromrev202872trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlotexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt (from rev 202872, trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt) (0 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot-expected.txt        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+PASS assignedSlot attribute must be defined on NonDocumentTypeChildNode interface 
+PASS assignedSlot must return null when the node does not have an assigned node 
+PASS assignedSlot must return the assigned slot 
+PASS assignedSlot must return null when the assigned slot element is inside a closed shadow tree 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastshadowdomSlotableinterfaceassignedSlothtmlfromrev202872trunkLayoutTestsfastshadowdomNonDocumentTypeChildNodeinterfaceassignedSlothtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html (from rev 202872, trunk/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html) (0 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html                                (rev 0)
+++ trunk/LayoutTests/fast/shadow-dom/Slotable-interface-assignedSlot.html        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;Shadow DOM: Slotable interface&lt;/title&gt;
+&lt;meta name=&quot;author&quot; title=&quot;Ryosuke Niwa&quot; href=&quot;mailto:rniwa@webkit.org&quot;&gt;
+&lt;meta name=&quot;assert&quot; content=&quot;Slotable interface must have assignedSlot attribute&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;https://w3c.github.io/webcomponents/spec/shadow/#the-slot-element&quot;&gt;
+&lt;script src=&quot;../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;link rel='stylesheet' href='../../resources/testharness.css'&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+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 NonDocumentTypeChildNode interface');
+
+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');
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2016-07-06  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
+        https://bugs.webkit.org/show_bug.cgi?id=159482
+        &lt;rdar://problem/27201687&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline W3C test now that one more check is passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+
+2016-07-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Add support for Node.isConnected
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=159474
</span><span class="cx">         &lt;rdar://problem/27197947&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsdominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1178,7 +1178,7 @@
</span><span class="cx"> PASS Text interface: existence and properties of interface prototype object's &quot;constructor&quot; property 
</span><span class="cx"> PASS Text interface: operation splitText(unsigned long) 
</span><span class="cx"> PASS Text interface: attribute wholeText 
</span><del>-FAIL Text interface: attribute assignedSlot assert_own_property: expected property &quot;assignedSlot&quot; missing
</del><ins>+PASS Text interface: attribute assignedSlot 
</ins><span class="cx"> PASS Text must be primary interface of document.createTextNode(&quot;abc&quot;) 
</span><span class="cx"> PASS Stringification of document.createTextNode(&quot;abc&quot;) 
</span><span class="cx"> PASS Text interface: document.createTextNode(&quot;abc&quot;) must inherit property &quot;splitText&quot; with the proper type (0) 
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomdomstaticpropertyforiniterationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/LayoutTests/js/dom/dom-static-property-for-in-iteration-expected.txt        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -127,11 +127,11 @@
</span><span class="cx"> PASS a[&quot;slot&quot;] is 
</span><span class="cx"> PASS a[&quot;previousElementSibling&quot;] is [object HTMLDivElement]
</span><span class="cx"> PASS a[&quot;nextElementSibling&quot;] is [object HTMLScriptElement]
</span><del>-PASS a[&quot;assignedSlot&quot;] is null
</del><span class="cx"> PASS a[&quot;children&quot;] is [object HTMLCollection]
</span><span class="cx"> PASS a[&quot;firstElementChild&quot;] is null
</span><span class="cx"> PASS a[&quot;lastElementChild&quot;] is null
</span><span class="cx"> PASS a[&quot;childElementCount&quot;] is 0
</span><ins>+PASS a[&quot;assignedSlot&quot;] is null
</ins><span class="cx"> PASS a[&quot;ALLOW_KEYBOARD_INPUT&quot;] is 1
</span><span class="cx"> PASS a[&quot;nodeName&quot;] is A
</span><span class="cx"> PASS a[&quot;nodeValue&quot;] is null
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -411,6 +411,7 @@
</span><span class="cx">     dom/RequestAnimationFrameCallback.idl
</span><span class="cx">     dom/SecurityPolicyViolationEvent.idl
</span><span class="cx">     dom/ShadowRoot.idl
</span><ins>+    dom/Slotable.idl
</ins><span class="cx">     dom/StringCallback.idl
</span><span class="cx">     dom/Text.idl
</span><span class="cx">     dom/TextEvent.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/ChangeLog        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-07-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [ShadowDOM] assignedSlot property should be on Text, not CharacterData
+        https://bugs.webkit.org/show_bug.cgi?id=159482
+        &lt;rdar://problem/27201687&gt;
+
+        Reviewed by Ryosuke Niwa.
+
+        assignedSlot property should be on Text, not CharacterData as per:
+        - https://dom.spec.whatwg.org/#mixin-slotable
+
+        Align with the latest specification.
+
+        No new tests, rebaselined existing test.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Element.idl:
+        * dom/NonDocumentTypeChildNode.idl:
+        * dom/Slotable.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
+        * dom/Text.idl:
+
</ins><span class="cx"> 2016-07-06  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do not animate video fullscreen exit when page has navigated away.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/DerivedSources.make        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -334,6 +334,7 @@
</span><span class="cx">     $(WebCore)/dom/RequestAnimationFrameCallback.idl \
</span><span class="cx">     $(WebCore)/dom/SecurityPolicyViolationEvent.idl \
</span><span class="cx">     $(WebCore)/dom/ShadowRoot.idl \
</span><ins>+    $(WebCore)/dom/Slotable.idl \
</ins><span class="cx">     $(WebCore)/dom/StringCallback.idl \
</span><span class="cx">     $(WebCore)/dom/Text.idl \
</span><span class="cx">     $(WebCore)/dom/TextEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -10687,6 +10687,7 @@
</span><span class="cx">                 834DD4F31BE08989002C9C3E /* PageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 835D363619FF6193004C93AB /* StyleBuilderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                835F8B261D2D90BA00E408EC /* Slotable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Slotable.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8369E58F1AFDD0300087DF68 /* NonDocumentTypeChildNode.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = NonDocumentTypeChildNode.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 836BAD1F1BD1CA670037356A /* HTMLTableHeaderCellElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableHeaderCellElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 836BAD201BD1CA670037356A /* HTMLTableDataCellElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableDataCellElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -24817,6 +24818,7 @@
</span><span class="cx">                                 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */,
</span><span class="cx">                                 9B532EA11BA928570038A827 /* SlotAssignment.cpp */,
</span><span class="cx">                                 9B532EA21BA928570038A827 /* SlotAssignment.h */,
</span><ins>+                                835F8B261D2D90BA00E408EC /* Slotable.idl */,
</ins><span class="cx">                                 D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
</span><span class="cx">                                 D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
</span><span class="cx">                                 BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.idl (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.idl        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/dom/Element.idl        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -241,5 +241,6 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> Element implements ChildNode;
</span><ins>+Element implements NonDocumentTypeChildNode;
</ins><span class="cx"> Element implements ParentNode;
</span><del>-Element implements NonDocumentTypeChildNode;
</del><ins>+Element implements Slotable;
</ins></span></pre></div>
<a id="trunkSourceWebCoredomNonDocumentTypeChildNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -30,8 +30,4 @@
</span><span class="cx"> ] interface NonDocumentTypeChildNode {
</span><span class="cx">     readonly attribute Element previousElementSibling;
</span><span class="cx">     readonly attribute Element nextElementSibling;
</span><del>-
-#if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
-    [EnabledAtRuntime=ShadowDOM, ImplementedAs=assignedSlotForBindings] readonly attribute HTMLSlotElement assignedSlot;
-#endif
</del><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomSlotableidlfromrev202872trunkSourceWebCoredomNonDocumentTypeChildNodeidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/Slotable.idl (from rev 202872, trunk/Source/WebCore/dom/NonDocumentTypeChildNode.idl) (0 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Slotable.idl                                (rev 0)
+++ trunk/Source/WebCore/dom/Slotable.idl        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+[
+    NoInterfaceObject,
+    EnabledAtRuntime=ShadowDOM,
+] interface Slotable {
+#if defined(LANGUAGE_JAVASCRIPT) &amp;&amp; LANGUAGE_JAVASCRIPT
+    [ImplementedAs=assignedSlotForBindings] readonly attribute HTMLSlotElement? assignedSlot;
+#endif
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoredomTextidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.idl (202872 => 202873)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.idl        2016-07-06 20:03:09 UTC (rev 202872)
+++ trunk/Source/WebCore/dom/Text.idl        2016-07-06 20:09:32 UTC (rev 202873)
</span><span class="lines">@@ -33,3 +33,4 @@
</span><span class="cx">     [RaisesException] Text               replaceWholeText(optional DOMString content = &quot;undefined&quot;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+Text implements Slotable;
</ins></span></pre>
</div>
</div>

</body>
</html>