<!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>[174132] 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/174132">174132</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-30 16:03:38 -0700 (Tue, 30 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use is&lt;&gt;() / downcast&lt;&gt;() for ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=137270

Reviewed by Andreas Kling.

Use is&lt;&gt;() / downcast&lt;&gt;() for ContainerNode instead of isContainerNode()
/ toContainerNode(). Also kill the NODE_TYPE_CASTS() macro as this was
its last user.

No new tests, no behavior change.

* dom/ContainerNode.cpp:
(WebCore::collectChildrenAndRemoveFromOldParent):
(WebCore::ContainerNode::willRemoveChild):
(WebCore::cloneChildNodesAvoidingDeleteButton):
* dom/ContainerNode.h:
(WebCore::Node::countChildNodes):
(WebCore::Node::traverseToChildAt):
(WebCore::Node::firstChild):
(WebCore::Node::lastChild):
(isType):
(WebCore::isContainerNode): Deleted.
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
(WebCore::ChildNodeInsertionNotifier::notify):
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument):
(WebCore::ChildNodeRemovalNotifier::notify):
* dom/Node.cpp:
(WebCore::Node::childNodes):
(WebCore::Node::insertBefore):
(WebCore::Node::replaceChild):
(WebCore::Node::removeChild):
(WebCore::Node::appendChild):
(WebCore::Node::setTextContent):
* dom/Node.h:
* dom/Range.cpp:
(WebCore::Range::surroundContents):
* dom/TextNodeTraversal.cpp:
(WebCore::TextNodeTraversal::contentsAsString):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNodeAt):
* editing/Editor.cpp:
(WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):
* html/parser/HTMLConstructionSite.h:
(WebCore::HTMLConstructionSiteTask::oldParent):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::querySelector):
(WebCore::InspectorDOMAgent::querySelectorAll):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeAlgorithmscpp">trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeAlgorithmsh">trunk/Source/WebCore/dom/ContainerNodeAlgorithms.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="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextNodeTraversalcpp">trunk/Source/WebCore/dom/TextNodeTraversal.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaDocumentcpp">trunk/Source/WebCore/html/MediaDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSiteh">trunk/Source/WebCore/html/parser/HTMLConstructionSite.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorNodeFindercpp">trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/ChangeLog        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2014-09-30  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for ContainerNode
+        https://bugs.webkit.org/show_bug.cgi?id=137270
+
+        Reviewed by Andreas Kling.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for ContainerNode instead of isContainerNode()
+        / toContainerNode(). Also kill the NODE_TYPE_CASTS() macro as this was
+        its last user.
+
+        No new tests, no behavior change.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::collectChildrenAndRemoveFromOldParent):
+        (WebCore::ContainerNode::willRemoveChild):
+        (WebCore::cloneChildNodesAvoidingDeleteButton):
+        * dom/ContainerNode.h:
+        (WebCore::Node::countChildNodes):
+        (WebCore::Node::traverseToChildAt):
+        (WebCore::Node::firstChild):
+        (WebCore::Node::lastChild):
+        (isType):
+        (WebCore::isContainerNode): Deleted.
+        * dom/ContainerNodeAlgorithms.cpp:
+        (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
+        (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
+        * dom/ContainerNodeAlgorithms.h:
+        (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
+        (WebCore::ChildNodeInsertionNotifier::notify):
+        (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument):
+        (WebCore::ChildNodeRemovalNotifier::notify):
+        * dom/Node.cpp:
+        (WebCore::Node::childNodes):
+        (WebCore::Node::insertBefore):
+        (WebCore::Node::replaceChild):
+        (WebCore::Node::removeChild):
+        (WebCore::Node::appendChild):
+        (WebCore::Node::setTextContent):
+        * dom/Node.h:
+        * dom/Range.cpp:
+        (WebCore::Range::surroundContents):
+        * dom/TextNodeTraversal.cpp:
+        (WebCore::TextNodeTraversal::contentsAsString):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyBlockStyle):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::insertNodeAt):
+        * editing/Editor.cpp:
+        (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::defaultEventHandler):
+        * html/parser/HTMLConstructionSite.h:
+        (WebCore::HTMLConstructionSiteTask::oldParent):
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::querySelector):
+        (WebCore::InspectorDOMAgent::querySelectorAll):
+        * inspector/InspectorNodeFinder.cpp:
+        (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
+
</ins><span class="cx"> 2014-09-30  Roger Fong  &lt;roger_fong@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Windows] Remove an errant WTFLogAlways that makes test output hard to read and generates stderr output.
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void collectChildrenAndRemoveFromOldParent(Node&amp; node, NodeVector&amp; nodes, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!node.isDocumentFragment()) {
</del><ins>+    if (!is&lt;DocumentFragment&gt;(node)) {
</ins><span class="cx">         nodes.append(node);
</span><span class="cx">         if (ContainerNode* oldParent = node.parentNode())
</span><span class="cx">             oldParent-&gt;removeChild(&amp;node, ec);
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     getChildNodes(node, nodes);
</span><del>-    toContainerNode(node).removeChildren();
</del><ins>+    downcast&lt;DocumentFragment&gt;(node).removeChildren();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: This function must get a new name.
</span><span class="lines">@@ -483,8 +483,8 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     child.document().nodeWillBeRemoved(&amp;child); // e.g. mutation event listener can create a new range.
</span><del>-    if (child.isContainerNode())
-        disconnectSubframesIfNeeded(toContainerNode(child), RootAndDescendants);
</del><ins>+    if (is&lt;ContainerNode&gt;(child))
+        disconnectSubframesIfNeeded(downcast&lt;ContainerNode&gt;(child), RootAndDescendants);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void willRemoveChildren(ContainerNode&amp; container)
</span><span class="lines">@@ -786,8 +786,8 @@
</span><span class="cx">         RefPtr&lt;Node&gt; clonedChild = child-&gt;cloneNode(false);
</span><span class="cx">         clonedParent-&gt;appendChild(clonedChild, ec);
</span><span class="cx"> 
</span><del>-        if (!ec &amp;&amp; child-&gt;isContainerNode())
-            cloneChildNodesAvoidingDeleteButton(toContainerNode(child), toContainerNode(clonedChild.get()), deleteButtonContainerElement);
</del><ins>+        if (!ec &amp;&amp; is&lt;ContainerNode&gt;(child))
+            cloneChildNodesAvoidingDeleteButton(downcast&lt;ContainerNode&gt;(child), downcast&lt;ContainerNode&gt;(clonedChild.get()), deleteButtonContainerElement);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -173,11 +173,6 @@
</span><span class="cx">     Node* m_lastChild;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline bool isContainerNode(const Node&amp; node) { return node.isContainerNode(); }
-void isContainerNode(const ContainerNode&amp;); // Catch unnecessary runtime check of type known at compile time.
-
-NODE_TYPE_CASTS(ContainerNode)
-
</del><span class="cx"> inline ContainerNode::ContainerNode(Document&amp; document, ConstructionType type)
</span><span class="cx">     : Node(document, type)
</span><span class="cx">     , m_firstChild(0)
</span><span class="lines">@@ -187,30 +182,30 @@
</span><span class="cx"> 
</span><span class="cx"> inline unsigned Node::countChildNodes() const
</span><span class="cx"> {
</span><del>-    if (!isContainerNode())
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this))
</ins><span class="cx">         return 0;
</span><del>-    return toContainerNode(this)-&gt;countChildNodes();
</del><ins>+    return downcast&lt;ContainerNode&gt;(*this).countChildNodes();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Node* Node::traverseToChildAt(unsigned index) const
</span><span class="cx"> {
</span><del>-    if (!isContainerNode())
-        return 0;
-    return toContainerNode(this)-&gt;traverseToChildAt(index);
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this))
+        return nullptr;
+    return downcast&lt;ContainerNode&gt;(*this).traverseToChildAt(index);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Node* Node::firstChild() const
</span><span class="cx"> {
</span><del>-    if (!isContainerNode())
-        return 0;
-    return toContainerNode(this)-&gt;firstChild();
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this))
+        return nullptr;
+    return downcast&lt;ContainerNode&gt;(*this).firstChild();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Node* Node::lastChild() const
</span><span class="cx"> {
</span><del>-    if (!isContainerNode())
-        return 0;
-    return toContainerNode(this)-&gt;lastChild();
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this))
+        return nullptr;
+    return downcast&lt;ContainerNode&gt;(*this).lastChild();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Node* Node::highestAncestor() const
</span><span class="lines">@@ -316,4 +311,8 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ContainerNode)
+    static bool isType(const WebCore::Node&amp; node) { return node.isContainerNode(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // ContainerNode_h
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeAlgorithmscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx"> void ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree(ContainerNode&amp; node)
</span><span class="cx"> {
</span><span class="cx">     for (Node* child = node.firstChild(); child; child = child-&gt;nextSibling()) {
</span><del>-        if (child-&gt;isContainerNode())
-            notifyNodeInsertedIntoTree(*toContainerNode(child));
</del><ins>+        if (is&lt;ContainerNode&gt;(child))
+            notifyNodeInsertedIntoTree(downcast&lt;ContainerNode&gt;(*child));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (ShadowRoot* root = node.shadowRoot())
</span><span class="lines">@@ -86,8 +86,8 @@
</span><span class="cx"> void ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree(ContainerNode&amp; node)
</span><span class="cx"> {
</span><span class="cx">     for (Node* child = node.firstChild(); child; child = child-&gt;nextSibling()) {
</span><del>-        if (child-&gt;isContainerNode())
-            notifyNodeRemovedFromTree(*toContainerNode(child));
</del><ins>+        if (is&lt;ContainerNode&gt;(child))
+            notifyNodeRemovedFromTree(downcast&lt;ContainerNode&gt;(*child));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!is&lt;Element&gt;(node))
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeAlgorithmsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -199,8 +199,8 @@
</span><span class="cx">     ASSERT(m_insertionPoint.inDocument());
</span><span class="cx">     if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(m_insertionPoint))
</span><span class="cx">         m_postInsertionNotificationTargets.append(node);
</span><del>-    if (node.isContainerNode())
-        notifyDescendantInsertedIntoDocument(toContainerNode(node));
</del><ins>+    if (is&lt;ContainerNode&gt;(node))
+        notifyDescendantInsertedIntoDocument(downcast&lt;ContainerNode&gt;(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree(ContainerNode&amp; node)
</span><span class="lines">@@ -226,8 +226,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_insertionPoint.inDocument())
</span><span class="cx">         notifyNodeInsertedIntoDocument(node);
</span><del>-    else if (node.isContainerNode())
-        notifyNodeInsertedIntoTree(toContainerNode(node));
</del><ins>+    else if (is&lt;ContainerNode&gt;(node))
+        notifyNodeInsertedIntoTree(downcast&lt;ContainerNode&gt;(node));
</ins><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; m_postInsertionNotificationTargets.size(); ++i)
</span><span class="cx">         m_postInsertionNotificationTargets[i]-&gt;didNotifySubtreeInsertions(&amp;m_insertionPoint);
</span><span class="lines">@@ -239,8 +239,8 @@
</span><span class="cx">     ASSERT(m_insertionPoint.inDocument());
</span><span class="cx">     node.removedFrom(m_insertionPoint);
</span><span class="cx"> 
</span><del>-    if (node.isContainerNode())
-        notifyDescendantRemovedFromDocument(toContainerNode(node));
</del><ins>+    if (is&lt;ContainerNode&gt;(node))
+        notifyDescendantRemovedFromDocument(downcast&lt;ContainerNode&gt;(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromTree(ContainerNode&amp; node)
</span><span class="lines">@@ -257,8 +257,8 @@
</span><span class="cx">     if (node.inDocument()) {
</span><span class="cx">         notifyNodeRemovedFromDocument(node);
</span><span class="cx">         node.document().notifyRemovePendingSheetIfNeeded();
</span><del>-    } else if (node.isContainerNode())
-        notifyNodeRemovedFromTree(toContainerNode(node));
</del><ins>+    } else if (is&lt;ContainerNode&gt;(node))
+        notifyNodeRemovedFromTree(downcast&lt;ContainerNode&gt;(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> enum SubframeDisconnectPolicy {
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -405,8 +405,8 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;NodeList&gt; Node::childNodes()
</span><span class="cx"> {
</span><del>-    if (isContainerNode())
-        return ensureRareData().ensureNodeLists().ensureChildNodeList(toContainerNode(*this));
</del><ins>+    if (is&lt;ContainerNode&gt;(*this))
+        return ensureRareData().ensureNodeLists().ensureChildNodeList(downcast&lt;ContainerNode&gt;(*this));
</ins><span class="cx">     return ensureRareData().ensureNodeLists().ensureEmptyChildNodeList(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -428,38 +428,38 @@
</span><span class="cx"> 
</span><span class="cx"> bool Node::insertBefore(PassRefPtr&lt;Node&gt; newChild, Node* refChild, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this)) {
</ins><span class="cx">         ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return toContainerNode(this)-&gt;insertBefore(newChild, refChild, ec);
</del><ins>+    return downcast&lt;ContainerNode&gt;(*this).insertBefore(newChild, refChild, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Node::replaceChild(PassRefPtr&lt;Node&gt; newChild, Node* oldChild, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this)) {
</ins><span class="cx">         ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return toContainerNode(this)-&gt;replaceChild(newChild, oldChild, ec);
</del><ins>+    return downcast&lt;ContainerNode&gt;(*this).replaceChild(newChild, oldChild, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Node::removeChild(Node* oldChild, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this)) {
</ins><span class="cx">         ec = NOT_FOUND_ERR;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return toContainerNode(this)-&gt;removeChild(oldChild, ec);
</del><ins>+    return downcast&lt;ContainerNode&gt;(*this).removeChild(oldChild, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Node::appendChild(PassRefPtr&lt;Node&gt; newChild, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(*this)) {
</ins><span class="cx">         ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return toContainerNode(this)-&gt;appendChild(newChild, ec);
</del><ins>+    return downcast&lt;ContainerNode&gt;(*this).appendChild(newChild, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Node::remove(ExceptionCode&amp; ec)
</span><span class="lines">@@ -1363,7 +1363,7 @@
</span><span class="cx">         case ENTITY_NODE:
</span><span class="cx">         case ENTITY_REFERENCE_NODE:
</span><span class="cx">         case DOCUMENT_FRAGMENT_NODE: {
</span><del>-            Ref&lt;ContainerNode&gt; container(*toContainerNode(this));
</del><ins>+            Ref&lt;ContainerNode&gt; container(downcast&lt;ContainerNode&gt;(*this));
</ins><span class="cx">             ChildListMutationScope mutation(container.get());
</span><span class="cx">             container-&gt;removeChildren();
</span><span class="cx">             if (!text.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/Node.h        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -740,10 +740,6 @@
</span><span class="cx">     return parentNode();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME: This should be removed and all uses should be replaced with SPECIALIZE_TYPE_TRAITS_*().
-#define NODE_TYPE_CASTS(ToClassName) \
-    TYPE_CASTS_BASE(ToClassName, Node, node, WebCore::is##ToClassName(*node), WebCore::is##ToClassName(node))
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/Range.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -1480,7 +1480,7 @@
</span><span class="cx"> 
</span><span class="cx">     ec = 0;
</span><span class="cx">     while (Node* n = newParent-&gt;firstChild()) {
</span><del>-        toContainerNode(newParent.get())-&gt;removeChild(n, ec);
</del><ins>+        downcast&lt;ContainerNode&gt;(*newParent).removeChild(n, ec);
</ins><span class="cx">         if (ec)
</span><span class="cx">             return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextNodeTraversalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TextNodeTraversal.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TextNodeTraversal.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/dom/TextNodeTraversal.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -49,8 +49,8 @@
</span><span class="cx"> {
</span><span class="cx">     if (is&lt;Text&gt;(root))
</span><span class="cx">         return downcast&lt;Text&gt;(*root).data();
</span><del>-    if (root-&gt;isContainerNode())
-        return contentsAsString(toContainerNode(root));
</del><ins>+    if (is&lt;ContainerNode&gt;(root))
+        return contentsAsString(downcast&lt;ContainerNode&gt;(root));
</ins><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -291,8 +291,8 @@
</span><span class="cx">         nextParagraphStart = endOfParagraph(paragraphStart).next();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    startRange = TextIterator::rangeFromLocationAndLength(toContainerNode(scope), startIndex, 0, true);
-    endRange = TextIterator::rangeFromLocationAndLength(toContainerNode(scope), endIndex, 0, true);
</del><ins>+    startRange = TextIterator::rangeFromLocationAndLength(downcast&lt;ContainerNode&gt;(scope), startIndex, 0, true);
+    endRange = TextIterator::rangeFromLocationAndLength(downcast&lt;ContainerNode&gt;(scope), endIndex, 0, true);
</ins><span class="cx">     if (startRange &amp;&amp; endRange)
</span><span class="cx">         updateStartEnd(startRange-&gt;startPosition(), endRange-&gt;startPosition());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx">         if (child)
</span><span class="cx">             insertNodeBefore(insertChild, child);
</span><span class="cx">         else
</span><del>-            appendNode(insertChild, toContainerNode(refChild));
</del><ins>+            appendNode(insertChild, downcast&lt;ContainerNode&gt;(refChild));
</ins><span class="cx">     } else if (caretMinOffset(refChild) &gt;= offset)
</span><span class="cx">         insertNodeBefore(insertChild, refChild);
</span><span class="cx">     else if (is&lt;Text&gt;(refChild) &amp;&amp; caretMaxOffset(refChild) &gt; offset) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -2468,7 +2468,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void correctSpellcheckingPreservingTextCheckingParagraph(TextCheckingParagraph&amp; paragraph, PassRefPtr&lt;Range&gt; rangeToReplace, const String&amp; replacement, int resultLocation, int resultLength)
</span><span class="cx"> {
</span><del>-    ContainerNode* scope = toContainerNode(highestAncestor(paragraph.paragraphRange()-&gt;startContainer()));
</del><ins>+    ContainerNode* scope = downcast&lt;ContainerNode&gt;(highestAncestor(paragraph.paragraphRange()-&gt;startContainer()));
</ins><span class="cx"> 
</span><span class="cx">     size_t paragraphLocation;
</span><span class="cx">     size_t paragraphLength;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaDocument.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaDocument.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/html/MediaDocument.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -201,9 +201,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!targetNode-&gt;isContainerNode())
</del><ins>+    if (!is&lt;ContainerNode&gt;(targetNode))
</ins><span class="cx">         return;
</span><del>-    ContainerNode&amp; targetContainer = toContainerNode(*targetNode);
</del><ins>+    ContainerNode&amp; targetContainer = downcast&lt;ContainerNode&gt;(*targetNode);
</ins><span class="cx">     if (event-&gt;type() == eventNames().keydownEvent &amp;&amp; event-&gt;isKeyboardEvent()) {
</span><span class="cx">         HTMLVideoElement* video = descendentVideoElement(targetContainer);
</span><span class="cx">         if (!video)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSiteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.h (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.h        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.h        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">         // It's sort of ugly, but we store the |oldParent| in the |child| field
</span><span class="cx">         // of the task so that we don't bloat the HTMLConstructionSiteTask
</span><span class="cx">         // object in the common case of the Insert operation.
</span><del>-        return toContainerNode(child.get());
</del><ins>+        return downcast&lt;ContainerNode&gt;(child.get());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Operation operation;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -502,8 +502,8 @@
</span><span class="cx">         else
</span><span class="cx">             clonedNode = node-&gt;cloneNode(false);
</span><span class="cx">         parent-&gt;appendChild(clonedNode, ASSERT_NO_EXCEPTION);
</span><del>-        if (node-&gt;isContainerNode())
-            copyWebVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clonedNode.get()));
</del><ins>+        if (is&lt;ContainerNode&gt;(node))
+            copyWebVTTNodeToDOMTree(downcast&lt;ContainerNode&gt;(node), downcast&lt;ContainerNode&gt;(clonedNode.get()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -520,13 +520,13 @@
</span><span class="cx">     Node* node = assertNode(errorString, nodeId);
</span><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><del>-    if (!node-&gt;isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(node)) {
</ins><span class="cx">         assertElement(errorString, nodeId);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    RefPtr&lt;Element&gt; element = toContainerNode(node)-&gt;querySelector(selectors, ec);
</del><ins>+    RefPtr&lt;Element&gt; element = downcast&lt;ContainerNode&gt;(*node).querySelector(selectors, ec);
</ins><span class="cx">     if (ec) {
</span><span class="cx">         *errorString = &quot;DOM Error while querying&quot;;
</span><span class="cx">         return;
</span><span class="lines">@@ -541,13 +541,13 @@
</span><span class="cx">     Node* node = assertNode(errorString, nodeId);
</span><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><del>-    if (!node-&gt;isContainerNode()) {
</del><ins>+    if (!is&lt;ContainerNode&gt;(node)) {
</ins><span class="cx">         assertElement(errorString, nodeId);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    RefPtr&lt;NodeList&gt; nodes = toContainerNode(node)-&gt;querySelectorAll(selectors, ec);
</del><ins>+    RefPtr&lt;NodeList&gt; nodes = downcast&lt;ContainerNode&gt;(*node).querySelectorAll(selectors, ec);
</ins><span class="cx">     if (ec) {
</span><span class="cx">         *errorString = &quot;DOM Error while querying&quot;;
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNodeFindercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp (174131 => 174132)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-09-30 22:59:28 UTC (rev 174131)
+++ trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-09-30 23:03:38 UTC (rev 174132)
</span><span class="lines">@@ -157,11 +157,11 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorNodeFinder::searchUsingCSSSelectors(Node* parentNode)
</span><span class="cx"> {
</span><del>-    if (!parentNode-&gt;isContainerNode())
</del><ins>+    if (!is&lt;ContainerNode&gt;(parentNode))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    RefPtr&lt;NodeList&gt; nodeList = toContainerNode(parentNode)-&gt;querySelectorAll(m_whitespaceTrimmedQuery, ec);
</del><ins>+    RefPtr&lt;NodeList&gt; nodeList = downcast&lt;ContainerNode&gt;(*parentNode).querySelectorAll(m_whitespaceTrimmedQuery, ec);
</ins><span class="cx">     if (ec || !nodeList)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>