<!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<>() / downcast<>() for ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=137270
Reviewed by Andreas Kling.
Use is<>() / downcast<>() 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for ContainerNode
+ https://bugs.webkit.org/show_bug.cgi?id=137270
+
+ Reviewed by Andreas Kling.
+
+ Use is<>() / downcast<>() 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 <roger_fong@apple.com>
</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& node, NodeVector& nodes, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!node.isDocumentFragment()) {
</del><ins>+ if (!is<DocumentFragment>(node)) {
</ins><span class="cx"> nodes.append(node);
</span><span class="cx"> if (ContainerNode* oldParent = node.parentNode())
</span><span class="cx"> oldParent->removeChild(&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<DocumentFragment>(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(&child); // e.g. mutation event listener can create a new range.
</span><del>- if (child.isContainerNode())
- disconnectSubframesIfNeeded(toContainerNode(child), RootAndDescendants);
</del><ins>+ if (is<ContainerNode>(child))
+ disconnectSubframesIfNeeded(downcast<ContainerNode>(child), RootAndDescendants);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void willRemoveChildren(ContainerNode& container)
</span><span class="lines">@@ -786,8 +786,8 @@
</span><span class="cx"> RefPtr<Node> clonedChild = child->cloneNode(false);
</span><span class="cx"> clonedParent->appendChild(clonedChild, ec);
</span><span class="cx">
</span><del>- if (!ec && child->isContainerNode())
- cloneChildNodesAvoidingDeleteButton(toContainerNode(child), toContainerNode(clonedChild.get()), deleteButtonContainerElement);
</del><ins>+ if (!ec && is<ContainerNode>(child))
+ cloneChildNodesAvoidingDeleteButton(downcast<ContainerNode>(child), downcast<ContainerNode>(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& node) { return node.isContainerNode(); }
-void isContainerNode(const ContainerNode&); // Catch unnecessary runtime check of type known at compile time.
-
-NODE_TYPE_CASTS(ContainerNode)
-
</del><span class="cx"> inline ContainerNode::ContainerNode(Document& 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<ContainerNode>(*this))
</ins><span class="cx"> return 0;
</span><del>- return toContainerNode(this)->countChildNodes();
</del><ins>+ return downcast<ContainerNode>(*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)->traverseToChildAt(index);
</del><ins>+ if (!is<ContainerNode>(*this))
+ return nullptr;
+ return downcast<ContainerNode>(*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)->firstChild();
</del><ins>+ if (!is<ContainerNode>(*this))
+ return nullptr;
+ return downcast<ContainerNode>(*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)->lastChild();
</del><ins>+ if (!is<ContainerNode>(*this))
+ return nullptr;
+ return downcast<ContainerNode>(*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& 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& node)
</span><span class="cx"> {
</span><span class="cx"> for (Node* child = node.firstChild(); child; child = child->nextSibling()) {
</span><del>- if (child->isContainerNode())
- notifyNodeInsertedIntoTree(*toContainerNode(child));
</del><ins>+ if (is<ContainerNode>(child))
+ notifyNodeInsertedIntoTree(downcast<ContainerNode>(*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& node)
</span><span class="cx"> {
</span><span class="cx"> for (Node* child = node.firstChild(); child; child = child->nextSibling()) {
</span><del>- if (child->isContainerNode())
- notifyNodeRemovedFromTree(*toContainerNode(child));
</del><ins>+ if (is<ContainerNode>(child))
+ notifyNodeRemovedFromTree(downcast<ContainerNode>(*child));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!is<Element>(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<ContainerNode>(node))
+ notifyDescendantInsertedIntoDocument(downcast<ContainerNode>(node));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline void ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree(ContainerNode& 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<ContainerNode>(node))
+ notifyNodeInsertedIntoTree(downcast<ContainerNode>(node));
</ins><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < m_postInsertionNotificationTargets.size(); ++i)
</span><span class="cx"> m_postInsertionNotificationTargets[i]->didNotifySubtreeInsertions(&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<ContainerNode>(node))
+ notifyDescendantRemovedFromDocument(downcast<ContainerNode>(node));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline void ChildNodeRemovalNotifier::notifyNodeRemovedFromTree(ContainerNode& 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<ContainerNode>(node))
+ notifyNodeRemovedFromTree(downcast<ContainerNode>(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<NodeList> Node::childNodes()
</span><span class="cx"> {
</span><del>- if (isContainerNode())
- return ensureRareData().ensureNodeLists().ensureChildNodeList(toContainerNode(*this));
</del><ins>+ if (is<ContainerNode>(*this))
+ return ensureRareData().ensureNodeLists().ensureChildNodeList(downcast<ContainerNode>(*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<Node> newChild, Node* refChild, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(*this)) {
</ins><span class="cx"> ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>- return toContainerNode(this)->insertBefore(newChild, refChild, ec);
</del><ins>+ return downcast<ContainerNode>(*this).insertBefore(newChild, refChild, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(*this)) {
</ins><span class="cx"> ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>- return toContainerNode(this)->replaceChild(newChild, oldChild, ec);
</del><ins>+ return downcast<ContainerNode>(*this).replaceChild(newChild, oldChild, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Node::removeChild(Node* oldChild, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(*this)) {
</ins><span class="cx"> ec = NOT_FOUND_ERR;
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>- return toContainerNode(this)->removeChild(oldChild, ec);
</del><ins>+ return downcast<ContainerNode>(*this).removeChild(oldChild, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Node::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec)
</span><span class="cx"> {
</span><del>- if (!isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(*this)) {
</ins><span class="cx"> ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>- return toContainerNode(this)->appendChild(newChild, ec);
</del><ins>+ return downcast<ContainerNode>(*this).appendChild(newChild, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Node::remove(ExceptionCode& 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<ContainerNode> container(*toContainerNode(this));
</del><ins>+ Ref<ContainerNode> container(downcast<ContainerNode>(*this));
</ins><span class="cx"> ChildListMutationScope mutation(container.get());
</span><span class="cx"> container->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->firstChild()) {
</span><del>- toContainerNode(newParent.get())->removeChild(n, ec);
</del><ins>+ downcast<ContainerNode>(*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<Text>(root))
</span><span class="cx"> return downcast<Text>(*root).data();
</span><del>- if (root->isContainerNode())
- return contentsAsString(toContainerNode(root));
</del><ins>+ if (is<ContainerNode>(root))
+ return contentsAsString(downcast<ContainerNode>(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<ContainerNode>(scope), startIndex, 0, true);
+ endRange = TextIterator::rangeFromLocationAndLength(downcast<ContainerNode>(scope), endIndex, 0, true);
</ins><span class="cx"> if (startRange && endRange)
</span><span class="cx"> updateStartEnd(startRange->startPosition(), endRange->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<ContainerNode>(refChild));
</ins><span class="cx"> } else if (caretMinOffset(refChild) >= offset)
</span><span class="cx"> insertNodeBefore(insertChild, refChild);
</span><span class="cx"> else if (is<Text>(refChild) && caretMaxOffset(refChild) > 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& paragraph, PassRefPtr<Range> rangeToReplace, const String& replacement, int resultLocation, int resultLength)
</span><span class="cx"> {
</span><del>- ContainerNode* scope = toContainerNode(highestAncestor(paragraph.paragraphRange()->startContainer()));
</del><ins>+ ContainerNode* scope = downcast<ContainerNode>(highestAncestor(paragraph.paragraphRange()->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->isContainerNode())
</del><ins>+ if (!is<ContainerNode>(targetNode))
</ins><span class="cx"> return;
</span><del>- ContainerNode& targetContainer = toContainerNode(*targetNode);
</del><ins>+ ContainerNode& targetContainer = downcast<ContainerNode>(*targetNode);
</ins><span class="cx"> if (event->type() == eventNames().keydownEvent && event->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<ContainerNode>(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->cloneNode(false);
</span><span class="cx"> parent->appendChild(clonedNode, ASSERT_NO_EXCEPTION);
</span><del>- if (node->isContainerNode())
- copyWebVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clonedNode.get()));
</del><ins>+ if (is<ContainerNode>(node))
+ copyWebVTTNodeToDOMTree(downcast<ContainerNode>(node), downcast<ContainerNode>(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->isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(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<Element> element = toContainerNode(node)->querySelector(selectors, ec);
</del><ins>+ RefPtr<Element> element = downcast<ContainerNode>(*node).querySelector(selectors, ec);
</ins><span class="cx"> if (ec) {
</span><span class="cx"> *errorString = "DOM Error while querying";
</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->isContainerNode()) {
</del><ins>+ if (!is<ContainerNode>(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<NodeList> nodes = toContainerNode(node)->querySelectorAll(selectors, ec);
</del><ins>+ RefPtr<NodeList> nodes = downcast<ContainerNode>(*node).querySelectorAll(selectors, ec);
</ins><span class="cx"> if (ec) {
</span><span class="cx"> *errorString = "DOM Error while querying";
</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->isContainerNode())
</del><ins>+ if (!is<ContainerNode>(parentNode))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- RefPtr<NodeList> nodeList = toContainerNode(parentNode)->querySelectorAll(m_whitespaceTrimmedQuery, ec);
</del><ins>+ RefPtr<NodeList> nodeList = downcast<ContainerNode>(*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>