<!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>[209211] branches/safari-602-branch</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/209211">209211</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2016-12-01 14:24:07 -0800 (Thu, 01 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/209145">r209145</a>. rdar://problem/29404231</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestsChangeLog">branches/safari-602-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreChangeLog">branches/safari-602-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoredomElementh">branches/safari-602-branch/Source/WebCore/dom/Element.h</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlColorInputTypecpp">branches/safari-602-branch/Source/WebCore/html/ColorInputType.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlFileInputTypecpp">branches/safari-602-branch/Source/WebCore/html/FileInputType.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlHTMLKeygenElementcpp">branches/safari-602-branch/Source/WebCore/html/HTMLKeygenElement.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlHTMLMediaElementcpp">branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlHTMLTextAreaElementcpp">branches/safari-602-branch/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlRangeInputTypecpp">branches/safari-602-branch/Source/WebCore/html/RangeInputType.cpp</a></li>
<li><a href="#branchessafari602branchSourceWebCorehtmlshadowSliderThumbElementh">branches/safari-602-branch/Source/WebCore/html/shadow/SliderThumbElement.h</a></li>
<li><a href="#branchessafari602branchSourceWebCoresvgSVGUseElementcpp">branches/safari-602-branch/Source/WebCore/svg/SVGUseElement.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomcolorinputelementshadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomcolorinputelementshadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomfileinputelementshadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomfileinputelementshadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomkeygenshadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomkeygenshadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdommediashadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdommediashadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomrangeinputelementshadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomrangeinputelementshadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomtextareashadowmanipulationexpectedtxt">branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestsfastshadowdomtextareashadowmanipulationhtml">branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari602branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/LayoutTests/ChangeLog (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/ChangeLog        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/LayoutTests/ChangeLog        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2016-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r209145. rdar://problem/29404231
+
+    2016-11-30  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            Use 'childOfType' template when retrieving Shadow DOM elements
+            https://bugs.webkit.org/show_bug.cgi?id=165145
+            &lt;rdar://problem/29331830&gt;
+
+            Reviewed by Antti Koivisto.
+
+            * fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/color-input-element-shadow-manipulation.html: Added.
+            * fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/file-input-element-shadow-manipulation.html: Added.
+            * fast/shadow-dom/keygen-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/keygen-shadow-manipulation.html: Added.
+            * fast/shadow-dom/media-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/media-shadow-manipulation.html: Added.
+            * fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/range-input-element-shadow-manipulation.html: Added.
+            * fast/shadow-dom/textarea-shadow-manipulation-expected.txt: Added.
+            * fast/shadow-dom/textarea-shadow-manipulation.html: Added.
+
+2016-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r208745. rdar://problem/29277336
</span><span class="cx"> 
</span><span class="cx">     2016-11-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomcolorinputelementshadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo 
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomcolorinputelementshadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = color_input_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.top + 10);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    color_input_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;input type=&quot;color&quot; id=&quot;color_input_element&quot; style=&quot;position:absolute; height: 100px; width: 100px;&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomfileinputelementshadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo 
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomfileinputelementshadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = file_input_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.top + 10);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    file_input_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;input type=&quot;file&quot; id=&quot;file_input_element&quot; style=&quot;position:absolute; height: 100px; width: 100px;&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomkeygenshadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomkeygenshadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = keygen_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    keygen_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;keygen id=&quot;keygen_element&quot; style=&quot;position:absolute; height: 100px; width: 100px;&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdommediashadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo 
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdommediashadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = video_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.bottom - 10);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    video_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;video id=&quot;video_element&quot; style=&quot;position:absolute; height: 240px; width: 320px;&quot; controls&gt;&lt;/video&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomrangeinputelementshadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo 
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomrangeinputelementshadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = range_input_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    range_input_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;input type=&quot;range&quot; id=&quot;range_input_element&quot; style=&quot;position:absolute; height: 30px; width: 100px;&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomtextareashadowmanipulationexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+PASS Passes if we did not debug assert.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+foo 
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsfastshadowdomtextareashadowmanipulationhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html (0 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html                                (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+function runTest() {
+    var bounds = textarea_element.getBoundingClientRect();
+    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
+    var shadow_tree_container = range.commonAncestorContainer;
+    shadow_tree_container.prepend(&quot;foo&quot;);
+    textarea_element.disabled = true;
+    testPassed(&quot;Passes if we did not debug assert.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;textarea id=&quot;textarea_element&quot; style=&quot;position:absolute; height: 100px; width: 100px;&quot;&gt;Text Area&lt;/textarea&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari602branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/ChangeLog        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -1,5 +1,56 @@
</span><span class="cx"> 2016-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r209145. rdar://problem/29404231
+
+    2016-11-30  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            Use 'childOfType' template when retrieving Shadow DOM elements
+            https://bugs.webkit.org/show_bug.cgi?id=165145
+            &lt;rdar://problem/29331830&gt;
+
+            Reviewed by Antti Koivisto.
+
+            Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
+                   fast/shadow-dom/file-input-element-shadow-manipulation.html
+                   fast/shadow-dom/keygen-shadow-manipulation.html
+                   fast/shadow-dom/media-shadow-manipulation.html
+                   fast/shadow-dom/range-input-element-shadow-manipulation.html
+                   fast/shadow-dom/textarea-shadow-manipulation.html
+
+            Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
+            than relying on expected element positions, as these can be changed by
+            JavaScript.
+
+            Drive by fix: Make more use of is&lt;&gt; and downcast&lt;&gt; templates rather than blindly casting.
+
+            * dom/Element.h:
+            (WebCore::Element::isUploadButton): Added.
+            (WebCore::Element::isSliderContainerElement): Added.
+            * html/ColorInputType.cpp:
+            (WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
+            the first child is the one we want.
+            * html/FileInputType.cpp:
+            (isType): Added.
+            (WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
+            the first child is the one we want.
+            (WebCore::FileInputType::multipleAttributeChanged): Ditto.
+            * html/HTMLKeygenElement.cpp:
+            (WebCore::HTMLKeygenElement::shadowSelect): Ditto.
+            * html/HTMLMediaElement.cpp:
+            (WebCore::HTMLMediaElement::mediaControls): Ditto.
+            (WebCore::HTMLMediaElement::hasMediaControls): Ditto.
+            * html/HTMLTextAreaElement.cpp:
+            (WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
+            * html/RangeInputType.cpp:
+            (WebCore::RangeInputType::sliderTrackElement): Ditto.
+            * html/shadow/SliderThumbElement.h:
+            (isType): Added.
+            * svg/SVGUseElement.cpp:
+            (WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
+            the first child is the one we want.
+
+2016-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r208745. rdar://problem/29277336
</span><span class="cx"> 
</span><span class="cx">     2016-11-14  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/dom/Element.h (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/dom/Element.h        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/dom/Element.h        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -422,6 +422,8 @@
</span><span class="cx">     virtual bool isInRange() const { return false; }
</span><span class="cx">     virtual bool isOutOfRange() const { return false; }
</span><span class="cx">     virtual bool isFrameElementBase() const { return false; }
</span><ins>+    virtual bool isUploadButton() const { return false; }
+    virtual bool isSliderContainerElement() const { return false; }
</ins><span class="cx"> 
</span><span class="cx">     bool canContainRangeEndPoint() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlColorInputTypecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/ColorInputType.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/ColorInputType.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/ColorInputType.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;Color.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;HTMLDataListElement.h&quot;
</span><span class="cx"> #include &quot;HTMLDivElement.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="lines">@@ -204,7 +205,14 @@
</span><span class="cx"> HTMLElement* ColorInputType::shadowColorSwatch() const
</span><span class="cx"> {
</span><span class="cx">     ShadowRoot* shadow = element().userAgentShadowRoot();
</span><del>-    return shadow ? downcast&lt;HTMLElement&gt;(shadow-&gt;firstChild()-&gt;firstChild()) : nullptr;
</del><ins>+    if (!shadow)
+        return nullptr;
+
+    auto wrapper = childrenOfType&lt;HTMLDivElement&gt;(*shadow).first();
+    if (!wrapper)
+        return nullptr;
+
+    return childrenOfType&lt;HTMLDivElement&gt;(*wrapper).first();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect ColorInputType::elementRectRelativeToRootView() const
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlFileInputTypecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/FileInputType.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/FileInputType.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/FileInputType.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;DragData.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;File.h&quot;
</span><span class="cx"> #include &quot;FileList.h&quot;
</span><span class="lines">@@ -39,10 +40,21 @@
</span><span class="cx"> #include &quot;RenderFileUploadControl.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &quot;ShadowRoot.h&quot;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> namespace WebCore {
</span><ins>+class UploadButtonElement;
+}
</ins><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::UploadButtonElement)
+    static bool isType(const WebCore::Element&amp; element) { return element.isUploadButton(); }
+    static bool isType(const WebCore::Node&amp; node) { return is&lt;WebCore::Element&gt;(node) &amp;&amp; isType(downcast&lt;WebCore::Element&gt;(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
+
+namespace WebCore {
+
</ins><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><span class="cx"> class UploadButtonElement final : public HTMLInputElement {
</span><span class="lines">@@ -51,6 +63,8 @@
</span><span class="cx">     static Ref&lt;UploadButtonElement&gt; createForMultiple(Document&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    bool isUploadButton() const override { return true; }
+    
</ins><span class="cx">     UploadButtonElement(Document&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -277,8 +291,12 @@
</span><span class="cx"> void FileInputType::disabledAttributeChanged()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(element().shadowRoot());
</span><del>-    UploadButtonElement* button = static_cast&lt;UploadButtonElement*&gt;(element().userAgentShadowRoot()-&gt;firstChild());
-    if (button)
</del><ins>+
+    ShadowRoot* root = element().userAgentShadowRoot();
+    if (!root)
+        return;
+    
+    if (auto* button = childrenOfType&lt;UploadButtonElement&gt;(*root).first())
</ins><span class="cx">         button-&gt;setBooleanAttribute(disabledAttr, element().isDisabledFormControl());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -285,8 +303,12 @@
</span><span class="cx"> void FileInputType::multipleAttributeChanged()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(element().shadowRoot());
</span><del>-    UploadButtonElement* button = static_cast&lt;UploadButtonElement*&gt;(element().userAgentShadowRoot()-&gt;firstChild());
-    if (button)
</del><ins>+
+    ShadowRoot* root = element().userAgentShadowRoot();
+    if (!root)
+        return;
+
+    if (auto* button = childrenOfType&lt;UploadButtonElement&gt;(*root).first())
</ins><span class="cx">         button-&gt;setValue(element().multiple() ? fileButtonChooseMultipleFilesLabel() : fileButtonChooseFileLabel());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlHTMLKeygenElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/HTMLKeygenElement.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/HTMLKeygenElement.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLKeygenElement.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2006, 2010, 2012-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;FormDataList.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLSelectElement.h&quot;
</span><span class="lines">@@ -145,7 +146,10 @@
</span><span class="cx"> HTMLSelectElement* HTMLKeygenElement::shadowSelect() const
</span><span class="cx"> {
</span><span class="cx">     ShadowRoot* root = userAgentShadowRoot();
</span><del>-    return root ? downcast&lt;HTMLSelectElement&gt;(root-&gt;firstChild()) : nullptr;
</del><ins>+    if (!root)
+        return nullptr;
+
+    return childrenOfType&lt;HTMLSelectElement&gt;(*root).first();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -5965,9 +5965,13 @@
</span><span class="cx"> MediaControls* HTMLMediaElement::mediaControls() const
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> #else
</span><del>-    return toMediaControls(userAgentShadowRoot()-&gt;firstChild());
</del><ins>+    ShadowRoot* root = userAgentShadowRoot();
+    if (!root)
+        return nullptr;
+    
+    return childrenOfType&lt;MediaControls&gt;(*root).first();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5978,7 +5982,7 @@
</span><span class="cx"> #else
</span><span class="cx"> 
</span><span class="cx">     if (ShadowRoot* userAgent = userAgentShadowRoot()) {
</span><del>-        Node* node = userAgent-&gt;firstChild();
</del><ins>+        Node* node = childrenOfType&lt;MediaControls&gt;(*root).first();
</ins><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(!node || node-&gt;isMediaControls());
</span><span class="cx">         return node;
</span><span class="cx">     }
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/HTMLTextAreaElement.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2008, 2010, 2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
</span><span class="cx">  *
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="lines">@@ -324,7 +325,11 @@
</span><span class="cx"> 
</span><span class="cx"> TextControlInnerTextElement* HTMLTextAreaElement::innerTextElement() const
</span><span class="cx"> {
</span><del>-    return downcast&lt;TextControlInnerTextElement&gt;(userAgentShadowRoot()-&gt;firstChild());
</del><ins>+    ShadowRoot* root = userAgentShadowRoot();
+    if (!root)
+        return nullptr;
+    
+    return childrenOfType&lt;TextControlInnerTextElement&gt;(*root).first();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTextAreaElement::rendererWillBeDestroyed()
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlRangeInputTypecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/RangeInputType.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/RangeInputType.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/RangeInputType.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;RangeInputType.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><ins>+#include &quot;ElementChildIterator.h&quot;
</ins><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="lines">@@ -270,7 +271,15 @@
</span><span class="cx">     ASSERT(element().userAgentShadowRoot()-&gt;firstChild()-&gt;isHTMLElement());
</span><span class="cx">     ASSERT(element().userAgentShadowRoot()-&gt;firstChild()-&gt;firstChild()); // track
</span><span class="cx"> 
</span><del>-    return downcast&lt;HTMLElement&gt;(element().userAgentShadowRoot()-&gt;firstChild()-&gt;firstChild());
</del><ins>+    ShadowRoot* root = element().userAgentShadowRoot();
+    if (!root)
+        return nullptr;
+    
+    auto* container = childrenOfType&lt;SliderContainerElement&gt;(*root).first();
+    if (!container)
+        return nullptr;
+
+    return childrenOfType&lt;HTMLElement&gt;(*container).first();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SliderThumbElement&amp; RangeInputType::typedSliderThumbElement() const
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCorehtmlshadowSliderThumbElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/html/shadow/SliderThumbElement.h (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/html/shadow/SliderThumbElement.h        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/html/shadow/SliderThumbElement.h        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -137,10 +137,16 @@
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) override;
</span><span class="cx">     Optional&lt;ElementStyle&gt; resolveCustomStyle(const RenderStyle&amp;, const RenderStyle*) override;
</span><span class="cx">     const AtomicString&amp; shadowPseudoId() const override;
</span><ins>+    bool isSliderContainerElement() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     AtomicString m_shadowPseudoId;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-}
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SliderContainerElement)
+    static bool isType(const WebCore::Element&amp; element) { return element.isSliderContainerElement(); }
+    static bool isType(const WebCore::Node&amp; node) { return is&lt;WebCore::Element&gt;(node) &amp;&amp; isType(downcast&lt;WebCore::Element&gt;(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoresvgSVGUseElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/svg/SVGUseElement.cpp (209210 => 209211)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/svg/SVGUseElement.cpp        2016-12-01 22:23:59 UTC (rev 209210)
+++ branches/safari-602-branch/Source/WebCore/svg/SVGUseElement.cpp        2016-12-01 22:24:07 UTC (rev 209211)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx">     auto* root = userAgentShadowRoot();
</span><span class="cx">     if (!root)
</span><span class="cx">         return nullptr;
</span><del>-    return downcast&lt;SVGElement&gt;(root-&gt;firstChild());
</del><ins>+    return childrenOfType&lt;SVGElement&gt;(*root).first();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; SVGUseElement::createElementRenderer(RenderStyle&amp;&amp; style, const RenderTreePosition&amp;)
</span></span></pre>
</div>
</div>

</body>
</html>