<!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>[191327] trunk/Source/WebCore</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/191327">191327</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-10-19 20:29:34 -0700 (Mon, 19 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Drop unnecessary Node::toInputElement() virtual function
https://bugs.webkit.org/show_bug.cgi?id=150341

Reviewed by Darin Adler.

Drop unnecessary Node::toInputElement() virtual function and use the
usual is&lt;HTMLInputElement&gt;() / downcast&lt; HTMLInputElement &gt;() instead.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckerTestFunctionsh">trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlRadioNodeListcpp">trunk/Source/WebCore/html/RadioNodeList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowSliderThumbElementcpp">trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderButtoncpp">trunk/Source/WebCore/rendering/RenderButton.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemecpp">trunk/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/ChangeLog        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-10-19  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Drop unnecessary Node::toInputElement() virtual function
+        https://bugs.webkit.org/show_bug.cgi?id=150341
+
+        Reviewed by Darin Adler.
+
+        Drop unnecessary Node::toInputElement() virtual function and use the
+        usual is&lt;HTMLInputElement&gt;() / downcast&lt; HTMLInputElement &gt;() instead.
+
</ins><span class="cx"> 2015-10-19  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r191324.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -1316,11 +1316,8 @@
</span><span class="cx">     if (!domNode)
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    if (domNode-&gt;isHTMLElement()) {
-        HTMLInputElement* inputElement = domNode-&gt;toInputElement();
-        if (inputElement &amp;&amp; inputElement-&gt;isPasswordField())
-            return;
-    }
</del><ins>+    if (is&lt;HTMLInputElement&gt;(*domNode) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*domNode).isPasswordField())
+        return;
</ins><span class="cx">     
</span><span class="cx">     // find or create an accessibility object for this node
</span><span class="cx">     AXObjectCache* cache = domNode-&gt;document().axObjectCache();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -494,10 +494,11 @@
</span><span class="cx">     if (roleValue() == SearchFieldRole)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    HTMLInputElement* inputElement = node-&gt;toInputElement();
-    if (!inputElement)
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(*node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    auto&amp; inputElement = downcast&lt;HTMLInputElement&gt;(*node);
+
</ins><span class="cx">     // Some websites don't label their search fields as such. However, they will
</span><span class="cx">     // use the word &quot;search&quot; in either the form or input type. This won't catch every case,
</span><span class="cx">     // but it will catch google.com for example.
</span><span class="lines">@@ -508,7 +509,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Check the form action and the name, which will sometimes be &quot;search&quot;.
</span><del>-    HTMLFormElement* form = inputElement-&gt;form();
</del><ins>+    auto* form = inputElement.form();
</ins><span class="cx">     if (form &amp;&amp; (form-&gt;name().contains(&quot;search&quot;, false) || form-&gt;action().contains(&quot;search&quot;, false)))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="lines">@@ -542,18 +543,14 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isPasswordField() const
</span><span class="cx"> {
</span><del>-    Node* node = this-&gt;node();
-    if (!node || !node-&gt;isHTMLElement())
</del><ins>+    auto* node = this-&gt;node();
+    if (!is&lt;HTMLInputElement&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (ariaRoleAttribute() != UnknownRole)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    HTMLInputElement* inputElement = node-&gt;toInputElement();
-    if (!inputElement)
-        return false;
-
-    return inputElement-&gt;isPasswordField();
</del><ins>+    return downcast&lt;HTMLInputElement&gt;(*node).isPasswordField();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessibilityObject* AccessibilityNodeObject::passwordFieldOrContainingPasswordField()
</span><span class="lines">@@ -562,16 +559,14 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (HTMLInputElement* inputElement = node-&gt;toInputElement()) {
-        if (inputElement-&gt;isPasswordField())
-            return this;
-    }
</del><ins>+    if (is&lt;HTMLInputElement&gt;(*node) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*node).isPasswordField())
+        return this;
</ins><span class="cx"> 
</span><del>-    Element* element = node-&gt;shadowHost();
-    if (!element || !is&lt;HTMLInputElement&gt;(element))
</del><ins>+    auto* element = node-&gt;shadowHost();
+    if (!is&lt;HTMLInputElement&gt;(element))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = axObjectCache())
</del><ins>+    if (auto* cache = axObjectCache())
</ins><span class="cx">         return cache-&gt;getOrCreate(element);
</span><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -643,14 +638,11 @@
</span><span class="cx"> bool AccessibilityNodeObject::isNativeCheckboxOrRadio() const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (!node)
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    HTMLInputElement* input = node-&gt;toInputElement();
-    if (input)
-        return input-&gt;isCheckbox() || input-&gt;isRadioButton();
-
-    return false;
</del><ins>+    auto&amp; input = downcast&lt;HTMLInputElement&gt;(*node);
+    return input.isCheckbox() || input.isRadioButton();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isEnabled() const
</span><span class="lines">@@ -676,15 +668,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isIndeterminate() const
</span><span class="cx"> {
</span><del>-    Node* node = this-&gt;node();
-    if (!node)
-        return false;
-
-    HTMLInputElement* inputElement = node-&gt;toInputElement();
-    if (!inputElement)
-        return false;
-
-    return inputElement-&gt;shouldAppearIndeterminate();
</del><ins>+    auto* node = this-&gt;node();
+    return is&lt;HTMLInputElement&gt;(node) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*node).shouldAppearIndeterminate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityNodeObject::isPressed() const
</span><span class="lines">@@ -716,9 +701,8 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // First test for native checkedness semantics
</span><del>-    HTMLInputElement* inputElement = node-&gt;toInputElement();
-    if (inputElement)
-        return inputElement-&gt;shouldAppearChecked();
</del><ins>+    if (is&lt;HTMLInputElement&gt;(*node))
+        return downcast&lt;HTMLInputElement&gt;(*node).shouldAppearChecked();
</ins><span class="cx"> 
</span><span class="cx">     // Else, if this is an ARIA checkbox or radio, respect the aria-checked attribute
</span><span class="cx">     bool validRole = false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -903,7 +903,7 @@
</span><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case CSSSelector::PseudoClassAutofill:
</span><del>-            return isAutofilled(element);
</del><ins>+            return isAutofilled(*element);
</ins><span class="cx">         case CSSSelector::PseudoClassAnyLink:
</span><span class="cx">         case CSSSelector::PseudoClassAnyLinkDeprecated:
</span><span class="cx">         case CSSSelector::PseudoClassLink:
</span><span class="lines">@@ -972,7 +972,7 @@
</span><span class="cx">         case CSSSelector::PseudoClassInvalid:
</span><span class="cx">             return isInvalid(element);
</span><span class="cx">         case CSSSelector::PseudoClassChecked:
</span><del>-            return isChecked(element);
</del><ins>+            return isChecked(*element);
</ins><span class="cx">         case CSSSelector::PseudoClassIndeterminate:
</span><span class="cx">             return shouldAppearIndeterminate(element);
</span><span class="cx">         case CSSSelector::PseudoClassRoot:
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckerTestFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -41,13 +41,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE bool isAutofilled(const Element* element)
</del><ins>+ALWAYS_INLINE bool isAutofilled(const Element&amp; element)
</ins><span class="cx"> {
</span><del>-    if (is&lt;HTMLFormControlElement&gt;(*element)) {
-        if (const HTMLInputElement* inputElement = element-&gt;toInputElement())
-            return inputElement-&gt;isAutoFilled();
-    }
-    return false;
</del><ins>+    return is&lt;HTMLInputElement&gt;(element) &amp;&amp; downcast&lt;HTMLInputElement&gt;(element).isAutoFilled();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isDefaultButtonForForm(const Element* element)
</span><span class="lines">@@ -72,16 +68,18 @@
</span><span class="cx">     return element-&gt;document().isMediaDocument();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE bool isChecked(Element* element)
</del><ins>+ALWAYS_INLINE bool isChecked(Element&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     // Even though WinIE allows checked and indeterminate to co-exist, the CSS selector spec says that
</span><span class="cx">     // you can't be both checked and indeterminate. We will behave like WinIE behind the scenes and just
</span><span class="cx">     // obey the CSS spec here in the test for matching the pseudo.
</span><del>-    const HTMLInputElement* inputElement = element-&gt;toInputElement();
-    if (inputElement &amp;&amp; inputElement-&gt;shouldAppearChecked() &amp;&amp; !inputElement-&gt;shouldAppearIndeterminate())
-        return true;
-    if (is&lt;HTMLOptionElement&gt;(*element) &amp;&amp; downcast&lt;HTMLOptionElement&gt;(*element).selected())
-        return true;
</del><ins>+    if (is&lt;HTMLInputElement&gt;(element)) {
+        auto&amp; inputElement = downcast&lt;HTMLInputElement&gt;(element);
+        return inputElement.shouldAppearChecked() &amp;&amp; !inputElement.shouldAppearIndeterminate();
+    }
+    if (is&lt;HTMLOptionElement&gt;(element))
+        return downcast&lt;HTMLOptionElement&gt;(element).selected();
+
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -479,84 +479,84 @@
</span><span class="cx">     return collector.hasAnyMatchingRules(ruleSet);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StyleResolver::canShareStyleWithControl(StyledElement* element) const
</del><ins>+bool StyleResolver::canShareStyleWithControl(StyledElement&amp; element) const
</ins><span class="cx"> {
</span><span class="cx">     const State&amp; state = m_state;
</span><del>-    HTMLInputElement* thisInputElement = element-&gt;toInputElement();
-    HTMLInputElement* otherInputElement = state.element()-&gt;toInputElement();
-
-    if (!thisInputElement || !otherInputElement)
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(element) || !is&lt;HTMLInputElement&gt;(*state.element()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (thisInputElement-&gt;isAutoFilled() != otherInputElement-&gt;isAutoFilled())
</del><ins>+    auto&amp; thisInputElement = downcast&lt;HTMLInputElement&gt;(element);
+    auto&amp; otherInputElement = downcast&lt;HTMLInputElement&gt;(*state.element());
+
+    if (thisInputElement.isAutoFilled() != otherInputElement.isAutoFilled())
</ins><span class="cx">         return false;
</span><del>-    if (thisInputElement-&gt;shouldAppearChecked() != otherInputElement-&gt;shouldAppearChecked())
</del><ins>+    if (thisInputElement.shouldAppearChecked() != otherInputElement.shouldAppearChecked())
</ins><span class="cx">         return false;
</span><del>-    if (thisInputElement-&gt;shouldAppearIndeterminate() != otherInputElement-&gt;shouldAppearIndeterminate())
</del><ins>+    if (thisInputElement.shouldAppearIndeterminate() != otherInputElement.shouldAppearIndeterminate())
</ins><span class="cx">         return false;
</span><del>-    if (thisInputElement-&gt;isRequired() != otherInputElement-&gt;isRequired())
</del><ins>+    if (thisInputElement.isRequired() != otherInputElement.isRequired())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;isDisabledFormControl() != state.element()-&gt;isDisabledFormControl())
</del><ins>+    if (element.isDisabledFormControl() != state.element()-&gt;isDisabledFormControl())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;isDefaultButtonForForm() != state.element()-&gt;isDefaultButtonForForm())
</del><ins>+    if (element.isDefaultButtonForForm() != state.element()-&gt;isDefaultButtonForForm())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;isInRange() != state.element()-&gt;isInRange())
</del><ins>+    if (element.isInRange() != state.element()-&gt;isInRange())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;isOutOfRange() != state.element()-&gt;isOutOfRange())
</del><ins>+    if (element.isOutOfRange() != state.element()-&gt;isOutOfRange())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool elementHasDirectionAuto(Element* element)
</del><ins>+static inline bool elementHasDirectionAuto(Element&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: This line is surprisingly hot, we may wish to inline hasDirectionAuto into StyleResolver.
</span><del>-    return is&lt;HTMLElement&gt;(*element) &amp;&amp; downcast&lt;HTMLElement&gt;(*element).hasDirectionAuto();
</del><ins>+    return is&lt;HTMLElement&gt;(element) &amp;&amp; downcast&lt;HTMLElement&gt;(element).hasDirectionAuto();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement* sharingCandidate) const
</del><ins>+bool StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement&amp; sharingCandidate) const
</ins><span class="cx"> {
</span><span class="cx">     const State&amp; state = m_state;
</span><del>-    if (state.element()-&gt;elementData() == sharingCandidate-&gt;elementData())
</del><ins>+    if (state.element()-&gt;elementData() == sharingCandidate.elementData())
</ins><span class="cx">         return true;
</span><del>-    if (state.element()-&gt;fastGetAttribute(XMLNames::langAttr) != sharingCandidate-&gt;fastGetAttribute(XMLNames::langAttr))
</del><ins>+    if (state.element()-&gt;fastGetAttribute(XMLNames::langAttr) != sharingCandidate.fastGetAttribute(XMLNames::langAttr))
</ins><span class="cx">         return false;
</span><del>-    if (state.element()-&gt;fastGetAttribute(langAttr) != sharingCandidate-&gt;fastGetAttribute(langAttr))
</del><ins>+    if (state.element()-&gt;fastGetAttribute(langAttr) != sharingCandidate.fastGetAttribute(langAttr))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!state.elementAffectedByClassRules()) {
</span><del>-        if (sharingCandidate-&gt;hasClass() &amp;&amp; classNamesAffectedByRules(sharingCandidate-&gt;classNames()))
</del><ins>+        if (sharingCandidate.hasClass() &amp;&amp; classNamesAffectedByRules(sharingCandidate.classNames()))
</ins><span class="cx">             return false;
</span><del>-    } else if (sharingCandidate-&gt;hasClass()) {
</del><ins>+    } else if (sharingCandidate.hasClass()) {
</ins><span class="cx">         // SVG elements require a (slow!) getAttribute comparision because &quot;class&quot; is an animatable attribute for SVG.
</span><span class="cx">         if (state.element()-&gt;isSVGElement()) {
</span><del>-            if (state.element()-&gt;getAttribute(classAttr) != sharingCandidate-&gt;getAttribute(classAttr))
</del><ins>+            if (state.element()-&gt;getAttribute(classAttr) != sharingCandidate.getAttribute(classAttr))
</ins><span class="cx">                 return false;
</span><span class="cx">         } else {
</span><del>-            if (state.element()-&gt;classNames() != sharingCandidate-&gt;classNames())
</del><ins>+            if (state.element()-&gt;classNames() != sharingCandidate.classNames())
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">     } else
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (state.styledElement()-&gt;presentationAttributeStyle() != sharingCandidate-&gt;presentationAttributeStyle())
</del><ins>+    if (state.styledElement()-&gt;presentationAttributeStyle() != sharingCandidate.presentationAttributeStyle())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (state.element()-&gt;hasTagName(progressTag)) {
</span><del>-        if (state.element()-&gt;shouldAppearIndeterminate() != sharingCandidate-&gt;shouldAppearIndeterminate())
</del><ins>+        if (state.element()-&gt;shouldAppearIndeterminate() != sharingCandidate.shouldAppearIndeterminate())
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
</del><ins>+bool StyleResolver::canShareStyleWithElement(StyledElement&amp; element) const
</ins><span class="cx"> {
</span><del>-    RenderStyle* style = element-&gt;renderStyle();
</del><ins>+    auto* style = element.renderStyle();
</ins><span class="cx">     const State&amp; state = m_state;
</span><span class="cx"> 
</span><span class="cx">     if (!style)
</span><span class="lines">@@ -565,37 +565,37 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (style-&gt;hasUniquePseudoStyle())
</span><span class="cx">         return false;
</span><del>-    if (element-&gt;tagQName() != state.element()-&gt;tagQName())
</del><ins>+    if (element.tagQName() != state.element()-&gt;tagQName())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;inlineStyle())
</del><ins>+    if (element.inlineStyle())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;needsStyleRecalc())
</del><ins>+    if (element.needsStyleRecalc())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;isSVGElement() &amp;&amp; downcast&lt;SVGElement&gt;(*element).animatedSMILStyleProperties())
</del><ins>+    if (element.isSVGElement() &amp;&amp; downcast&lt;SVGElement&gt;(element).animatedSMILStyleProperties())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;isLink() != state.element()-&gt;isLink())
</del><ins>+    if (element.isLink() != state.element()-&gt;isLink())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;hovered() != state.element()-&gt;hovered())
</del><ins>+    if (element.hovered() != state.element()-&gt;hovered())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;active() != state.element()-&gt;active())
</del><ins>+    if (element.active() != state.element()-&gt;active())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;focused() != state.element()-&gt;focused())
</del><ins>+    if (element.focused() != state.element()-&gt;focused())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;shadowPseudoId() != state.element()-&gt;shadowPseudoId())
</del><ins>+    if (element.shadowPseudoId() != state.element()-&gt;shadowPseudoId())
</ins><span class="cx">         return false;
</span><del>-    if (element == element-&gt;document().cssTarget())
</del><ins>+    if (&amp;element == element.document().cssTarget())
</ins><span class="cx">         return false;
</span><span class="cx">     if (!sharingCandidateHasIdenticalStyleAffectingAttributes(element))
</span><span class="cx">         return false;
</span><del>-    if (element-&gt;additionalPresentationAttributeStyle() != state.styledElement()-&gt;additionalPresentationAttributeStyle())
</del><ins>+    if (element.additionalPresentationAttributeStyle() != state.styledElement()-&gt;additionalPresentationAttributeStyle())
</ins><span class="cx">         return false;
</span><del>-    if (element-&gt;affectsNextSiblingElementStyle() || element-&gt;styleIsAffectedByPreviousSibling())
</del><ins>+    if (element.affectsNextSiblingElementStyle() || element.styleIsAffectedByPreviousSibling())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;hasID() &amp;&amp; m_ruleSets.features().idsInRules.contains(element-&gt;idForStyleResolution().impl()))
</del><ins>+    if (element.hasID() &amp;&amp; m_ruleSets.features().idsInRules.contains(element.idForStyleResolution().impl()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    bool isControl = is&lt;HTMLFormControlElement&gt;(*element);
</del><ins>+    bool isControl = is&lt;HTMLFormControlElement&gt;(element);
</ins><span class="cx"> 
</span><span class="cx">     if (isControl != is&lt;HTMLFormControlElement&gt;(*state.element()))
</span><span class="cx">         return false;
</span><span class="lines">@@ -608,31 +608,31 @@
</span><span class="cx"> 
</span><span class="cx">     // Turn off style sharing for elements that can gain layers for reasons outside of the style system.
</span><span class="cx">     // See comments in RenderObject::setStyle().
</span><del>-    if (element-&gt;hasTagName(iframeTag) || element-&gt;hasTagName(frameTag) || element-&gt;hasTagName(embedTag) || element-&gt;hasTagName(objectTag) || element-&gt;hasTagName(appletTag) || element-&gt;hasTagName(canvasTag))
</del><ins>+    if (element.hasTagName(iframeTag) || element.hasTagName(frameTag) || element.hasTagName(embedTag) || element.hasTagName(objectTag) || element.hasTagName(appletTag) || element.hasTagName(canvasTag))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (elementHasDirectionAuto(element))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;isLink() &amp;&amp; state.elementLinkState() != style-&gt;insideLink())
</del><ins>+    if (element.isLink() &amp;&amp; state.elementLinkState() != style-&gt;insideLink())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;elementData() != state.element()-&gt;elementData()) {
-        if (element-&gt;fastGetAttribute(readonlyAttr) != state.element()-&gt;fastGetAttribute(readonlyAttr))
</del><ins>+    if (element.elementData() != state.element()-&gt;elementData()) {
+        if (element.fastGetAttribute(readonlyAttr) != state.element()-&gt;fastGetAttribute(readonlyAttr))
</ins><span class="cx">             return false;
</span><del>-        if (element-&gt;isSVGElement()) {
-            if (element-&gt;getAttribute(typeAttr) != state.element()-&gt;getAttribute(typeAttr))
</del><ins>+        if (element.isSVGElement()) {
+            if (element.getAttribute(typeAttr) != state.element()-&gt;getAttribute(typeAttr))
</ins><span class="cx">                 return false;
</span><span class="cx">         } else {
</span><del>-            if (element-&gt;fastGetAttribute(typeAttr) != state.element()-&gt;fastGetAttribute(typeAttr))
</del><ins>+            if (element.fastGetAttribute(typeAttr) != state.element()-&gt;fastGetAttribute(typeAttr))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (element-&gt;matchesValidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
</del><ins>+    if (element.matchesValidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (element-&gt;matchesInvalidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
</del><ins>+    if (element.matchesInvalidPseudoClass() != state.element()-&gt;matchesValidPseudoClass())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><del>-    if (element == element-&gt;document().webkitCurrentFullScreenElement() || state.element() == state.document().webkitCurrentFullScreenElement())
</del><ins>+    if (&amp;element == element.document().webkitCurrentFullScreenElement() || state.element() == state.document().webkitCurrentFullScreenElement())
</ins><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx">     return true;
</span><span class="lines">@@ -653,7 +653,7 @@
</span><span class="cx">     for (; node; node = node-&gt;previousSibling()) {
</span><span class="cx">         if (!is&lt;StyledElement&gt;(*node))
</span><span class="cx">             continue;
</span><del>-        if (canShareStyleWithElement(downcast&lt;StyledElement&gt;(node)))
</del><ins>+        if (canShareStyleWithElement(downcast&lt;StyledElement&gt;(*node)))
</ins><span class="cx">             break;
</span><span class="cx">         if (count++ == cStyleSearchThreshold)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -679,7 +679,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     if (state.element() == state.document().cssTarget())
</span><span class="cx">         return nullptr;
</span><del>-    if (elementHasDirectionAuto(state.element()))
</del><ins>+    if (elementHasDirectionAuto(*state.element()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // Cache whether state.element is affected by any known class selectors.
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/css/StyleResolver.h        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx">     bool styleSharingCandidateMatchesRuleSet(RuleSet*);
</span><span class="cx">     Node* locateCousinList(Element* parent, unsigned&amp; visitedNodeCount) const;
</span><span class="cx">     StyledElement* findSiblingForStyleSharing(Node*, unsigned&amp; count) const;
</span><del>-    bool canShareStyleWithElement(StyledElement*) const;
</del><ins>+    bool canShareStyleWithElement(StyledElement&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;RenderStyle&gt; styleForKeyframe(const RenderStyle*, const StyleKeyframe*, KeyframeValue&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -530,7 +530,7 @@
</span><span class="cx"> 
</span><span class="cx">     void cacheBorderAndBackground();
</span><span class="cx"> 
</span><del>-    bool canShareStyleWithControl(StyledElement*) const;
</del><ins>+    bool canShareStyleWithControl(StyledElement&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     void applyProperty(CSSPropertyID, CSSValue*, SelectorChecker::LinkMatchMask = SelectorChecker::MatchDefault, const MatchResult* = nullptr);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; resolvedVariableValue(CSSPropertyID, const CSSVariableDependentValue&amp;);
</span><span class="lines">@@ -559,7 +559,7 @@
</span><span class="cx">     void sweepMatchedPropertiesCache();
</span><span class="cx"> 
</span><span class="cx">     bool classNamesAffectedByRules(const SpaceSplitString&amp;) const;
</span><del>-    bool sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement*) const;
</del><ins>+    bool sharingCandidateHasIdenticalStyleAffectingAttributes(StyledElement&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     unsigned m_matchedPropertiesCacheAdditionsSinceLastSweep;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -357,15 +357,6 @@
</span><span class="cx">     return this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLInputElement* Node::toInputElement()
-{
-    // If one of the below ASSERTs trigger, you are calling this function
-    // directly or indirectly from a constructor or destructor of this object.
-    // Don't do this!
-    ASSERT(!(isHTMLElement() &amp;&amp; hasTagName(inputTag)));
-    return 0;
-}
-
</del><span class="cx"> String Node::nodeValue() const
</span><span class="cx"> {
</span><span class="cx">     return String();
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/dom/Node.h        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -512,8 +512,6 @@
</span><span class="cx">     WEBCORE_EXPORT unsigned short compareDocumentPosition(Node*);
</span><span class="cx"> 
</span><span class="cx">     virtual Node* toNode() override;
</span><del>-    virtual HTMLInputElement* toInputElement();
-    const HTMLInputElement* toInputElement() const { return const_cast&lt;Node*&gt;(this)-&gt;toInputElement(); }
</del><span class="cx"> 
</span><span class="cx">     virtual EventTargetInterface eventTargetInterface() const override;
</span><span class="cx">     virtual ScriptExecutionContext* scriptExecutionContext() const override final; // Implemented in Document.h
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -858,7 +858,7 @@
</span><span class="cx">     auto* renderer = node-&gt;renderer();
</span><span class="cx">     if (!(renderer ? renderer-&gt;isBR() : node-&gt;hasTagName(brTag)))
</span><span class="cx">         return false;
</span><del>-    return emitsOriginalText || !(node-&gt;isInShadowTree() &amp;&amp; node-&gt;shadowHost()-&gt;toInputElement());
</del><ins>+    return emitsOriginalText || !(node-&gt;isInShadowTree() &amp;&amp; is&lt;HTMLInputElement&gt;(*node-&gt;shadowHost()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool hasHeaderTag(HTMLElement&amp; element)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -66,8 +66,6 @@
</span><span class="cx">     static Ref&lt;HTMLInputElement&gt; create(const QualifiedName&amp;, Document&amp;, HTMLFormElement*, bool createdByParser);
</span><span class="cx">     virtual ~HTMLInputElement();
</span><span class="cx"> 
</span><del>-    virtual HTMLInputElement* toInputElement() override final { return this; }
-
</del><span class="cx">     WEBCORE_EXPORT virtual bool shouldAutocomplete() const override final;
</span><span class="cx"> 
</span><span class="cx">     // For ValidityState
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlRadioNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/RadioNodeList.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/RadioNodeList.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/html/RadioNodeList.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -50,20 +50,22 @@
</span><span class="cx">     ownerNode().nodeLists()-&gt;removeCacheWithAtomicName(this, m_name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline HTMLInputElement* toRadioButtonInputElement(Node* node)
</del><ins>+static inline HTMLInputElement* toRadioButtonInputElement(Node&amp; node)
</ins><span class="cx"> {
</span><del>-    ASSERT(node-&gt;isElementNode());
-    HTMLInputElement* inputElement = node-&gt;toInputElement();
-    if (!inputElement || !inputElement-&gt;isRadioButton() || inputElement-&gt;value().isEmpty())
-        return 0;
-    return inputElement;
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(node))
+        return nullptr;
+
+    auto&amp; inputElement = downcast&lt;HTMLInputElement&gt;(node);
+    if (!inputElement.isRadioButton() || inputElement.value().isEmpty())
+        return nullptr;
+    return &amp;inputElement;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String RadioNodeList::value() const
</span><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; length(); ++i) {
-        Node* node = item(i);
-        const HTMLInputElement* inputElement = toRadioButtonInputElement(node);
</del><ins>+    auto length = this-&gt;length();
+    for (unsigned i = 0; i &lt; length; ++i) {
+        auto* inputElement = toRadioButtonInputElement(*item(i));
</ins><span class="cx">         if (!inputElement || !inputElement-&gt;checked())
</span><span class="cx">             continue;
</span><span class="cx">         return inputElement-&gt;value();
</span><span class="lines">@@ -73,9 +75,9 @@
</span><span class="cx"> 
</span><span class="cx"> void RadioNodeList::setValue(const String&amp; value)
</span><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; length(); ++i) {
-        Node* node = item(i);
-        HTMLInputElement* inputElement = toRadioButtonInputElement(node);
</del><ins>+    auto length = this-&gt;length();
+    for (unsigned i = 0; i &lt; length; ++i) {
+        auto* inputElement = toRadioButtonInputElement(*item(i));
</ins><span class="cx">         if (!inputElement || inputElement-&gt;value() != value)
</span><span class="cx">             continue;
</span><span class="cx">         inputElement-&gt;setChecked(true);
</span><span class="lines">@@ -104,10 +106,8 @@
</span><span class="cx">     if (!is&lt;HTMLObjectElement&gt;(testElement) &amp;&amp; !is&lt;HTMLFormControlElement&gt;(testElement))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (HTMLInputElement* inputElement = testElement.toInputElement()) {
-        if (inputElement-&gt;isImageButton())
-            return false;
-    }
</del><ins>+    if (is&lt;HTMLInputElement&gt;(testElement) &amp;&amp; downcast&lt;HTMLInputElement&gt;(testElement).isImageButton())
+        return false;
</ins><span class="cx"> 
</span><span class="cx">     return checkElementMatchesRadioNodeListFilter(testElement);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowSliderThumbElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -55,20 +55,20 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-inline static Decimal sliderPosition(HTMLInputElement* element)
</del><ins>+inline static Decimal sliderPosition(HTMLInputElement&amp; element)
</ins><span class="cx"> {
</span><del>-    const StepRange stepRange(element-&gt;createStepRange(RejectAny));
-    const Decimal oldValue = parseToDecimalForNumberType(element-&gt;value(), stepRange.defaultValue());
</del><ins>+    const StepRange stepRange(element.createStepRange(RejectAny));
+    const Decimal oldValue = parseToDecimalForNumberType(element.value(), stepRange.defaultValue());
</ins><span class="cx">     return stepRange.proportionFromValue(stepRange.clampValue(oldValue));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline static bool hasVerticalAppearance(HTMLInputElement* input)
</del><ins>+inline static bool hasVerticalAppearance(HTMLInputElement&amp; input)
</ins><span class="cx"> {
</span><del>-    ASSERT(input-&gt;renderer());
-    const RenderStyle&amp; sliderStyle = input-&gt;renderer()-&gt;style();
</del><ins>+    ASSERT(input.renderer());
+    const RenderStyle&amp; sliderStyle = input.renderer()-&gt;style();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    if (sliderStyle.appearance() == MediaVolumeSliderPart &amp;&amp; input-&gt;renderer()-&gt;theme().usesVerticalVolumeSlider())
</del><ins>+    if (sliderStyle.appearance() == MediaVolumeSliderPart &amp;&amp; input.renderer()-&gt;theme().usesVerticalVolumeSlider())
</ins><span class="cx">         return true;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -126,11 +126,12 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderSliderContainer::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&amp; computedValues) const
</span><span class="cx"> {
</span><del>-    HTMLInputElement* input = element()-&gt;shadowHost()-&gt;toInputElement();
</del><ins>+    ASSERT(element()-&gt;shadowHost());
+    auto&amp; input = downcast&lt;HTMLInputElement&gt;(*element()-&gt;shadowHost());
</ins><span class="cx">     bool isVertical = hasVerticalAppearance(input);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATALIST_ELEMENT)
</span><del>-    if (input-&gt;renderer()-&gt;isSlider() &amp;&amp; !isVertical &amp;&amp; input-&gt;list()) {
</del><ins>+    if (input.renderer()-&gt;isSlider() &amp;&amp; !isVertical &amp;&amp; input.list()) {
</ins><span class="cx">         int offsetFromCenter = theme().sliderTickOffsetFromTrackCenter();
</span><span class="cx">         LayoutUnit trackHeight = 0;
</span><span class="cx">         if (offsetFromCenter &lt; 0)
</span><span class="lines">@@ -154,7 +155,8 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderSliderContainer::layout()
</span><span class="cx"> {
</span><del>-    HTMLInputElement* input = element()-&gt;shadowHost()-&gt;toInputElement();
</del><ins>+    ASSERT(element()-&gt;shadowHost());
+    auto&amp; input = downcast&lt;HTMLInputElement&gt;(*element()-&gt;shadowHost());
</ins><span class="cx">     bool isVertical = hasVerticalAppearance(input);
</span><span class="cx">     style().setFlexDirection(isVertical ? FlowColumn : FlowRow);
</span><span class="cx">     TextDirection oldTextDirection = style().direction();
</span><span class="lines">@@ -165,8 +167,8 @@
</span><span class="cx">         style().setDirection(LTR);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderBox* thumb = input-&gt;sliderThumbElement() ? input-&gt;sliderThumbElement()-&gt;renderBox() : 0;
-    RenderBox* track = input-&gt;sliderTrackElement() ? input-&gt;sliderTrackElement()-&gt;renderBox() : 0;
</del><ins>+    RenderBox* thumb = input.sliderThumbElement() ? input.sliderThumbElement()-&gt;renderBox() : nullptr;
+    RenderBox* track = input.sliderTrackElement() ? input.sliderTrackElement()-&gt;renderBox() : nullptr;
</ins><span class="cx">     // Force a layout to reset the position of the thumb so the code below doesn't move the thumb to the wrong place.
</span><span class="cx">     // FIXME: Make a custom Render class for the track and move the thumb positioning code there.
</span><span class="cx">     if (track)
</span><span class="lines">@@ -261,7 +263,7 @@
</span><span class="cx">     RenderBox&amp; inputRenderer = downcast&lt;RenderBox&gt;(*input-&gt;renderer());
</span><span class="cx">     RenderBox&amp; trackRenderer = *trackElement-&gt;renderBox();
</span><span class="cx"> 
</span><del>-    bool isVertical = hasVerticalAppearance(input.get());
</del><ins>+    bool isVertical = hasVerticalAppearance(*input);
</ins><span class="cx">     bool isLeftToRightDirection = renderBox()-&gt;style().isLeftToRightDirection();
</span><span class="cx">     
</span><span class="cx">     LayoutPoint offset(inputRenderer.absoluteToLocal(absolutePoint, UseTransforms));
</span><span class="lines">@@ -569,8 +571,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes.
</span><span class="cx">     // So, shadowHost() must be an HTMLInputElement.
</span><del>-    Element* host = shadowHost();
-    return host ? host-&gt;toInputElement() : 0;
</del><ins>+    return downcast&lt;HTMLInputElement&gt;(shadowHost());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const AtomicString&amp; sliderThumbShadowPseudoId()
</span><span class="lines">@@ -644,13 +645,14 @@
</span><span class="cx">     DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, mediaSliderContainer, (&quot;-webkit-media-slider-container&quot;, AtomicString::ConstructFromLiteral));
</span><span class="cx">     DEPRECATED_DEFINE_STATIC_LOCAL(const AtomicString, sliderContainer, (&quot;-webkit-slider-container&quot;, AtomicString::ConstructFromLiteral));
</span><span class="cx"> 
</span><del>-    HTMLInputElement* input = shadowHost()-&gt;toInputElement();
-    if (!input)
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(*shadowHost()))
</ins><span class="cx">         return sliderContainer;
</span><del>-    if (!input-&gt;renderer())
</del><ins>+
+    auto&amp; input = downcast&lt;HTMLInputElement&gt;(*shadowHost());
+    if (!input.renderer())
</ins><span class="cx">         return emptyAtom;
</span><span class="cx"> 
</span><del>-    const RenderStyle&amp; sliderStyle = input-&gt;renderer()-&gt;style();
</del><ins>+    const RenderStyle&amp; sliderStyle = input.renderer()-&gt;style();
</ins><span class="cx">     switch (sliderStyle.appearance()) {
</span><span class="cx">     case MediaSliderPart:
</span><span class="cx">     case MediaSliderThumbPart:
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -421,9 +421,9 @@
</span><span class="cx">     if (unloadEventPolicy != UnloadEventPolicyNone) {
</span><span class="cx">         if (m_frame.document()) {
</span><span class="cx">             if (m_didCallImplicitClose &amp;&amp; !m_wasUnloadEventEmitted) {
</span><del>-                Element* currentFocusedElement = m_frame.document()-&gt;focusedElement();
-                if (currentFocusedElement &amp;&amp; currentFocusedElement-&gt;toInputElement())
-                    currentFocusedElement-&gt;toInputElement()-&gt;endEditing();
</del><ins>+                auto* currentFocusedElement = m_frame.document()-&gt;focusedElement();
+                if (is&lt;HTMLInputElement&gt;(currentFocusedElement))
+                    downcast&lt;HTMLInputElement&gt;(*currentFocusedElement).endEditing();
</ins><span class="cx">                 if (m_pageDismissalEventBeingDispatched == PageDismissalType::None) {
</span><span class="cx">                     if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) {
</span><span class="cx">                         m_pageDismissalEventBeingDispatched = PageDismissalType::PageHide;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/page/DragController.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -281,17 +281,20 @@
</span><span class="cx">     return dragOperation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static HTMLInputElement* asFileInput(Node* node)
</del><ins>+static HTMLInputElement* asFileInput(Node&amp; node)
</ins><span class="cx"> {
</span><del>-    ASSERT(node);
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(node))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    HTMLInputElement* inputElement = node-&gt;toInputElement();
</del><ins>+    auto* inputElement = &amp;downcast&lt;HTMLInputElement&gt;(node);
</ins><span class="cx"> 
</span><span class="cx">     // If this is a button inside of the a file input, move up to the file input.
</span><del>-    if (inputElement &amp;&amp; inputElement-&gt;isTextButton() &amp;&amp; is&lt;ShadowRoot&gt;(inputElement-&gt;treeScope().rootNode()))
-        inputElement = downcast&lt;ShadowRoot&gt;(inputElement-&gt;treeScope().rootNode()).host()-&gt;toInputElement();
</del><ins>+    if (inputElement-&gt;isTextButton() &amp;&amp; is&lt;ShadowRoot&gt;(inputElement-&gt;treeScope().rootNode())) {
+        auto&amp; host = *downcast&lt;ShadowRoot&gt;(inputElement-&gt;treeScope().rootNode()).host();
+        inputElement = is&lt;HTMLInputElement&gt;(host) ? &amp;downcast&lt;HTMLInputElement&gt;(host) : nullptr;
+    }
</ins><span class="cx"> 
</span><del>-    return inputElement &amp;&amp; inputElement-&gt;isFileUpload() ? inputElement : 0;
</del><ins>+    return inputElement &amp;&amp; inputElement-&gt;isFileUpload() ? inputElement : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This can return null if an empty document is loaded.
</span><span class="lines">@@ -355,7 +358,7 @@
</span><span class="cx">         if (!element)
</span><span class="cx">             return false;
</span><span class="cx">         
</span><del>-        HTMLInputElement* elementAsFileInput = asFileInput(element);
</del><ins>+        HTMLInputElement* elementAsFileInput = asFileInput(*element);
</ins><span class="cx">         if (m_fileInputElementUnderMouse != elementAsFileInput) {
</span><span class="cx">             if (m_fileInputElementUnderMouse)
</span><span class="cx">                 m_fileInputElementUnderMouse-&gt;setCanReceiveDroppedFiles(false);
</span><span class="lines">@@ -565,7 +568,7 @@
</span><span class="cx">     if (!result.innerNonSharedNode())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (dragData.containsFiles() &amp;&amp; asFileInput(result.innerNonSharedNode()))
</del><ins>+    if (dragData.containsFiles() &amp;&amp; asFileInput(*result.innerNonSharedNode()))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;HTMLPlugInElement&gt;(*result.innerNonSharedNode())) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderButtoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderButton.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderButton.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/rendering/RenderButton.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderButton::hasLineIfEmpty() const
</span><span class="cx"> {
</span><del>-    return formControlElement().toInputElement();
</del><ins>+    return is&lt;HTMLInputElement&gt;(formControlElement());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderButton::addChild(RenderObject* newChild, RenderObject* beforeChild)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTheme.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -785,26 +785,12 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderTheme::isChecked(const RenderObject&amp; o) const
</span><span class="cx"> {
</span><del>-    if (!o.node())
-        return false;
-
-    HTMLInputElement* inputElement = o.node()-&gt;toInputElement();
-    if (!inputElement)
-        return false;
-
-    return inputElement-&gt;shouldAppearChecked();
</del><ins>+    return is&lt;HTMLInputElement&gt;(o.node()) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*o.node()).shouldAppearChecked();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderTheme::isIndeterminate(const RenderObject&amp; o) const
</span><span class="cx"> {
</span><del>-    if (!o.node())
-        return false;
-
-    HTMLInputElement* inputElement = o.node()-&gt;toInputElement();
-    if (!inputElement)
-        return false;
-
-    return inputElement-&gt;shouldAppearIndeterminate();
</del><ins>+    return is&lt;HTMLInputElement&gt;(o.node()) &amp;&amp; downcast&lt;HTMLInputElement&gt;(*o.node()).shouldAppearIndeterminate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderTheme::isEnabled(const RenderObject&amp; renderer) const
</span><span class="lines">@@ -993,20 +979,16 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTheme::paintSliderTicks(const RenderObject&amp; o, const PaintInfo&amp; paintInfo, const IntRect&amp; rect)
</span><span class="cx"> {
</span><del>-    Node* node = o.node();
-    if (!node)
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(o.node()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    HTMLInputElement* input = node-&gt;toInputElement();
-    if (!input)
-        return;
-
-    HTMLDataListElement* dataList = downcast&lt;HTMLDataListElement&gt;(input-&gt;list());
</del><ins>+    auto&amp; input = downcast&lt;HTMLInputElement&gt;(*o.node());
+    auto* dataList = downcast&lt;HTMLDataListElement&gt;(input.list());
</ins><span class="cx">     if (!dataList)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    double min = input-&gt;minimum();
-    double max = input-&gt;maximum();
</del><ins>+    double min = input.minimum();
+    double max = input.maximum();
</ins><span class="cx">     ControlPart part = o.style().appearance();
</span><span class="cx">     // We don't support ticks on alternate sliders like MediaVolumeSliders.
</span><span class="cx">     if (part !=  SliderHorizontalPart &amp;&amp; part != SliderVerticalPart)
</span><span class="lines">@@ -1014,7 +996,7 @@
</span><span class="cx">     bool isHorizontal = part ==  SliderHorizontalPart;
</span><span class="cx"> 
</span><span class="cx">     IntSize thumbSize;
</span><del>-    const RenderObject* thumbRenderer = input-&gt;sliderThumbElement()-&gt;renderer();
</del><ins>+    const RenderObject* thumbRenderer = input.sliderThumbElement()-&gt;renderer();
</ins><span class="cx">     if (thumbRenderer) {
</span><span class="cx">         const RenderStyle&amp; thumbStyle = thumbRenderer-&gt;style();
</span><span class="cx">         int thumbWidth = thumbStyle.width().intValue();
</span><span class="lines">@@ -1029,7 +1011,7 @@
</span><span class="cx">     int tickRegionSideMargin = 0;
</span><span class="cx">     int tickRegionWidth = 0;
</span><span class="cx">     IntRect trackBounds;
</span><del>-    RenderObject* trackRenderer = input-&gt;sliderTrackElement()-&gt;renderer();
</del><ins>+    RenderObject* trackRenderer = input.sliderTrackElement()-&gt;renderer();
</ins><span class="cx">     // We can ignoring transforms because transform is handled by the graphics context.
</span><span class="cx">     if (trackRenderer)
</span><span class="cx">         trackBounds = trackRenderer-&gt;absoluteBoundingBoxRectIgnoringTransforms();
</span><span class="lines">@@ -1059,9 +1041,9 @@
</span><span class="cx">         ASSERT(is&lt;HTMLOptionElement&gt;(*node));
</span><span class="cx">         HTMLOptionElement&amp; optionElement = downcast&lt;HTMLOptionElement&gt;(*node);
</span><span class="cx">         String value = optionElement.value();
</span><del>-        if (!input-&gt;isValidValue(value))
</del><ins>+        if (!input.isValidValue(value))
</ins><span class="cx">             continue;
</span><del>-        double parsedValue = parseToDoubleForNumberType(input-&gt;sanitizeValue(value));
</del><ins>+        double parsedValue = parseToDoubleForNumberType(input.sanitizeValue(value));
</ins><span class="cx">         double tickFraction = (parsedValue - min) / (max - min);
</span><span class="cx">         double tickRatio = isHorizontal &amp;&amp; o.style().isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction;
</span><span class="cx">         double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (191326 => 191327)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-10-20 02:43:59 UTC (rev 191326)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-10-20 03:29:34 UTC (rev 191327)
</span><span class="lines">@@ -1188,8 +1188,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (HTMLInputElement* inputElement = textField-&gt;toInputElement())
-        return inputElement-&gt;lastChangeWasUserEdit();
</del><ins>+    if (is&lt;HTMLInputElement&gt;(*textField))
+        return downcast&lt;HTMLInputElement&gt;(*textField).lastChangeWasUserEdit();
</ins><span class="cx"> 
</span><span class="cx">     if (is&lt;HTMLTextAreaElement&gt;(*textField))
</span><span class="cx">         return downcast&lt;HTMLTextAreaElement&gt;(*textField).lastChangeWasUserEdit();
</span><span class="lines">@@ -1205,11 +1205,12 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (HTMLInputElement* inputElement = element-&gt;toInputElement())
-        return inputElement-&gt;shouldAutocomplete();
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(*element)) {
+        ec = INVALID_NODE_TYPE_ERR;
+        return false;
+    }
</ins><span class="cx"> 
</span><del>-    ec = INVALID_NODE_TYPE_ERR;
-    return false;
</del><ins>+    return downcast&lt;HTMLInputElement&gt;(*element).shouldAutocomplete();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::setEditingValue(Element* element, const String&amp; value, ExceptionCode&amp; ec)
</span><span class="lines">@@ -1219,33 +1220,42 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    HTMLInputElement* inputElement = element-&gt;toInputElement();
-    if (!inputElement) {
</del><ins>+    if (!is&lt;HTMLInputElement&gt;(*element)) {
</ins><span class="cx">         ec = INVALID_NODE_TYPE_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inputElement-&gt;setEditingValue(value);
</del><ins>+    downcast&lt;HTMLInputElement&gt;(*element).setEditingValue(value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::setAutofilled(Element* element, bool enabled, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    HTMLInputElement* inputElement = element-&gt;toInputElement();
-    if (!inputElement) {
</del><ins>+    if (!element) {
</ins><span class="cx">         ec = INVALID_ACCESS_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    inputElement-&gt;setAutoFilled(enabled);
</del><ins>+
+    if (!is&lt;HTMLInputElement&gt;(*element)) {
+        ec = INVALID_NODE_TYPE_ERR;
+        return;
+    }
+
+    downcast&lt;HTMLInputElement&gt;(*element).setAutoFilled(enabled);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::setShowAutoFillButton(Element* element, bool show, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    HTMLInputElement* inputElement = element-&gt;toInputElement();
-    if (!inputElement) {
</del><ins>+    if (!element) {
</ins><span class="cx">         ec = INVALID_ACCESS_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    inputElement-&gt;setShowAutoFillButton(show);
</del><ins>+
+    if (!is&lt;HTMLInputElement&gt;(*element)) {
+        ec = INVALID_NODE_TYPE_ERR;
+        return;
+    }
+
+    downcast&lt;HTMLInputElement&gt;(*element).setShowAutoFillButton(show);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>