<!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>[174068] trunk/Source</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/174068">174068</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-09-29 10:20:18 -0700 (Mon, 29 Sep 2014)</dd>
</dl>

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

Reviewed by Darin Adler.

Use the new is&lt;&gt;() / downcast&lt;&gt;() functions for Text Nodes instead of
isText() / toText().

Source/WebCore:

No new tests, no behavior change.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
* dom/Node.cpp:
(WebCore::Node::normalize):
* dom/Position.cpp:
(WebCore::Position::containerNode):
(WebCore::Position::containerText):
(WebCore::Position::isRenderedCharacter):
(WebCore::Position::leadingWhitespacePosition):
* dom/Range.cpp:
(WebCore::Range::insertNode):
(WebCore::Range::getBorderAndTextQuads):
* dom/Text.cpp:
(WebCore::earliestLogicallyAdjacentTextNode):
(WebCore::latestLogicallyAdjacentTextNode):
* dom/Text.h:
(WebCore::isText):
* dom/TextNodeTraversal.cpp:
(WebCore::TextNodeTraversal::contentsAsString):
* dom/TextNodeTraversal.h:
(WebCore::TextNodeTraversal::firstTextChildTemplate):
(WebCore::TextNodeTraversal::firstTextWithinTemplate):
(WebCore::TextNodeTraversal::traverseNextTextTemplate):
(WebCore::TextNodeTraversal::nextSibling):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition):
(WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitTextAtEnd):
(WebCore::ApplyStyleCommand::splitTextElementAtEnd):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNodeAt):
(WebCore::CompositeEditCommand::positionOutsideTabSpan):
(WebCore::CompositeEditCommand::canRebalance):
(WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::deleteInsignificantText):
(WebCore::CompositeEditCommand::removePlaceholderAt):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::fixupWhitespace):
(WebCore::DeleteSelectionCommand::doApply):
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::insertTab):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendStartMarkup):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
* editing/VisibleUnits.cpp:
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* editing/htmlediting.cpp:
(WebCore::lineBreakExistsAtPosition):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::renderedText):
(WebCore::replaceChildrenWithFragment):
(WebCore::replaceChildrenWithText):
* html/HTMLElement.cpp:
(WebCore::mergeWithNextTextNode):
(WebCore::HTMLElement::setOuterHTML):
(WebCore::HTMLElement::setOuterText):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent):
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::innerTextValue):
(WebCore::positionForIndex):
(WebCore::HTMLTextFormControlElement::indexForPosition):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeValue):
* rendering/RenderCombineText.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges):
* rendering/RenderText.cpp:
(WebCore::RenderText::textNode):
* rendering/svg/RenderSVGInlineText.h:
* style/StyleResolveTree.cpp:
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::attachChildren):
(WebCore::Style::attachDistributedChildren):
(WebCore::Style::detachDistributedChildren):
(WebCore::Style::detachChildren):
(WebCore::Style::resolveShadowTree):
(WebCore::Style::resolveTree):

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
(-[WKDOMText data]):
(-[WKDOMText setData:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsgobjectWebKitDOMPrivatecpp">trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSelectorCheckercpp">trunk/Source/WebCore/css/SelectorChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoredomCharacterDatacpp">trunk/Source/WebCore/dom/CharacterData.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextcpp">trunk/Source/WebCore/dom/Text.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTexth">trunk/Source/WebCore/dom/Text.h</a></li>
<li><a href="#trunkSourceWebCoredomTextNodeTraversalcpp">trunk/Source/WebCore/dom/TextNodeTraversal.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextNodeTraversalh">trunk/Source/WebCore/dom/TextNodeTraversal.h</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyBlockElementCommandcpp">trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingBreakBlockquoteCommandcpp">trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertLineBreakCommandcpp">trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp">trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandcpp">trunk/Source/WebCore/editing/InsertTextCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingMarkupAccumulatorcpp">trunk/Source/WebCore/editing/MarkupAccumulator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitscpp">trunk/Source/WebCore/editing/VisibleUnits.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingcpp">trunk/Source/WebCore/editing/htmlediting.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionElementcpp">trunk/Source/WebCore/html/HTMLOptionElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLScriptElementcpp">trunk/Source/WebCore/html/HTMLScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTitleElementcpp">trunk/Source/WebCore/html/HTMLTitleElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderCombineTexth">trunk/Source/WebCore/rendering/RenderCombineText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowThreadcpp">trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGInlineTexth">trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMTextmm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/ChangeLog        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1,5 +1,141 @@
</span><span class="cx"> 2014-09-29  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use the new is&lt;&gt;() / downcast&lt;&gt;() for Text Nodes
+        https://bugs.webkit.org/show_bug.cgi?id=137188
+
+        Reviewed by Darin Adler.
+
+        Use the new is&lt;&gt;() / downcast&lt;&gt;() functions for Text Nodes instead of
+        isText() / toText().
+
+        No new tests, no behavior change.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::textUnderElement):
+        * bindings/gobject/WebKitDOMPrivate.cpp:
+        (WebKit::wrap):
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne):
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::parserAppendData):
+        (WebCore::CharacterData::setDataAndUpdate):
+        * dom/ContainerNode.cpp:
+        (WebCore::destroyRenderTreeIfNeeded):
+        * dom/Node.cpp:
+        (WebCore::Node::normalize):
+        * dom/Position.cpp:
+        (WebCore::Position::containerNode):
+        (WebCore::Position::containerText):
+        (WebCore::Position::isRenderedCharacter):
+        (WebCore::Position::leadingWhitespacePosition):
+        * dom/Range.cpp:
+        (WebCore::Range::insertNode):
+        (WebCore::Range::getBorderAndTextQuads):
+        * dom/Text.cpp:
+        (WebCore::earliestLogicallyAdjacentTextNode):
+        (WebCore::latestLogicallyAdjacentTextNode):
+        * dom/Text.h:
+        (WebCore::isText):
+        * dom/TextNodeTraversal.cpp:
+        (WebCore::TextNodeTraversal::contentsAsString):
+        * dom/TextNodeTraversal.h:
+        (WebCore::TextNodeTraversal::firstTextChildTemplate):
+        (WebCore::TextNodeTraversal::firstTextWithinTemplate):
+        (WebCore::TextNodeTraversal::traverseNextTextTemplate):
+        (WebCore::TextNodeTraversal::nextSibling):
+        * editing/ApplyBlockElementCommand.cpp:
+        (WebCore::isNewLineAtPosition):
+        (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::splitTextAtEnd):
+        (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
+        (WebCore::ApplyStyleCommand::joinChildTextNodes):
+        * editing/BreakBlockquoteCommand.cpp:
+        (WebCore::BreakBlockquoteCommand::doApply):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::insertNodeAt):
+        (WebCore::CompositeEditCommand::positionOutsideTabSpan):
+        (WebCore::CompositeEditCommand::canRebalance):
+        (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
+        (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
+        (WebCore::CompositeEditCommand::deleteInsignificantText):
+        (WebCore::CompositeEditCommand::removePlaceholderAt):
+        (WebCore::CompositeEditCommand::cleanupAfterDeletion):
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::handleGeneralDelete):
+        (WebCore::DeleteSelectionCommand::fixupWhitespace):
+        (WebCore::DeleteSelectionCommand::doApply):
+        * editing/Editor.cpp:
+        (WebCore::Editor::setComposition):
+        * editing/InsertLineBreakCommand.cpp:
+        (WebCore::InsertLineBreakCommand::doApply):
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply):
+        * editing/InsertTextCommand.cpp:
+        (WebCore::InsertTextCommand::insertTab):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::appendStartMarkup):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
+        (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
+        (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
+        (WebCore::ReplaceSelectionCommand::insertAsListItems):
+        (WebCore::ReplaceSelectionCommand::performTrivialReplace):
+        * editing/TextIterator.cpp:
+        (WebCore::TextIterator::handleTextNode):
+        (WebCore::TextIterator::handleTextBox):
+        (WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
+        * editing/VisibleUnits.cpp:
+        (WebCore::startPositionForLine):
+        (WebCore::endPositionForLine):
+        (WebCore::startOfParagraph):
+        (WebCore::endOfParagraph):
+        * editing/htmlediting.cpp:
+        (WebCore::lineBreakExistsAtPosition):
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::renderedText):
+        (WebCore::replaceChildrenWithFragment):
+        (WebCore::replaceChildrenWithText):
+        * html/HTMLElement.cpp:
+        (WebCore::mergeWithNextTextNode):
+        (WebCore::HTMLElement::setOuterHTML):
+        (WebCore::HTMLElement::setOuterText):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::hasFallbackContent):
+        (WebCore::HTMLObjectElement::updateDocNamedItem):
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::setText):
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::setText):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::innerTextValue):
+        (WebCore::positionForIndex):
+        (WebCore::HTMLTextFormControlElement::indexForPosition):
+        (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
+        * html/HTMLTitleElement.cpp:
+        (WebCore::HTMLTitleElement::setText):
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::setNodeValue):
+        * rendering/RenderCombineText.h:
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::getRanges):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::textNode):
+        * rendering/svg/RenderSVGInlineText.h:
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
+        (WebCore::Style::attachChildren):
+        (WebCore::Style::attachDistributedChildren):
+        (WebCore::Style::detachDistributedChildren):
+        (WebCore::Style::detachChildren):
+        (WebCore::Style::resolveShadowTree):
+        (WebCore::Style::resolveTree):
+
+2014-09-29  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Remove remaining uses of NODE_TYPE_CASTS() from html/
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137172
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1640,8 +1640,8 @@
</span><span class="cx"> String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMode mode) const
</span><span class="cx"> {
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    if (node &amp;&amp; node-&gt;isTextNode())
-        return toText(node)-&gt;wholeText();
</del><ins>+    if (node &amp;&amp; is&lt;Text&gt;(node))
+        return downcast&lt;Text&gt;(*node).wholeText();
</ins><span class="cx"> 
</span><span class="cx">     // The render tree should be stable before going ahead. Otherwise, further uses of the
</span><span class="cx">     // TextIterator will force a layout update, potentially altering the accessibility tree
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgobjectWebKitDOMPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     case Node::ATTRIBUTE_NODE:
</span><span class="cx">         return WEBKIT_DOM_NODE(wrapAttr(static_cast&lt;Attr*&gt;(node)));
</span><span class="cx">     case Node::TEXT_NODE:
</span><del>-        return WEBKIT_DOM_NODE(wrapText(toText(node)));
</del><ins>+        return WEBKIT_DOM_NODE(wrapText(downcast&lt;Text&gt;(node)));
</ins><span class="cx">     case Node::CDATA_SECTION_NODE:
</span><span class="cx">         return WEBKIT_DOM_NODE(wrapCDATASection(static_cast&lt;CDATASection*&gt;(node)));
</span><span class="cx">     case Node::ENTITY_REFERENCE_NODE:
</span></span></pre></div>
<a id="trunkSourceWebCorecssSelectorCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SelectorChecker.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -555,14 +555,14 @@
</span><span class="cx">         case CSSSelector::PseudoClassEmpty:
</span><span class="cx">             {
</span><span class="cx">                 bool result = true;
</span><del>-                for (Node* n = element-&gt;firstChild(); n; n = n-&gt;nextSibling()) {
-                    if (n-&gt;isElementNode()) {
</del><ins>+                for (Node* node = element-&gt;firstChild(); node; node = node-&gt;nextSibling()) {
+                    if (node-&gt;isElementNode()) {
</ins><span class="cx">                         result = false;
</span><span class="cx">                         break;
</span><span class="cx">                     }
</span><del>-                    if (n-&gt;isTextNode()) {
-                        Text* textNode = toText(n);
-                        if (!textNode-&gt;data().isEmpty()) {
</del><ins>+                    if (is&lt;Text&gt;(node)) {
+                        Text&amp; textNode = downcast&lt;Text&gt;(*node);
+                        if (!textNode.data().isEmpty()) {
</ins><span class="cx">                             result = false;
</span><span class="cx">                             break;
</span><span class="cx">                         }
</span></span></pre></div>
<a id="trunkSourceWebCoredomCharacterDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CharacterData.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CharacterData.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/CharacterData.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -87,9 +87,9 @@
</span><span class="cx">     else
</span><span class="cx">         m_data.append(string.characters16() + offset, characterLengthLimit);
</span><span class="cx"> 
</span><del>-    ASSERT(!renderer() || isTextNode());
-    if (isTextNode())
-        Style::updateTextRendererAfterContentChange(*toText(this), oldLength, 0);
</del><ins>+    ASSERT(!renderer() || is&lt;Text&gt;(this));
+    if (is&lt;Text&gt;(this))
+        Style::updateTextRendererAfterContentChange(downcast&lt;Text&gt;(*this), oldLength, 0);
</ins><span class="cx"> 
</span><span class="cx">     document().incDOMTreeVersion();
</span><span class="cx">     // We don't call dispatchModifiedEvent here because we don't want the
</span><span class="lines">@@ -194,9 +194,9 @@
</span><span class="cx">     String oldData = m_data;
</span><span class="cx">     m_data = newData;
</span><span class="cx"> 
</span><del>-    ASSERT(!renderer() || isTextNode());
-    if (isTextNode())
-        Style::updateTextRendererAfterContentChange(*toText(this), offsetOfReplacedData, oldLength);
</del><ins>+    ASSERT(!renderer() || is&lt;Text&gt;(this));
+    if (is&lt;Text&gt;(this))
+        Style::updateTextRendererAfterContentChange(downcast&lt;Text&gt;(*this), offsetOfReplacedData, oldLength);
</ins><span class="cx"> 
</span><span class="cx">     if (is&lt;ProcessingInstruction&gt;(this))
</span><span class="cx">         downcast&lt;ProcessingInstruction&gt;(*this).checkStyleSheet();
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -102,8 +102,8 @@
</span><span class="cx">         return;
</span><span class="cx">     if (child.isElementNode())
</span><span class="cx">         Style::detachRenderTree(toElement(child));
</span><del>-    else if (child.isTextNode())
-        Style::detachTextRenderer(toText(child));
</del><ins>+    else if (is&lt;Text&gt;(child))
+        Style::detachTextRenderer(downcast&lt;Text&gt;(child));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -489,7 +489,7 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RefPtr&lt;Text&gt; text = toText(node.get());
</del><ins>+        RefPtr&lt;Text&gt; text = downcast&lt;Text&gt;(node.get());
</ins><span class="cx"> 
</span><span class="cx">         // Remove empty text nodes.
</span><span class="cx">         if (!text-&gt;length()) {
</span><span class="lines">@@ -503,7 +503,7 @@
</span><span class="cx">         while (Node* nextSibling = node-&gt;nextSibling()) {
</span><span class="cx">             if (nextSibling-&gt;nodeType() != TEXT_NODE)
</span><span class="cx">                 break;
</span><del>-            RefPtr&lt;Text&gt; nextText = toText(nextSibling);
</del><ins>+            RefPtr&lt;Text&gt; nextText = downcast&lt;Text&gt;(nextSibling);
</ins><span class="cx"> 
</span><span class="cx">             // Remove empty text nodes.
</span><span class="cx">             if (!nextText-&gt;length()) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/Position.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> Node* Position::containerNode() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_anchorNode)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     switch (anchorType()) {
</span><span class="cx">     case PositionIsBeforeChildren:
</span><span class="lines">@@ -163,24 +163,24 @@
</span><span class="cx">         return findParent(m_anchorNode.get());
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Text* Position::containerText() const
</span><span class="cx"> {
</span><span class="cx">     switch (anchorType()) {
</span><span class="cx">     case PositionIsOffsetInAnchor:
</span><del>-        return m_anchorNode &amp;&amp; m_anchorNode-&gt;isTextNode() ? toText(m_anchorNode.get()) : 0;
</del><ins>+        return m_anchorNode &amp;&amp; is&lt;Text&gt;(*m_anchorNode) ? downcast&lt;Text&gt;(m_anchorNode.get()) : nullptr;
</ins><span class="cx">     case PositionIsBeforeAnchor:
</span><span class="cx">     case PositionIsAfterAnchor:
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     case PositionIsBeforeChildren:
</span><span class="cx">     case PositionIsAfterChildren:
</span><del>-        ASSERT(!m_anchorNode || !m_anchorNode-&gt;isTextNode());
-        return 0;
</del><ins>+        ASSERT(!m_anchorNode || !is&lt;Text&gt;(*m_anchorNode));
+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int Position::computeOffsetInContainerNode() const
</span><span class="lines">@@ -950,10 +950,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool Position::isRenderedCharacter() const
</span><span class="cx"> {
</span><del>-    if (isNull() || !deprecatedNode()-&gt;isTextNode())
</del><ins>+    if (isNull() || !is&lt;Text&gt;(deprecatedNode()))
</ins><span class="cx">         return false;
</span><span class="cx">         
</span><del>-    RenderText* renderer = toText(deprecatedNode())-&gt;renderer();
</del><ins>+    RenderText* renderer = downcast&lt;Text&gt;(*deprecatedNode()).renderer();
</ins><span class="cx">     if (!renderer)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="lines">@@ -1062,8 +1062,8 @@
</span><span class="cx">         return Position();
</span><span class="cx"> 
</span><span class="cx">     Position prev = previousCharacterPosition(affinity);
</span><del>-    if (prev != *this &amp;&amp; inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) &amp;&amp; prev.deprecatedNode()-&gt;isTextNode()) {
-        String string = toText(prev.deprecatedNode())-&gt;data();
</del><ins>+    if (prev != *this &amp;&amp; inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) &amp;&amp; is&lt;Text&gt;(prev.deprecatedNode())) {
+        String string = downcast&lt;Text&gt;(*prev.deprecatedNode()).data();
</ins><span class="cx">         UChar c = string[prev.deprecatedEditingOffset()];
</span><span class="cx">         if (considerNonCollapsibleWhitespace ? (isSpaceOrNewline(c) || c == noBreakSpace) : deprecatedIsCollapsibleWhitespace(c))
</span><span class="cx">             if (isEditablePosition(prev))
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/Range.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -978,7 +978,7 @@
</span><span class="cx">     // does not allow children of the type of newNode or if newNode is an ancestor of the container.
</span><span class="cx"> 
</span><span class="cx">     // an extra one here - if a text node is going to split, it must have a parent to insert into
</span><del>-    bool startIsText = m_start.container()-&gt;isTextNode();
</del><ins>+    bool startIsText = is&lt;Text&gt;(m_start.container());
</ins><span class="cx">     if (startIsText &amp;&amp; !m_start.container()-&gt;parentNode()) {
</span><span class="cx">         ec = HIERARCHY_REQUEST_ERR;
</span><span class="cx">         return;
</span><span class="lines">@@ -1040,7 +1040,7 @@
</span><span class="cx">     RefPtr&lt;Node&gt; container;
</span><span class="cx">     if (startIsText) {
</span><span class="cx">         container = m_start.container();
</span><del>-        RefPtr&lt;Text&gt; newText = toText(container.get())-&gt;splitText(m_start.offset(), ec);
</del><ins>+        RefPtr&lt;Text&gt; newText = downcast&lt;Text&gt;(*container).splitText(m_start.offset(), ec);
</ins><span class="cx">         if (ec)
</span><span class="cx">             return;
</span><span class="cx">         
</span><span class="lines">@@ -2232,8 +2232,8 @@
</span><span class="cx"> 
</span><span class="cx">                 quads.appendVector(elementQuads);
</span><span class="cx">             }
</span><del>-        } else if (node-&gt;isTextNode()) {
-            if (RenderObject* renderer = toText(node)-&gt;renderer()) {
</del><ins>+        } else if (is&lt;Text&gt;(node)) {
+            if (RenderObject* renderer = downcast&lt;Text&gt;(*node).renderer()) {
</ins><span class="cx">                 const RenderText&amp; renderText = toRenderText(*renderer);
</span><span class="cx">                 int startOffset = (node == startContainer) ? m_start.offset() : 0;
</span><span class="cx">                 int endOffset = (node == endContainer) ? m_end.offset() : INT_MAX;
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/Text.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -94,9 +94,9 @@
</span><span class="cx"> {
</span><span class="cx">     const Node* node = text;
</span><span class="cx">     while ((node = node-&gt;previousSibling())) {
</span><del>-        if (!node-&gt;isTextNode())
</del><ins>+        if (!is&lt;Text&gt;(node))
</ins><span class="cx">             break;
</span><del>-        text = toText(node);
</del><ins>+        text = downcast&lt;Text&gt;(node);
</ins><span class="cx">     }
</span><span class="cx">     return text;
</span><span class="cx"> }
</span><span class="lines">@@ -105,9 +105,9 @@
</span><span class="cx"> {
</span><span class="cx">     const Node* node = text;
</span><span class="cx">     while ((node = node-&gt;nextSibling())) {
</span><del>-        if (!node-&gt;isTextNode())
</del><ins>+        if (!is&lt;Text&gt;(node))
</ins><span class="cx">             break;
</span><del>-        text = toText(node);
</del><ins>+        text = downcast&lt;Text&gt;(node);
</ins><span class="cx">     }
</span><span class="cx">     return text;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.h (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.h        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/Text.h        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -74,12 +74,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline bool isText(const Node&amp; node) { return node.isTextNode(); }
-void isText(const Text&amp;); // Catch unnecessary runtime check of type known at compile time.
-void isText(const ContainerNode&amp;); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(Text)
+    static bool isText(const Node&amp; node) { return node.isTextNode(); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx"> 
</span><del>-NODE_TYPE_CASTS(Text)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // Text_h
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextNodeTraversalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TextNodeTraversal.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TextNodeTraversal.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/TextNodeTraversal.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx"> 
</span><span class="cx"> String contentsAsString(const Node* root)
</span><span class="cx"> {
</span><del>-    if (root-&gt;isTextNode())
-        return toText(root)-&gt;data();
</del><ins>+    if (is&lt;Text&gt;(root))
+        return downcast&lt;Text&gt;(*root).data();
</ins><span class="cx">     if (root-&gt;isContainerNode())
</span><span class="cx">         return contentsAsString(toContainerNode(root));
</span><span class="cx">     return String();
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextNodeTraversalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TextNodeTraversal.h (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TextNodeTraversal.h        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/dom/TextNodeTraversal.h        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -66,9 +66,9 @@
</span><span class="cx"> inline Text* firstTextChildTemplate(NodeType* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = current-&gt;firstChild();
</span><del>-    while (node &amp;&amp; !node-&gt;isTextNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Text&gt;(node))
</ins><span class="cx">         node = node-&gt;nextSibling();
</span><del>-    return toText(node);
</del><ins>+    return downcast&lt;Text&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> inline Text* firstChild(const Node* current) { return firstTextChildTemplate(current); }
</span><span class="cx"> inline Text* firstChild(const ContainerNode* current) { return firstTextChildTemplate(current); }
</span><span class="lines">@@ -77,9 +77,9 @@
</span><span class="cx"> inline Text* firstTextWithinTemplate(NodeType* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = current-&gt;firstChild();
</span><del>-    while (node &amp;&amp; !node-&gt;isTextNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Text&gt;(node))
</ins><span class="cx">         node = NodeTraversal::next(node, current);
</span><del>-    return toText(node);
</del><ins>+    return downcast&lt;Text&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> inline Text* firstWithin(const Node* current) { return firstTextWithinTemplate(current); }
</span><span class="cx"> inline Text* firstWithin(const ContainerNode* current) { return firstTextWithinTemplate(current); }
</span><span class="lines">@@ -88,9 +88,9 @@
</span><span class="cx"> inline Text* traverseNextTextTemplate(NodeType* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::next(current);
</span><del>-    while (node &amp;&amp; !node-&gt;isTextNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Text&gt;(node))
</ins><span class="cx">         node = NodeTraversal::next(node);
</span><del>-    return toText(node);
</del><ins>+    return downcast&lt;Text&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> inline Text* next(const Node* current) { return traverseNextTextTemplate(current); }
</span><span class="cx"> inline Text* next(const Text* current) { return traverseNextTextTemplate(current); }
</span><span class="lines">@@ -99,9 +99,9 @@
</span><span class="cx"> inline Text* traverseNextTextTemplate(NodeType* current, const Node* stayWithin)
</span><span class="cx"> {
</span><span class="cx">     Node* node = NodeTraversal::next(current, stayWithin);
</span><del>-    while (node &amp;&amp; !node-&gt;isTextNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Text&gt;(node))
</ins><span class="cx">         node = NodeTraversal::next(node, stayWithin);
</span><del>-    return toText(node);
</del><ins>+    return downcast&lt;Text&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> inline Text* next(const Node* current, const Node* stayWithin) { return traverseNextTextTemplate(current, stayWithin); }
</span><span class="cx"> inline Text* next(const Text* current, const Node* stayWithin) { return traverseNextTextTemplate(current, stayWithin); }
</span><span class="lines">@@ -109,9 +109,9 @@
</span><span class="cx"> inline Text* nextSibling(const Node* current)
</span><span class="cx"> {
</span><span class="cx">     Node* node = current-&gt;nextSibling();
</span><del>-    while (node &amp;&amp; !node-&gt;isTextNode())
</del><ins>+    while (node &amp;&amp; !is&lt;Text&gt;(node))
</ins><span class="cx">         node = node-&gt;nextSibling();
</span><del>-    return toText(node);
</del><ins>+    return downcast&lt;Text&gt;(node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyBlockElementCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/ApplyBlockElementCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -164,11 +164,11 @@
</span><span class="cx"> {
</span><span class="cx">     Node* textNode = position.containerNode();
</span><span class="cx">     int offset = position.offsetInContainerNode();
</span><del>-    if (!textNode || !textNode-&gt;isTextNode() || offset &lt; 0 || offset &gt;= textNode-&gt;maxCharacterOffset())
</del><ins>+    if (!textNode || !is&lt;Text&gt;(textNode) || offset &lt; 0 || offset &gt;= textNode-&gt;maxCharacterOffset())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><del>-    String textAtPosition = toText(textNode)-&gt;substringData(offset, 1, ec);
</del><ins>+    String textAtPosition = downcast&lt;Text&gt;(*textNode).substringData(offset, 1, ec);
</ins><span class="cx">     if (ec)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -267,20 +267,20 @@
</span><span class="cx">     // Avoid this by splitting &quot;\n&quot;
</span><span class="cx">     splitTextNode(text, 1);
</span><span class="cx"> 
</span><del>-    if (text == start.containerNode() &amp;&amp; text-&gt;previousSibling() &amp;&amp; text-&gt;previousSibling()-&gt;isTextNode()) {
</del><ins>+    if (text == start.containerNode() &amp;&amp; text-&gt;previousSibling() &amp;&amp; is&lt;Text&gt;(text-&gt;previousSibling())) {
</ins><span class="cx">         ASSERT(start.offsetInContainerNode() &lt; position.offsetInContainerNode());
</span><del>-        start = Position(toText(text-&gt;previousSibling()), start.offsetInContainerNode());
</del><ins>+        start = Position(downcast&lt;Text&gt;(text-&gt;previousSibling()), start.offsetInContainerNode());
</ins><span class="cx">     }
</span><del>-    if (text == end.containerNode() &amp;&amp; text-&gt;previousSibling() &amp;&amp; text-&gt;previousSibling()-&gt;isTextNode()) {
</del><ins>+    if (text == end.containerNode() &amp;&amp; text-&gt;previousSibling() &amp;&amp; is&lt;Text&gt;(text-&gt;previousSibling())) {
</ins><span class="cx">         ASSERT(end.offsetInContainerNode() &lt; position.offsetInContainerNode());
</span><del>-        end = Position(toText(text-&gt;previousSibling()), end.offsetInContainerNode());
</del><ins>+        end = Position(downcast&lt;Text&gt;(text-&gt;previousSibling()), end.offsetInContainerNode());
</ins><span class="cx">     }
</span><span class="cx">     if (text == m_endOfLastParagraph.containerNode()) {
</span><span class="cx">         if (m_endOfLastParagraph.offsetInContainerNode() &lt; position.offsetInContainerNode()) {
</span><span class="cx">             // We can only fix endOfLastParagraph if the previous node was still text and hasn't been modified by script.
</span><del>-            if (text-&gt;previousSibling()-&gt;isTextNode()
-                &amp;&amp; static_cast&lt;unsigned&gt;(m_endOfLastParagraph.offsetInContainerNode()) &lt;= toText(text-&gt;previousSibling())-&gt;length())
-                m_endOfLastParagraph = Position(toText(text-&gt;previousSibling()), m_endOfLastParagraph.offsetInContainerNode());
</del><ins>+            if (is&lt;Text&gt;(text-&gt;previousSibling())
+                &amp;&amp; static_cast&lt;unsigned&gt;(m_endOfLastParagraph.offsetInContainerNode()) &lt;= downcast&lt;Text&gt;(text-&gt;previousSibling())-&gt;length())
+                m_endOfLastParagraph = Position(downcast&lt;Text&gt;(text-&gt;previousSibling()), m_endOfLastParagraph.offsetInContainerNode());
</ins><span class="cx">         } else
</span><span class="cx">             m_endOfLastParagraph = Position(text.get(), m_endOfLastParagraph.offsetInContainerNode() - 1);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1201,17 +1201,17 @@
</span><span class="cx"> 
</span><span class="cx"> void ApplyStyleCommand::splitTextAtEnd(const Position&amp; start, const Position&amp; end)
</span><span class="cx"> {
</span><del>-    ASSERT(end.containerNode()-&gt;isTextNode());
</del><ins>+    ASSERT(is&lt;Text&gt;(end.containerNode()));
</ins><span class="cx"> 
</span><span class="cx">     bool shouldUpdateStart = start.anchorType() == Position::PositionIsOffsetInAnchor &amp;&amp; start.containerNode() == end.containerNode();
</span><del>-    Text* text = toText(end.deprecatedNode());
-    splitTextNode(text, end.offsetInContainerNode());
</del><ins>+    Text&amp; text = downcast&lt;Text&gt;(*end.deprecatedNode());
+    splitTextNode(&amp;text, end.offsetInContainerNode());
</ins><span class="cx"> 
</span><del>-    Node* prevNode = text-&gt;previousSibling();
-    if (!prevNode || !prevNode-&gt;isTextNode())
</del><ins>+    Node* prevNode = text.previousSibling();
+    if (!prevNode || !is&lt;Text&gt;(prevNode))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Position newStart = shouldUpdateStart ? Position(toText(prevNode), start.offsetInContainerNode()) : start;
</del><ins>+    Position newStart = shouldUpdateStart ? Position(downcast&lt;Text&gt;(prevNode), start.offsetInContainerNode()) : start;
</ins><span class="cx">     updateStartEnd(newStart, lastPositionInNode(prevNode));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1240,10 +1240,10 @@
</span><span class="cx">     if (!parentElement || !parentElement-&gt;previousSibling())
</span><span class="cx">         return;
</span><span class="cx">     Node* firstTextNode = parentElement-&gt;previousSibling()-&gt;lastChild();
</span><del>-    if (!firstTextNode || !firstTextNode-&gt;isTextNode())
</del><ins>+    if (!firstTextNode || !is&lt;Text&gt;(firstTextNode))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Position newStart = shouldUpdateStart ? Position(toText(firstTextNode), start.offsetInContainerNode()) : start;
</del><ins>+    Position newStart = shouldUpdateStart ? Position(downcast&lt;Text&gt;(firstTextNode), start.offsetInContainerNode()) : start;
</ins><span class="cx">     updateStartEnd(newStart, positionAfterNode(firstTextNode));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1528,15 +1528,15 @@
</span><span class="cx">     for (size_t i = 0; i &lt; textNodes.size(); ++i) {
</span><span class="cx">         Text* childText = textNodes[i].get();
</span><span class="cx">         Node* next = childText-&gt;nextSibling();
</span><del>-        if (!next || !next-&gt;isTextNode())
</del><ins>+        if (!next || !is&lt;Text&gt;(next))
</ins><span class="cx">             continue;
</span><span class="cx">     
</span><del>-        Text* nextText = toText(next);
</del><ins>+        Text&amp; nextText = downcast&lt;Text&gt;(*next);
</ins><span class="cx">         if (start.anchorType() == Position::PositionIsOffsetInAnchor &amp;&amp; next == start.containerNode())
</span><span class="cx">             newStart = Position(childText, childText-&gt;length() + start.offsetInContainerNode());
</span><span class="cx">         if (end.anchorType() == Position::PositionIsOffsetInAnchor &amp;&amp; next == end.containerNode())
</span><span class="cx">             newEnd = Position(childText, childText-&gt;length() + end.offsetInContainerNode());
</span><del>-        String textToMove = nextText-&gt;data();
</del><ins>+        String textToMove = nextText.data();
</ins><span class="cx">         insertTextIntoNode(childText, childText-&gt;length(), textToMove);
</span><span class="cx">         removeNode(next);
</span><span class="cx">         // don't move child node pointer. it may want to merge with more text nodes.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingBreakBlockquoteCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -106,13 +106,13 @@
</span><span class="cx">     Node* startNode = pos.deprecatedNode();
</span><span class="cx">         
</span><span class="cx">     // Split at pos if in the middle of a text node.
</span><del>-    if (startNode-&gt;isTextNode()) {
-        Text* textNode = toText(startNode);
-        if ((unsigned)pos.deprecatedEditingOffset() &gt;= textNode-&gt;length()) {
</del><ins>+    if (is&lt;Text&gt;(startNode)) {
+        Text&amp; textNode = downcast&lt;Text&gt;(*startNode);
+        if ((unsigned)pos.deprecatedEditingOffset() &gt;= textNode.length()) {
</ins><span class="cx">             startNode = NodeTraversal::next(startNode);
</span><span class="cx">             ASSERT(startNode);
</span><span class="cx">         } else if (pos.deprecatedEditingOffset() &gt; 0)
</span><del>-            splitTextNode(textNode, pos.deprecatedEditingOffset());
</del><ins>+            splitTextNode(&amp;textNode, pos.deprecatedEditingOffset());
</ins><span class="cx">     } else if (pos.deprecatedEditingOffset() &gt; 0) {
</span><span class="cx">         Node* childAtOffset = startNode-&gt;traverseToChildAt(pos.deprecatedEditingOffset());
</span><span class="cx">         startNode = childAtOffset ? childAtOffset : NodeTraversal::next(startNode);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -376,8 +376,8 @@
</span><span class="cx">             appendNode(insertChild, toContainerNode(refChild));
</span><span class="cx">     } else if (caretMinOffset(refChild) &gt;= offset)
</span><span class="cx">         insertNodeBefore(insertChild, refChild);
</span><del>-    else if (refChild-&gt;isTextNode() &amp;&amp; caretMaxOffset(refChild) &gt; offset) {
-        splitTextNode(toText(refChild), offset);
</del><ins>+    else if (is&lt;Text&gt;(refChild) &amp;&amp; caretMaxOffset(refChild) &gt; offset) {
+        splitTextNode(downcast&lt;Text&gt;(refChild), offset);
</ins><span class="cx"> 
</span><span class="cx">         // Mutation events (bug 22634) from the text node insertion may have removed the refChild
</span><span class="cx">         if (!refChild-&gt;inDocument())
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx">     if (pos.offsetInContainerNode() &gt;= caretMaxOffset(pos.containerNode()))
</span><span class="cx">         return positionInParentAfterNode(tabSpan);
</span><span class="cx"> 
</span><del>-    splitTextNodeContainingElement(toText(pos.containerNode()), pos.offsetInContainerNode());
</del><ins>+    splitTextNodeContainingElement(downcast&lt;Text&gt;(pos.containerNode()), pos.offsetInContainerNode());
</ins><span class="cx">     return positionInParentBeforeNode(tabSpan);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -676,16 +676,16 @@
</span><span class="cx"> bool CompositeEditCommand::canRebalance(const Position&amp; position) const
</span><span class="cx"> {
</span><span class="cx">     Node* node = position.containerNode();
</span><del>-    if (position.anchorType() != Position::PositionIsOffsetInAnchor || !node || !node-&gt;isTextNode())
</del><ins>+    if (position.anchorType() != Position::PositionIsOffsetInAnchor || !node || !is&lt;Text&gt;(node))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    Text* textNode = toText(node);
-    if (textNode-&gt;length() == 0)
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*node);
+    if (!textNode.length())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     node-&gt;document().updateStyleIfNeeded();
</span><span class="cx"> 
</span><del>-    RenderObject* renderer = textNode-&gt;renderer();
</del><ins>+    RenderObject* renderer = textNode.renderer();
</ins><span class="cx">     if (renderer &amp;&amp; !renderer-&gt;style().collapseWhiteSpace())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -701,14 +701,14 @@
</span><span class="cx"> 
</span><span class="cx">     // If the rebalance is for the single offset, and neither text[offset] nor text[offset - 1] are some form of whitespace, do nothing.
</span><span class="cx">     int offset = position.deprecatedEditingOffset();
</span><del>-    String text = toText(node)-&gt;data();
</del><ins>+    String text = downcast&lt;Text&gt;(*node).data();
</ins><span class="cx">     if (!isWhitespace(text[offset])) {
</span><span class="cx">         offset--;
</span><span class="cx">         if (offset &lt; 0 || !isWhitespace(text[offset]))
</span><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    rebalanceWhitespaceOnTextSubstring(toText(node), position.offsetInContainerNode(), position.offsetInContainerNode());
</del><ins>+    rebalanceWhitespaceOnTextSubstring(downcast&lt;Text&gt;(node), position.offsetInContainerNode(), position.offsetInContainerNode());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtr&lt;Text&gt; prpTextNode, int startOffset, int endOffset)
</span><span class="lines">@@ -748,13 +748,13 @@
</span><span class="cx"> void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position&amp; position)
</span><span class="cx"> {
</span><span class="cx">     Node* node = position.deprecatedNode();
</span><del>-    if (!node || !node-&gt;isTextNode())
</del><ins>+    if (!node || !is&lt;Text&gt;(node))
</ins><span class="cx">         return;
</span><del>-    Text* textNode = toText(node);    
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*node);
</ins><span class="cx">     
</span><del>-    if (textNode-&gt;length() == 0)
</del><ins>+    if (!textNode.length())
</ins><span class="cx">         return;
</span><del>-    RenderObject* renderer = textNode-&gt;renderer();
</del><ins>+    RenderObject* renderer = textNode.renderer();
</ins><span class="cx">     if (renderer &amp;&amp; !renderer-&gt;style().collapseWhiteSpace())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -767,10 +767,10 @@
</span><span class="cx">     VisiblePosition previousVisiblePos(visiblePos.previous());
</span><span class="cx">     Position previous(previousVisiblePos.deepEquivalent());
</span><span class="cx">     
</span><del>-    if (deprecatedIsCollapsibleWhitespace(previousVisiblePos.characterAfter()) &amp;&amp; previous.deprecatedNode()-&gt;isTextNode() &amp;&amp; !previous.deprecatedNode()-&gt;hasTagName(brTag))
-        replaceTextInNodePreservingMarkers(toText(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
-    if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) &amp;&amp; position.deprecatedNode()-&gt;isTextNode() &amp;&amp; !position.deprecatedNode()-&gt;hasTagName(brTag))
-        replaceTextInNodePreservingMarkers(toText(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+    if (deprecatedIsCollapsibleWhitespace(previousVisiblePos.characterAfter()) &amp;&amp; is&lt;Text&gt;(previous.deprecatedNode()) &amp;&amp; !is&lt;HTMLBRElement&gt;(previous.deprecatedNode()))
+        replaceTextInNodePreservingMarkers(downcast&lt;Text&gt;(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
+    if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) &amp;&amp; is&lt;Text&gt;(position.deprecatedNode()) &amp;&amp; !is&lt;HTMLBRElement&gt;(position.deprecatedNode()))
+        replaceTextInNodePreservingMarkers(downcast&lt;Text&gt;(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CompositeEditCommand::rebalanceWhitespace()
</span><span class="lines">@@ -875,8 +875,8 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;RefPtr&lt;Text&gt;&gt; nodes;
</span><span class="cx">     for (Node* node = start.deprecatedNode(); node; node = NodeTraversal::next(node)) {
</span><del>-        if (node-&gt;isTextNode())
-            nodes.append(toText(node));
</del><ins>+        if (is&lt;Text&gt;(node))
+            nodes.append(downcast&lt;Text&gt;(node));
</ins><span class="cx">         if (node == end.deprecatedNode())
</span><span class="cx">             break;
</span><span class="cx">     }
</span><span class="lines">@@ -949,12 +949,12 @@
</span><span class="cx">     ASSERT(lineBreakExistsAtPosition(p));
</span><span class="cx">     
</span><span class="cx">     // We are certain that the position is at a line break, but it may be a br or a preserved newline.
</span><del>-    if (p.anchorNode()-&gt;hasTagName(brTag)) {
</del><ins>+    if (is&lt;HTMLBRElement&gt;(p.anchorNode())) {
</ins><span class="cx">         removeNode(p.anchorNode());
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    deleteTextFromNode(toText(p.anchorNode()), p.offsetInContainerNode(), 1);
</del><ins>+    deleteTextFromNode(downcast&lt;Text&gt;(p.anchorNode()), p.offsetInContainerNode(), 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Node&gt; CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position&amp; position)
</span><span class="lines">@@ -1119,7 +1119,7 @@
</span><span class="cx">         Position position = caretAfterDelete.deepEquivalent().downstream();
</span><span class="cx">         Node* node = position.deprecatedNode();
</span><span class="cx">         // Normally deletion will leave a br as a placeholder.
</span><del>-        if (node-&gt;hasTagName(brTag))
</del><ins>+        if (is&lt;HTMLBRElement&gt;(node))
</ins><span class="cx">             removeNodeAndPruneAncestors(node);
</span><span class="cx">         // If the selection to move was empty and in an empty block that 
</span><span class="cx">         // doesn't require a placeholder to prop itself open (like a bordered
</span><span class="lines">@@ -1137,11 +1137,11 @@
</span><span class="cx">         else if (lineBreakExistsAtPosition(position)) {
</span><span class="cx">             // There is a preserved '\n' at caretAfterDelete.
</span><span class="cx">             // We can safely assume this is a text node.
</span><del>-            Text* textNode = toText(node);
-            if (textNode-&gt;length() == 1)
</del><ins>+            Text&amp; textNode = downcast&lt;Text&gt;(*node);
+            if (textNode.length() == 1)
</ins><span class="cx">                 removeNodeAndPruneAncestors(node);
</span><span class="cx">             else
</span><del>-                deleteTextFromNode(textNode, position.deprecatedEditingOffset(), 1);
</del><ins>+                deleteTextFromNode(&amp;textNode, position.deprecatedEditingOffset(), 1);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -1434,13 +1434,13 @@
</span><span class="cx">     
</span><span class="cx">     if (caretPos.deprecatedNode()-&gt;hasTagName(brTag))
</span><span class="cx">         removeNodeAndPruneAncestors(caretPos.deprecatedNode());
</span><del>-    else if (caretPos.deprecatedNode()-&gt;isTextNode()) {
</del><ins>+    else if (is&lt;Text&gt;(caretPos.deprecatedNode())) {
</ins><span class="cx">         ASSERT(caretPos.deprecatedEditingOffset() == 0);
</span><del>-        Text* textNode = toText(caretPos.deprecatedNode());
-        ContainerNode* parentNode = textNode-&gt;parentNode();
</del><ins>+        Text&amp; textNode = downcast&lt;Text&gt;(*caretPos.deprecatedNode());
+        ContainerNode* parentNode = textNode.parentNode();
</ins><span class="cx">         // The preserved newline must be the first thing in the node, since otherwise the previous
</span><span class="cx">         // paragraph would be quoted, and we verified that it wasn't above.
</span><del>-        deleteTextFromNode(textNode, 0, 1);
</del><ins>+        deleteTextFromNode(&amp;textNode, 0, 1);
</ins><span class="cx">         prune(parentNode);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -464,10 +464,10 @@
</span><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (startOffset &gt;= caretMaxOffset(startNode) &amp;&amp; startNode-&gt;isTextNode()) {
-        Text* text = toText(startNode);
-        if (text-&gt;length() &gt; (unsigned)caretMaxOffset(startNode))
-            deleteTextFromNode(text, caretMaxOffset(startNode), text-&gt;length() - caretMaxOffset(startNode));
</del><ins>+    if (startOffset &gt;= caretMaxOffset(startNode) &amp;&amp; is&lt;Text&gt;(startNode)) {
+        Text&amp; text = downcast&lt;Text&gt;(*startNode);
+        if (text.length() &gt; static_cast&lt;unsigned&gt;(caretMaxOffset(startNode)))
+            deleteTextFromNode(&amp;text, caretMaxOffset(startNode), text.length() - caretMaxOffset(startNode));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (startOffset &gt;= lastOffsetForEditing(startNode)) {
</span><span class="lines">@@ -481,10 +481,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (startNode == m_downstreamEnd.deprecatedNode()) {
</span><span class="cx">         if (m_downstreamEnd.deprecatedEditingOffset() - startOffset &gt; 0) {
</span><del>-            if (startNode-&gt;isTextNode()) {
</del><ins>+            if (is&lt;Text&gt;(startNode)) {
</ins><span class="cx">                 // in a text node that needs to be trimmed
</span><del>-                Text* text = toText(startNode);
-                deleteTextFromNode(text, startOffset, m_downstreamEnd.deprecatedEditingOffset() - startOffset);
</del><ins>+                Text&amp; text = downcast&lt;Text&gt;(*startNode);
+                deleteTextFromNode(&amp;text, startOffset, m_downstreamEnd.deprecatedEditingOffset() - startOffset);
</ins><span class="cx">             } else {
</span><span class="cx">                 removeChildrenInRange(startNode, startOffset, m_downstreamEnd.deprecatedEditingOffset());
</span><span class="cx">                 m_endingPosition = m_upstreamStart;
</span><span class="lines">@@ -501,17 +501,17 @@
</span><span class="cx">         RefPtr&lt;Node&gt; node(startNode);
</span><span class="cx">         
</span><span class="cx">         if (startOffset &gt; 0) {
</span><del>-            if (startNode-&gt;isTextNode()) {
</del><ins>+            if (is&lt;Text&gt;(startNode)) {
</ins><span class="cx">                 // in a text node that needs to be trimmed
</span><del>-                Text* text = toText(node.get());
-                deleteTextFromNode(text, startOffset, text-&gt;length() - startOffset);
</del><ins>+                Text&amp; text = downcast&lt;Text&gt;(*node);
+                deleteTextFromNode(&amp;text, startOffset, text.length() - startOffset);
</ins><span class="cx">                 node = NodeTraversal::next(node.get());
</span><span class="cx">             } else {
</span><span class="cx">                 node = startNode-&gt;traverseToChildAt(startOffset);
</span><span class="cx">             }
</span><del>-        } else if (startNode == m_upstreamEnd.deprecatedNode() &amp;&amp; startNode-&gt;isTextNode()) {
-            Text* text = toText(m_upstreamEnd.deprecatedNode());
-            deleteTextFromNode(text, 0, m_upstreamEnd.deprecatedEditingOffset());
</del><ins>+        } else if (startNode == m_upstreamEnd.deprecatedNode() &amp;&amp; is&lt;Text&gt;(startNode)) {
+            Text&amp; text = downcast&lt;Text&gt;(*m_upstreamEnd.deprecatedNode());
+            deleteTextFromNode(&amp;text, 0, m_upstreamEnd.deprecatedEditingOffset());
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // handle deleting all nodes that are completely selected
</span><span class="lines">@@ -541,11 +541,11 @@
</span><span class="cx">                 // The node itself is fully selected, not just its contents.  Delete it.
</span><span class="cx">                 removeNode(m_downstreamEnd.deprecatedNode());
</span><span class="cx">             } else {
</span><del>-                if (m_downstreamEnd.deprecatedNode()-&gt;isTextNode()) {
</del><ins>+                if (is&lt;Text&gt;(m_downstreamEnd.deprecatedNode())) {
</ins><span class="cx">                     // in a text node that needs to be trimmed
</span><del>-                    Text* text = toText(m_downstreamEnd.deprecatedNode());
</del><ins>+                    Text&amp; text = downcast&lt;Text&gt;(*m_downstreamEnd.deprecatedNode());
</ins><span class="cx">                     if (m_downstreamEnd.deprecatedEditingOffset() &gt; 0) {
</span><del>-                        deleteTextFromNode(text, 0, m_downstreamEnd.deprecatedEditingOffset());
</del><ins>+                        deleteTextFromNode(&amp;text, 0, m_downstreamEnd.deprecatedEditingOffset());
</ins><span class="cx">                     }
</span><span class="cx">                 // Remove children of m_downstreamEnd.deprecatedNode() that come after m_upstreamStart.
</span><span class="cx">                 // Don't try to remove children if m_upstreamStart was inside m_downstreamEnd.deprecatedNode()
</span><span class="lines">@@ -574,15 +574,15 @@
</span><span class="cx"> {
</span><span class="cx">     document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">     // FIXME: isRenderedCharacter should be removed, and we should use VisiblePosition::characterAfter and VisiblePosition::characterBefore
</span><del>-    if (m_leadingWhitespace.isNotNull() &amp;&amp; !m_leadingWhitespace.isRenderedCharacter() &amp;&amp; m_leadingWhitespace.deprecatedNode()-&gt;isTextNode()) {
-        Text* textNode = toText(m_leadingWhitespace.deprecatedNode());
-        ASSERT(!textNode-&gt;renderer() || textNode-&gt;renderer()-&gt;style().collapseWhiteSpace());
-        replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+    if (m_leadingWhitespace.isNotNull() &amp;&amp; !m_leadingWhitespace.isRenderedCharacter() &amp;&amp; is&lt;Text&gt;(m_leadingWhitespace.deprecatedNode())) {
+        Text&amp; textNode = downcast&lt;Text&gt;(*m_leadingWhitespace.deprecatedNode());
+        ASSERT(!textNode.renderer() || textNode.renderer()-&gt;style().collapseWhiteSpace());
+        replaceTextInNodePreservingMarkers(&amp;textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</ins><span class="cx">     }
</span><del>-    if (m_trailingWhitespace.isNotNull() &amp;&amp; !m_trailingWhitespace.isRenderedCharacter() &amp;&amp; m_trailingWhitespace.deprecatedNode()-&gt;isTextNode()) {
-        Text* textNode = toText(m_trailingWhitespace.deprecatedNode());
-        ASSERT(!textNode-&gt;renderer() || textNode-&gt;renderer()-&gt;style().collapseWhiteSpace());
-        replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+    if (m_trailingWhitespace.isNotNull() &amp;&amp; !m_trailingWhitespace.isRenderedCharacter() &amp;&amp; is&lt;Text&gt;(m_trailingWhitespace.deprecatedNode())) {
+        Text&amp; textNode = downcast&lt;Text&gt;(*m_trailingWhitespace.deprecatedNode());
+        ASSERT(!textNode.renderer() || textNode.renderer()-&gt;style().collapseWhiteSpace());
+        replaceTextInNodePreservingMarkers(&amp;textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -864,10 +864,10 @@
</span><span class="cx">     bool shouldRebalaceWhiteSpace = true;
</span><span class="cx">     if (!frame().editor().behavior().shouldRebalanceWhiteSpacesInSecureField()) {
</span><span class="cx">         Node* node = m_endingPosition.deprecatedNode();
</span><del>-        if (node &amp;&amp; node-&gt;isTextNode()) {
-            Text* textNode = toText(node);
-            if (textNode-&gt;length())
-                shouldRebalaceWhiteSpace = textNode-&gt;renderer()-&gt;style().textSecurity() == TSNONE;
</del><ins>+        if (node &amp;&amp; is&lt;Text&gt;(node)) {
+            Text&amp; textNode = downcast&lt;Text&gt;(*node);
+            if (textNode.length())
+                shouldRebalaceWhiteSpace = textNode.renderer()-&gt;style().textSecurity() == TSNONE;
</ins><span class="cx">         }        
</span><span class="cx">     }
</span><span class="cx">     if (shouldRebalaceWhiteSpace)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1865,8 +1865,8 @@
</span><span class="cx">         Node* extentNode = extent.deprecatedNode();
</span><span class="cx">         unsigned extentOffset = extent.deprecatedEditingOffset();
</span><span class="cx"> 
</span><del>-        if (baseNode &amp;&amp; baseNode == extentNode &amp;&amp; baseNode-&gt;isTextNode() &amp;&amp; baseOffset + text.length() == extentOffset) {
-            m_compositionNode = toText(baseNode);
</del><ins>+        if (baseNode &amp;&amp; baseNode == extentNode &amp;&amp; is&lt;Text&gt;(baseNode) &amp;&amp; baseOffset + text.length() == extentOffset) {
+            m_compositionNode = downcast&lt;Text&gt;(baseNode);
</ins><span class="cx">             m_compositionStart = baseOffset;
</span><span class="cx">             m_compositionEnd = extentOffset;
</span><span class="cx">             m_customCompositionUnderlines = underlines;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertLineBreakCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -137,23 +137,23 @@
</span><span class="cx">     } else if (pos.deprecatedEditingOffset() &gt;= caretMaxOffset(pos.deprecatedNode()) || !pos.deprecatedNode()-&gt;isTextNode()) {
</span><span class="cx">         insertNodeAt(nodeToInsert.get(), pos);
</span><span class="cx">         setEndingSelection(VisibleSelection(positionInParentAfterNode(nodeToInsert.get()), DOWNSTREAM, endingSelection().isDirectional()));
</span><del>-    } else if (pos.deprecatedNode()-&gt;isTextNode()) {
</del><ins>+    } else if (is&lt;Text&gt;(pos.deprecatedNode())) {
</ins><span class="cx">         // Split a text node
</span><del>-        Text* textNode = toText(pos.deprecatedNode());
-        splitTextNode(textNode, pos.deprecatedEditingOffset());
-        insertNodeBefore(nodeToInsert, textNode);
-        Position endingPosition = firstPositionInNode(textNode);
</del><ins>+        Text&amp; textNode = downcast&lt;Text&gt;(*pos.deprecatedNode());
+        splitTextNode(&amp;textNode, pos.deprecatedEditingOffset());
+        insertNodeBefore(nodeToInsert, &amp;textNode);
+        Position endingPosition = firstPositionInNode(&amp;textNode);
</ins><span class="cx">         
</span><span class="cx">         // Handle whitespace that occurs after the split
</span><span class="cx">         document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">         if (!endingPosition.isRenderedCharacter()) {
</span><del>-            Position positionBeforeTextNode(positionInParentBeforeNode(textNode));
</del><ins>+            Position positionBeforeTextNode(positionInParentBeforeNode(&amp;textNode));
</ins><span class="cx">             // Clear out all whitespace and insert one non-breaking space
</span><span class="cx">             deleteInsignificantTextDownstream(endingPosition);
</span><del>-            ASSERT(!textNode-&gt;renderer() || textNode-&gt;renderer()-&gt;style().collapseWhiteSpace());
</del><ins>+            ASSERT(!textNode.renderer() || textNode.renderer()-&gt;style().collapseWhiteSpace());
</ins><span class="cx">             // Deleting insignificant whitespace will remove textNode if it contains nothing but insignificant whitespace.
</span><del>-            if (textNode-&gt;inDocument())
-                insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
</del><ins>+            if (textNode.inDocument())
+                insertTextIntoNode(&amp;textNode, 0, nonBreakingSpaceString());
</ins><span class="cx">             else {
</span><span class="cx">                 RefPtr&lt;Text&gt; nbspNode = document().createTextNode(nonBreakingSpaceString());
</span><span class="cx">                 insertNodeAt(nbspNode.get(), positionBeforeTextNode);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertParagraphSeparatorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -331,16 +331,16 @@
</span><span class="cx">     Position leadingWhitespace = insertionPosition.leadingWhitespacePosition(VP_DEFAULT_AFFINITY);
</span><span class="cx">     // FIXME: leadingWhitespacePosition is returning the position before preserved newlines for positions
</span><span class="cx">     // after the preserved newline, causing the newline to be turned into a nbsp.
</span><del>-    if (leadingWhitespace.isNotNull() &amp;&amp; leadingWhitespace.deprecatedNode()-&gt;isTextNode()) {
-        Text* textNode = toText(leadingWhitespace.deprecatedNode());
-        ASSERT(!textNode-&gt;renderer() || textNode-&gt;renderer()-&gt;style().collapseWhiteSpace());
-        replaceTextInNodePreservingMarkers(textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+    if (leadingWhitespace.isNotNull() &amp;&amp; is&lt;Text&gt;(leadingWhitespace.deprecatedNode())) {
+        Text&amp; textNode = downcast&lt;Text&gt;(*leadingWhitespace.deprecatedNode());
+        ASSERT(!textNode.renderer() || textNode.renderer()-&gt;style().collapseWhiteSpace());
+        replaceTextInNodePreservingMarkers(&amp;textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Split at pos if in the middle of a text node.
</span><span class="cx">     Position positionAfterSplit;
</span><del>-    if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor &amp;&amp; insertionPosition.containerNode()-&gt;isTextNode()) {
-        RefPtr&lt;Text&gt; textNode = toText(insertionPosition.containerNode());
</del><ins>+    if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor &amp;&amp; is&lt;Text&gt;(insertionPosition.containerNode())) {
+        RefPtr&lt;Text&gt; textNode = downcast&lt;Text&gt;(insertionPosition.containerNode());
</ins><span class="cx">         bool atEnd = static_cast&lt;unsigned&gt;(insertionPosition.offsetInContainerNode()) &gt;= textNode-&gt;length();
</span><span class="cx">         if (insertionPosition.deprecatedEditingOffset() &gt; 0 &amp;&amp; !atEnd) {
</span><span class="cx">             splitTextNode(textNode, insertionPosition.offsetInContainerNode());
</span><span class="lines">@@ -399,8 +399,8 @@
</span><span class="cx">             // Clear out all whitespace and insert one non-breaking space
</span><span class="cx">             ASSERT(!positionAfterSplit.containerNode()-&gt;renderer() || positionAfterSplit.containerNode()-&gt;renderer()-&gt;style().collapseWhiteSpace());
</span><span class="cx">             deleteInsignificantTextDownstream(positionAfterSplit);
</span><del>-            if (positionAfterSplit.deprecatedNode()-&gt;isTextNode())
-                insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0, nonBreakingSpaceString());
</del><ins>+            if (is&lt;Text&gt;(positionAfterSplit.deprecatedNode()))
+                insertTextIntoNode(downcast&lt;Text&gt;(positionAfterSplit.containerNode()), 0, nonBreakingSpaceString());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/InsertTextCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx"> 
</span><span class="cx">     // keep tabs coalesced in tab span
</span><span class="cx">     if (isTabSpanTextNode(node)) {
</span><del>-        RefPtr&lt;Text&gt; textNode = toText(node);
</del><ins>+        RefPtr&lt;Text&gt; textNode = downcast&lt;Text&gt;(node);
</ins><span class="cx">         insertTextIntoNode(textNode, offset, &quot;\t&quot;);
</span><span class="cx">         return Position(textNode.release(), offset + 1);
</span><span class="cx">     }
</span><span class="lines">@@ -250,10 +250,10 @@
</span><span class="cx">     RefPtr&lt;Element&gt; spanNode = createTabSpanElement(document());
</span><span class="cx">     
</span><span class="cx">     // place it
</span><del>-    if (!node-&gt;isTextNode()) {
</del><ins>+    if (!is&lt;Text&gt;(node)) {
</ins><span class="cx">         insertNodeAt(spanNode.get(), insertPos);
</span><span class="cx">     } else {
</span><del>-        RefPtr&lt;Text&gt; textNode = toText(node);
</del><ins>+        RefPtr&lt;Text&gt; textNode = downcast&lt;Text&gt;(node);
</ins><span class="cx">         if (offset &gt;= textNode-&gt;length())
</span><span class="cx">             insertNodeAfter(spanNode, textNode.release());
</span><span class="cx">         else {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMarkupAccumulatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MarkupAccumulator.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -553,7 +553,7 @@
</span><span class="cx"> 
</span><span class="cx">     switch (node.nodeType()) {
</span><span class="cx">     case Node::TEXT_NODE:
</span><del>-        appendText(result, toText(node));
</del><ins>+        appendText(result, downcast&lt;Text&gt;(node));
</ins><span class="cx">         break;
</span><span class="cx">     case Node::COMMENT_NODE:
</span><span class="cx">         appendComment(result, downcast&lt;Comment&gt;(node).data());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -683,7 +683,7 @@
</span><span class="cx">     document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     Node* lastLeafInserted = insertedNodes.lastLeafInserted();
</span><del>-    if (lastLeafInserted &amp;&amp; lastLeafInserted-&gt;isTextNode() &amp;&amp; !hasRenderedText(toText(*lastLeafInserted))
</del><ins>+    if (lastLeafInserted &amp;&amp; is&lt;Text&gt;(lastLeafInserted) &amp;&amp; !hasRenderedText(downcast&lt;Text&gt;(*lastLeafInserted))
</ins><span class="cx">         &amp;&amp; !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
</span><span class="cx">         &amp;&amp; !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
</span><span class="cx">         insertedNodes.willRemoveNode(lastLeafInserted);
</span><span class="lines">@@ -693,7 +693,7 @@
</span><span class="cx">     // We don't have to make sure that firstNodeInserted isn't inside a select or script element
</span><span class="cx">     // because it is a top level node in the fragment and the user can't insert into those elements.
</span><span class="cx">     Node* firstNodeInserted = insertedNodes.firstNodeInserted();
</span><del>-    if (firstNodeInserted &amp;&amp; firstNodeInserted-&gt;isTextNode() &amp;&amp; !hasRenderedText(toText(*firstNodeInserted))) {
</del><ins>+    if (firstNodeInserted &amp;&amp; is&lt;Text&gt;(firstNodeInserted) &amp;&amp; !hasRenderedText(downcast&lt;Text&gt;(*firstNodeInserted))) {
</ins><span class="cx">         insertedNodes.willRemoveNode(firstNodeInserted);
</span><span class="cx">         removeNode(firstNodeInserted);
</span><span class="cx">     }
</span><span class="lines">@@ -1291,7 +1291,7 @@
</span><span class="cx"> 
</span><span class="cx">     Position endUpstream = endOfInsertedContent.deepEquivalent().upstream();
</span><span class="cx">     Node* endNode = endUpstream.computeNodeBeforePosition();
</span><del>-    int endOffset = endNode &amp;&amp; endNode-&gt;isTextNode() ? toText(endNode)-&gt;length() : 0;
</del><ins>+    int endOffset = endNode &amp;&amp; is&lt;Text&gt;(endNode) ? downcast&lt;Text&gt;(*endNode).length() : 0;
</ins><span class="cx">     if (endUpstream.anchorType() == Position::PositionIsOffsetInAnchor) {
</span><span class="cx">         endNode = endUpstream.containerNode();
</span><span class="cx">         endOffset = endUpstream.offsetInContainerNode();
</span><span class="lines">@@ -1300,8 +1300,8 @@
</span><span class="cx">     bool needsTrailingSpace = !isEndOfParagraph(endOfInsertedContent) &amp;&amp; !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(endOfInsertedContent.characterAfter(), false);
</span><span class="cx">     if (needsTrailingSpace &amp;&amp; endNode) {
</span><span class="cx">         bool collapseWhiteSpace = !endNode-&gt;renderer() || endNode-&gt;renderer()-&gt;style().collapseWhiteSpace();
</span><del>-        if (endNode-&gt;isTextNode()) {
-            insertTextIntoNode(toText(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : &quot; &quot;);
</del><ins>+        if (is&lt;Text&gt;(endNode)) {
+            insertTextIntoNode(downcast&lt;Text&gt;(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : &quot; &quot;);
</ins><span class="cx">             if (m_endOfInsertedContent.containerNode() == endNode)
</span><span class="cx">                 m_endOfInsertedContent.moveToOffset(m_endOfInsertedContent.offsetInContainerNode() + 1);
</span><span class="cx">         } else {
</span><span class="lines">@@ -1324,8 +1324,8 @@
</span><span class="cx">     bool needsLeadingSpace = !isStartOfParagraph(startOfInsertedContent) &amp;&amp; !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(startOfInsertedContent.previous().characterAfter(), true);
</span><span class="cx">     if (needsLeadingSpace &amp;&amp; startNode) {
</span><span class="cx">         bool collapseWhiteSpace = !startNode-&gt;renderer() || startNode-&gt;renderer()-&gt;style().collapseWhiteSpace();
</span><del>-        if (startNode-&gt;isTextNode()) {
-            insertTextIntoNode(toText(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : &quot; &quot;);
</del><ins>+        if (is&lt;Text&gt;(startNode)) {
+            insertTextIntoNode(downcast&lt;Text&gt;(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : &quot; &quot;);
</ins><span class="cx">             if (m_endOfInsertedContent.containerNode() == startNode &amp;&amp; m_endOfInsertedContent.offsetInContainerNode())
</span><span class="cx">                 m_endOfInsertedContent.moveToOffset(m_endOfInsertedContent.offsetInContainerNode() + 1);
</span><span class="cx">         } else {
</span><span class="lines">@@ -1374,24 +1374,24 @@
</span><span class="cx"> {
</span><span class="cx">     bool positionIsOffsetInAnchor = position.anchorType() == Position::PositionIsOffsetInAnchor;
</span><span class="cx">     bool positionOnlyToBeUpdatedIsOffsetInAnchor = positionOnlyToBeUpdated.anchorType() == Position::PositionIsOffsetInAnchor;
</span><del>-    RefPtr&lt;Text&gt; text = 0;
-    if (positionIsOffsetInAnchor &amp;&amp; position.containerNode() &amp;&amp; position.containerNode()-&gt;isTextNode())
-        text = toText(position.containerNode());
</del><ins>+    RefPtr&lt;Text&gt; text;
+    if (positionIsOffsetInAnchor &amp;&amp; position.containerNode() &amp;&amp; is&lt;Text&gt;(position.containerNode()))
+        text = downcast&lt;Text&gt;(position.containerNode());
</ins><span class="cx">     else {
</span><span class="cx">         Node* before = position.computeNodeBeforePosition();
</span><del>-        if (before &amp;&amp; before-&gt;isTextNode())
-            text = toText(before);
</del><ins>+        if (before &amp;&amp; is&lt;Text&gt;(before))
+            text = downcast&lt;Text&gt;(before);
</ins><span class="cx">         else {
</span><span class="cx">             Node* after = position.computeNodeAfterPosition();
</span><del>-            if (after &amp;&amp; after-&gt;isTextNode())
-                text = toText(after);
</del><ins>+            if (after &amp;&amp; is&lt;Text&gt;(after))
+                text = downcast&lt;Text&gt;(after);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     if (!text)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (text-&gt;previousSibling() &amp;&amp; text-&gt;previousSibling()-&gt;isTextNode()) {
-        RefPtr&lt;Text&gt; previous = toText(text-&gt;previousSibling());
</del><ins>+    if (text-&gt;previousSibling() &amp;&amp; is&lt;Text&gt;(text-&gt;previousSibling())) {
+        RefPtr&lt;Text&gt; previous = downcast&lt;Text&gt;(text-&gt;previousSibling());
</ins><span class="cx">         insertTextIntoNode(text, 0, previous-&gt;data());
</span><span class="cx"> 
</span><span class="cx">         if (positionIsOffsetInAnchor)
</span><span class="lines">@@ -1409,8 +1409,8 @@
</span><span class="cx"> 
</span><span class="cx">         removeNode(previous);
</span><span class="cx">     }
</span><del>-    if (text-&gt;nextSibling() &amp;&amp; text-&gt;nextSibling()-&gt;isTextNode()) {
-        RefPtr&lt;Text&gt; next = toText(text-&gt;nextSibling());
</del><ins>+    if (text-&gt;nextSibling() &amp;&amp; is&lt;Text&gt;(text-&gt;nextSibling())) {
+        RefPtr&lt;Text&gt; next = downcast&lt;Text&gt;(text-&gt;nextSibling());
</ins><span class="cx">         unsigned originalLength = text-&gt;length();
</span><span class="cx">         insertTextIntoNode(text, originalLength, next-&gt;data());
</span><span class="cx"> 
</span><span class="lines">@@ -1449,8 +1449,8 @@
</span><span class="cx">     // list items and insert these nodes between them.
</span><span class="cx">     if (isMiddle) {
</span><span class="cx">         int textNodeOffset = insertPos.offsetInContainerNode();
</span><del>-        if (insertPos.deprecatedNode()-&gt;isTextNode() &amp;&amp; textNodeOffset &gt; 0)
-            splitTextNode(toText(insertPos.deprecatedNode()), textNodeOffset);
</del><ins>+        if (is&lt;Text&gt;(insertPos.deprecatedNode()) &amp;&amp; textNodeOffset &gt; 0)
+            splitTextNode(downcast&lt;Text&gt;(insertPos.deprecatedNode()), textNodeOffset);
</ins><span class="cx">         splitTreeToNode(insertPos.deprecatedNode(), lastNode, true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1488,7 +1488,7 @@
</span><span class="cx"> // split text nodes.
</span><span class="cx"> bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment&amp; fragment)
</span><span class="cx"> {
</span><del>-    if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !fragment.firstChild()-&gt;isTextNode())
</del><ins>+    if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !is&lt;Text&gt;(fragment.firstChild()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Would be nice to handle smart replace in the fast path.
</span><span class="lines">@@ -1500,11 +1500,11 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; nodeAfterInsertionPos = endingSelection().end().downstream().anchorNode();
</span><del>-    Text* textNode = toText(fragment.firstChild());
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*fragment.firstChild());
</ins><span class="cx">     // Our fragment creation code handles tabs, spaces, and newlines, so we don't have to worry about those here.
</span><span class="cx"> 
</span><span class="cx">     Position start = endingSelection().start();
</span><del>-    Position end = replaceSelectedTextInNode(textNode-&gt;data());
</del><ins>+    Position end = replaceSelectedTextInNode(textNode.data());
</ins><span class="cx">     if (end.isNull())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -501,7 +501,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool TextIterator::handleTextNode()
</span><span class="cx"> {
</span><del>-    Text&amp; textNode = toText(*m_node);
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*m_node);
</ins><span class="cx"> 
</span><span class="cx">     if (m_fullyClippedStack.top() &amp;&amp; !(m_behavior &amp; TextIteratorIgnoresStyleVisibility))
</span><span class="cx">         return false;
</span><span class="lines">@@ -603,7 +603,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TextIterator::handleTextBox()
</span><span class="cx"> {    
</span><del>-    Text&amp; textNode = toText(*m_node);
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*m_node);
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; renderer = m_firstLetterText ? *m_firstLetterText : *textNode.renderer();
</span><span class="cx">     if (renderer.style().visibility() != VISIBLE &amp;&amp; !(m_behavior &amp; TextIteratorIgnoresStyleVisibility)) {
</span><span class="lines">@@ -1263,7 +1263,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool SimplifiedBackwardsTextIterator::handleTextNode()
</span><span class="cx"> {
</span><del>-    Text&amp; textNode = toText(*m_node);
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*m_node);
</ins><span class="cx"> 
</span><span class="cx">     m_lastTextNode = &amp;textNode;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -767,7 +767,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return startNode-&gt;isTextNode() ? Position(toText(startNode), toInlineTextBox(startBox)-&gt;start())
</del><ins>+    return is&lt;Text&gt;(startNode) ? Position(downcast&lt;Text&gt;(startNode), toInlineTextBox(startBox)-&gt;start())
</ins><span class="cx">         : positionBeforeNode(startNode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -838,12 +838,12 @@
</span><span class="cx">     Position pos;
</span><span class="cx">     if (endNode-&gt;hasTagName(brTag))
</span><span class="cx">         pos = positionBeforeNode(endNode);
</span><del>-    else if (endBox-&gt;isInlineTextBox() &amp;&amp; endNode-&gt;isTextNode()) {
</del><ins>+    else if (endBox-&gt;isInlineTextBox() &amp;&amp; is&lt;Text&gt;(endNode)) {
</ins><span class="cx">         InlineTextBox* endTextBox = toInlineTextBox(endBox);
</span><span class="cx">         int endOffset = endTextBox-&gt;start();
</span><span class="cx">         if (!endTextBox-&gt;isLineBreak())
</span><span class="cx">             endOffset += endTextBox-&gt;len();
</span><del>-        pos = Position(toText(endNode), endOffset);
</del><ins>+        pos = Position(downcast&lt;Text&gt;(endNode), endOffset);
</ins><span class="cx">     } else
</span><span class="cx">         pos = positionAfterNode(endNode);
</span><span class="cx">     
</span><span class="lines">@@ -1138,7 +1138,7 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         if (r-&gt;isText() &amp;&amp; toRenderText(r)-&gt;hasRenderedText()) {
</span><del>-            ASSERT_WITH_SECURITY_IMPLICATION(n-&gt;isTextNode());
</del><ins>+            ASSERT_WITH_SECURITY_IMPLICATION(is&lt;Text&gt;(n));
</ins><span class="cx">             type = Position::PositionIsOffsetInAnchor;
</span><span class="cx">             if (style.preserveNewline()) {
</span><span class="cx">                 StringImpl&amp; text = *toRenderText(r)-&gt;text();
</span><span class="lines">@@ -1148,7 +1148,7 @@
</span><span class="cx">                     i = std::max(0, o);
</span><span class="cx">                 while (--i &gt;= 0) {
</span><span class="cx">                     if (text[i] == '\n')
</span><del>-                        return VisiblePosition(Position(toText(n), i + 1), DOWNSTREAM);
</del><ins>+                        return VisiblePosition(Position(downcast&lt;Text&gt;(n), i + 1), DOWNSTREAM);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             node = n;
</span><span class="lines">@@ -1221,7 +1221,7 @@
</span><span class="cx"> 
</span><span class="cx">         // FIXME: We avoid returning a position where the renderer can't accept the caret.
</span><span class="cx">         if (r-&gt;isText() &amp;&amp; toRenderText(r)-&gt;hasRenderedText()) {
</span><del>-            ASSERT_WITH_SECURITY_IMPLICATION(n-&gt;isTextNode());
</del><ins>+            ASSERT_WITH_SECURITY_IMPLICATION(is&lt;Text&gt;(n));
</ins><span class="cx">             type = Position::PositionIsOffsetInAnchor;
</span><span class="cx">             if (style.preserveNewline()) {
</span><span class="cx">                 StringImpl&amp; text = *toRenderText(r)-&gt;text();
</span><span class="lines">@@ -1229,7 +1229,7 @@
</span><span class="cx">                 int length = text.length();
</span><span class="cx">                 for (int i = o; i &lt; length; ++i) {
</span><span class="cx">                     if (text[i] == '\n')
</span><del>-                        return VisiblePosition(Position(toText(n), i), DOWNSTREAM);
</del><ins>+                        return VisiblePosition(Position(downcast&lt;Text&gt;(n), i), DOWNSTREAM);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             node = n;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/htmlediting.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/htmlediting.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1055,12 +1055,12 @@
</span><span class="cx">     if (!position.anchorNode()-&gt;renderer())
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (!position.anchorNode()-&gt;isTextNode() || !position.anchorNode()-&gt;renderer()-&gt;style().preserveNewline())
</del><ins>+    if (!is&lt;Text&gt;(position.anchorNode()) || !position.anchorNode()-&gt;renderer()-&gt;style().preserveNewline())
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    Text* textNode = toText(position.anchorNode());
</del><ins>+    Text&amp; textNode = downcast&lt;Text&gt;(*position.anchorNode());
</ins><span class="cx">     unsigned offset = position.offsetInContainerNode();
</span><del>-    return offset &lt; textNode-&gt;length() &amp;&amp; textNode-&gt;data()[offset] == '\n';
</del><ins>+    return offset &lt; textNode.length() &amp;&amp; textNode.data()[offset] == '\n';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Modifies selections that have an end point at the edge of a table
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/editing/markup.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -263,10 +263,10 @@
</span><span class="cx">     
</span><span class="cx"> String StyledMarkupAccumulator::renderedText(const Node&amp; node, const Range* range)
</span><span class="cx"> {
</span><del>-    if (!node.isTextNode())
</del><ins>+    if (!is&lt;Text&gt;(node))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    const Text&amp; textNode = toText(node);
</del><ins>+    const Text&amp; textNode = downcast&lt;Text&gt;(node);
</ins><span class="cx">     unsigned startOffset = 0;
</span><span class="cx">     unsigned endOffset = textNode.length();
</span><span class="cx"> 
</span><span class="lines">@@ -1001,7 +1001,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (hasOneTextChild(&amp;containerNode.get()) &amp;&amp; hasOneTextChild(fragment.get())) {
</span><del>-        toText(containerNode-&gt;firstChild())-&gt;setData(toText(fragment-&gt;firstChild())-&gt;data(), ec);
</del><ins>+        downcast&lt;Text&gt;(*containerNode-&gt;firstChild()).setData(downcast&lt;Text&gt;(*fragment-&gt;firstChild()).data(), ec);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1020,7 +1020,7 @@
</span><span class="cx">     ChildListMutationScope mutation(containerNode.get());
</span><span class="cx"> 
</span><span class="cx">     if (hasOneTextChild(&amp;containerNode.get())) {
</span><del>-        toText(containerNode-&gt;firstChild())-&gt;setData(text, ec);
</del><ins>+        downcast&lt;Text&gt;(*containerNode-&gt;firstChild()).setData(text, ec);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -436,11 +436,11 @@
</span><span class="cx"> static void mergeWithNextTextNode(Text&amp; node, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     Node* next = node.nextSibling();
</span><del>-    if (!next || !next-&gt;isTextNode())
</del><ins>+    if (!next || !is&lt;Text&gt;(next))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;Text&gt; textNode(node);
</span><del>-    Ref&lt;Text&gt; textNext(toText(*next));
</del><ins>+    Ref&lt;Text&gt; textNext(downcast&lt;Text&gt;(*next));
</ins><span class="cx">     textNode-&gt;appendData(textNext-&gt;data(), ec);
</span><span class="cx">     if (ec)
</span><span class="cx">         return;
</span><span class="lines">@@ -464,10 +464,10 @@
</span><span class="cx">       
</span><span class="cx">     parent-&gt;replaceChild(fragment.release(), this, ec);
</span><span class="cx">     RefPtr&lt;Node&gt; node = next ? next-&gt;previousSibling() : nullptr;
</span><del>-    if (!ec &amp;&amp; node &amp;&amp; node-&gt;isTextNode())
-        mergeWithNextTextNode(toText(*node), ec);
-    if (!ec &amp;&amp; prev &amp;&amp; prev-&gt;isTextNode())
-        mergeWithNextTextNode(toText(*prev), ec);
</del><ins>+    if (!ec &amp;&amp; node &amp;&amp; is&lt;Text&gt;(*node))
+        mergeWithNextTextNode(downcast&lt;Text&gt;(*node), ec);
+    if (!ec &amp;&amp; prev &amp;&amp; is&lt;Text&gt;(*prev))
+        mergeWithNextTextNode(downcast&lt;Text&gt;(*prev), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;DocumentFragment&gt; HTMLElement::textToFragment(const String&amp; text, ExceptionCode&amp; ec)
</span><span class="lines">@@ -597,10 +597,10 @@
</span><span class="cx">     parent-&gt;replaceChild(newChild.release(), this, ec);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Node&gt; node = next ? next-&gt;previousSibling() : nullptr;
</span><del>-    if (!ec &amp;&amp; node &amp;&amp; node-&gt;isTextNode())
-        mergeWithNextTextNode(toText(*node), ec);
-    if (!ec &amp;&amp; prev &amp;&amp; prev-&gt;isTextNode())
-        mergeWithNextTextNode(toText(*prev), ec);
</del><ins>+    if (!ec &amp;&amp; node &amp;&amp; is&lt;Text&gt;(*node))
+        mergeWithNextTextNode(downcast&lt;Text&gt;(*node), ec);
+    if (!ec &amp;&amp; prev &amp;&amp; is&lt;Text&gt;(*prev))
+        mergeWithNextTextNode(downcast&lt;Text&gt;(*prev), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node* HTMLElement::insertAdjacent(const String&amp; where, Node* newChild, ExceptionCode&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -231,10 +231,10 @@
</span><span class="cx"> {
</span><span class="cx">     for (Node* child = firstChild(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">         // Ignore whitespace-only text, and &lt;param&gt; tags, any other content is fallback content.
</span><del>-        if (child-&gt;isTextNode()) {
-            if (!toText(child)-&gt;containsOnlyWhitespace())
</del><ins>+        if (is&lt;Text&gt;(child)) {
+            if (!downcast&lt;Text&gt;(*child).containsOnlyWhitespace())
</ins><span class="cx">                 return true;
</span><del>-        } else if (!child-&gt;hasTagName(paramTag))
</del><ins>+        } else if (!is&lt;HTMLParamElement&gt;(child))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -428,8 +428,8 @@
</span><span class="cx">             // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
</span><span class="cx">             if (isRecognizedTagName(element-&gt;tagQName()) &amp;&amp; !element-&gt;hasTagName(paramTag))
</span><span class="cx">                 isNamedItem = false;
</span><del>-        } else if (child-&gt;isTextNode()) {
-            if (!toText(child)-&gt;containsOnlyWhitespace())
</del><ins>+        } else if (is&lt;Text&gt;(child)) {
+            if (!downcast&lt;Text&gt;(*child).containsOnlyWhitespace())
</ins><span class="cx">                 isNamedItem = false;
</span><span class="cx">         } else
</span><span class="cx">             isNamedItem = false;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -129,8 +129,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Handle the common special case where there's exactly 1 child node, and it's a text node.
</span><span class="cx">     Node* child = firstChild();
</span><del>-    if (child &amp;&amp; child-&gt;isTextNode() &amp;&amp; !child-&gt;nextSibling())
-        toText(child)-&gt;setData(text, ec);
</del><ins>+    if (child &amp;&amp; is&lt;Text&gt;(child) &amp;&amp; !child-&gt;nextSibling())
+        downcast&lt;Text&gt;(*child).setData(text, ec);
</ins><span class="cx">     else {
</span><span class="cx">         removeChildren();
</span><span class="cx">         appendChild(Text::create(document(), text), ec);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLScriptElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;HTMLScriptElement&gt; protectFromMutationEvents(*this);
</span><span class="cx"> 
</span><del>-    if (hasOneChild() &amp;&amp; firstChild()-&gt;isTextNode()) {
-        toText(firstChild())-&gt;setData(value, IGNORE_EXCEPTION);
</del><ins>+    if (hasOneChild() &amp;&amp; is&lt;Text&gt;(firstChild())) {
+        downcast&lt;Text&gt;(*firstChild()).setData(value, IGNORE_EXCEPTION);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -561,10 +561,10 @@
</span><span class="cx"> 
</span><span class="cx">     StringBuilder result;
</span><span class="cx">     for (Node* node = innerText; node; node = NodeTraversal::next(node, innerText)) {
</span><del>-        if (node-&gt;hasTagName(brTag))
</del><ins>+        if (is&lt;HTMLBRElement&gt;(node))
</ins><span class="cx">             result.append(newlineCharacter);
</span><del>-        else if (node-&gt;isTextNode())
-            result.append(toText(node)-&gt;data());
</del><ins>+        else if (is&lt;Text&gt;(node))
+            result.append(downcast&lt;Text&gt;(*node).data());
</ins><span class="cx">     }
</span><span class="cx">     return finishText(result);
</span><span class="cx"> }
</span><span class="lines">@@ -579,8 +579,8 @@
</span><span class="cx">                 return positionBeforeNode(node);
</span><span class="cx">             remainingCharactersToMoveForward--;
</span><span class="cx">             lastBrOrText = node;
</span><del>-        } else if (node-&gt;isTextNode()) {
-            Text&amp; text = toText(*node);
</del><ins>+        } else if (is&lt;Text&gt;(node)) {
+            Text&amp; text = downcast&lt;Text&gt;(*node);
</ins><span class="cx">             if (remainingCharactersToMoveForward &lt; text.length())
</span><span class="cx">                 return Position(&amp;text, remainingCharactersToMoveForward);
</span><span class="cx">             remainingCharactersToMoveForward -= text.length();
</span><span class="lines">@@ -607,14 +607,14 @@
</span><span class="cx">     ASSERT(innerText-&gt;contains(startNode));
</span><span class="cx"> 
</span><span class="cx">     for (Node* node = startNode; node; node = NodeTraversal::previous(node, innerText)) {
</span><del>-        if (node-&gt;isTextNode()) {
-            unsigned length = toText(*node).length();
</del><ins>+        if (is&lt;Text&gt;(node)) {
+            unsigned length = downcast&lt;Text&gt;(*node).length();
</ins><span class="cx">             if (node == passedPosition.containerNode())
</span><span class="cx">                 index += std::min&lt;unsigned&gt;(length, passedPosition.offsetInContainerNode());
</span><span class="cx">             else
</span><span class="cx">                 index += length;
</span><del>-        } else if (node-&gt;hasTagName(brTag))
-            index++;
</del><ins>+        } else if (is&lt;HTMLBRElement&gt;(node))
+            ++index;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length = innerTextValue().length();
</span><span class="lines">@@ -685,10 +685,10 @@
</span><span class="cx"> 
</span><span class="cx">     StringBuilder result;
</span><span class="cx">     for (Node* node = innerText-&gt;firstChild(); node; node = NodeTraversal::next(node, innerText)) {
</span><del>-        if (node-&gt;hasTagName(brTag))
</del><ins>+        if (is&lt;HTMLBRElement&gt;(node))
</ins><span class="cx">             result.append(newlineCharacter);
</span><del>-        else if (node-&gt;isTextNode()) {
-            String data = toText(node)-&gt;data();
</del><ins>+        else if (is&lt;Text&gt;(node)) {
+            String data = downcast&lt;Text&gt;(*node).data();
</ins><span class="cx">             unsigned length = data.length();
</span><span class="cx">             unsigned position = 0;
</span><span class="cx">             while (breakNode == node &amp;&amp; breakOffset &lt;= length) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTitleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTitleElement.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTitleElement.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/HTMLTitleElement.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -97,8 +97,8 @@
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;HTMLTitleElement&gt; protectFromMutationEvents(*this);
</span><span class="cx">     
</span><del>-    if (hasOneChild() &amp;&amp; firstChild()-&gt;isTextNode())
-        toText(firstChild())-&gt;setData(value, IGNORE_EXCEPTION);
</del><ins>+    if (hasOneChild() &amp;&amp; is&lt;Text&gt;(firstChild()))
+        downcast&lt;Text&gt;(*firstChild()).setData(value, IGNORE_EXCEPTION);
</ins><span class="cx">     else {
</span><span class="cx">         // We make a copy here because entity of &quot;value&quot; argument can be Document::m_title,
</span><span class="cx">         // which goes empty during removeChildren() invocation below,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -547,11 +547,11 @@
</span><span class="cx">     // for performance, see &lt;https://bugs.webkit.org/show_bug.cgi?id=55898&gt;.
</span><span class="cx"> 
</span><span class="cx">     Node* previousChild = task.nextChild ? task.nextChild-&gt;previousSibling() : task.parent-&gt;lastChild();
</span><del>-    if (previousChild &amp;&amp; previousChild-&gt;isTextNode()) {
</del><ins>+    if (previousChild &amp;&amp; is&lt;Text&gt;(previousChild)) {
</ins><span class="cx">         // FIXME: We're only supposed to append to this text node if it
</span><span class="cx">         // was the last text node inserted by the parser.
</span><del>-        Text* textNode = toText(previousChild);
-        currentPosition = textNode-&gt;parserAppendData(characters, 0, lengthLimit);
</del><ins>+        Text&amp; textNode = downcast&lt;Text&gt;(*previousChild);
+        currentPosition = textNode.parserAppendData(characters, 0, lengthLimit);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     while (currentPosition &lt; characters.length()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -806,7 +806,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_domEditor-&gt;replaceWholeText(toText(node), value, errorString);
</del><ins>+    m_domEditor-&gt;replaceWholeText(downcast&lt;Text&gt;(node), value, errorString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDOMAgent::getEventListenersForNode(ErrorString* errorString, int nodeId, const String* objectGroup, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::DOM::EventListener&gt;&gt;&amp; listenersArray)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderCombineTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderCombineText.h (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderCombineText.h        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/rendering/RenderCombineText.h        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> public:
</span><span class="cx">     RenderCombineText(Text&amp;, PassRefPtr&lt;StringImpl&gt;);
</span><span class="cx"> 
</span><del>-    Text&amp; textNode() const { return toText(nodeForNonAnonymous()); }
</del><ins>+    Text&amp; textNode() const { return downcast&lt;Text&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     void combineText();
</span><span class="cx">     void adjustTextOrigin(FloatPoint&amp; textOrigin, const FloatRect&amp; boxRect) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -717,7 +717,7 @@
</span><span class="cx">                     for (InlineTextBox* box = textRenderer-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</span><span class="cx">                         if (offsetTop + box-&gt;logicalBottom() &lt; logicalTopForRegion)
</span><span class="cx">                             continue;
</span><del>-                        range-&gt;setStart(Position(toText(node), box-&gt;start()));
</del><ins>+                        range-&gt;setStart(Position(downcast&lt;Text&gt;(node), box-&gt;start()));
</ins><span class="cx">                         startsAboveRegion = false;
</span><span class="cx">                         break;
</span><span class="cx">                     }
</span><span class="lines">@@ -745,7 +745,7 @@
</span><span class="cx">                 if (renderer-&gt;isText()) {
</span><span class="cx">                     // Text crosses region bottom
</span><span class="cx">                     RenderText* textRenderer = toRenderText(renderer);
</span><del>-                    InlineTextBox* lastBox = 0;
</del><ins>+                    InlineTextBox* lastBox = nullptr;
</ins><span class="cx">                     for (InlineTextBox* box = textRenderer-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</span><span class="cx">                         if ((offsetTop + box-&gt;logicalTop()) &lt; logicalBottomForRegion) {
</span><span class="cx">                             lastBox = box;
</span><span class="lines">@@ -753,7 +753,7 @@
</span><span class="cx">                         }
</span><span class="cx">                         ASSERT(lastBox);
</span><span class="cx">                         if (lastBox)
</span><del>-                            range-&gt;setEnd(Position(toText(node), lastBox-&gt;start() + lastBox-&gt;len()));
</del><ins>+                            range-&gt;setEnd(Position(downcast&lt;Text&gt;(node), lastBox-&gt;start() + lastBox-&gt;len()));
</ins><span class="cx">                         break;
</span><span class="cx">                     }
</span><span class="cx">                     endsBelowRegion = false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx"> 
</span><span class="cx"> Text* RenderText::textNode() const
</span><span class="cx"> {
</span><del>-    return toText(RenderObject::node());
</del><ins>+    return downcast&lt;Text&gt;(RenderObject::node());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderText::isTextFragment() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGInlineTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> public:
</span><span class="cx">     RenderSVGInlineText(Text&amp;, const String&amp;);
</span><span class="cx"> 
</span><del>-    Text&amp; textNode() const { return toText(nodeForNonAnonymous()); }
</del><ins>+    Text&amp; textNode() const { return downcast&lt;Text&gt;(nodeForNonAnonymous()); }
</ins><span class="cx"> 
</span><span class="cx">     bool characterStartsNewTextChunk(int position) const;
</span><span class="cx">     SVGTextLayoutAttributes* layoutAttributes() { return &amp;m_layoutAttributes; }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -365,9 +365,9 @@
</span><span class="cx">                 continue;
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (!sibling-&gt;isTextNode())
</del><ins>+        if (!is&lt;Text&gt;(sibling))
</ins><span class="cx">             continue;
</span><del>-        Text&amp; textSibling = toText(*sibling);
</del><ins>+        Text&amp; textSibling = downcast&lt;Text&gt;(*sibling);
</ins><span class="cx">         if (!textSibling.containsOnlyWhitespace())
</span><span class="cx">             continue;
</span><span class="cx">         textSibling.setNeedsStyleRecalc();
</span><span class="lines">@@ -478,8 +478,8 @@
</span><span class="cx">             renderTreePosition.invalidateNextSibling(*child-&gt;renderer());
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (child-&gt;isTextNode()) {
-            attachTextRenderer(*toText(child), renderTreePosition);
</del><ins>+        if (is&lt;Text&gt;(child)) {
+            attachTextRenderer(downcast&lt;Text&gt;(*child), renderTreePosition);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         if (child-&gt;isElementNode())
</span><span class="lines">@@ -495,10 +495,10 @@
</span><span class="cx">     for (Node* current = insertionPoint.firstDistributed(); current; current = insertionPoint.nextDistributedTo(current)) {
</span><span class="cx">         if (current-&gt;renderer())
</span><span class="cx">             renderTreePosition.invalidateNextSibling(*current-&gt;renderer());
</span><del>-        if (current-&gt;isTextNode()) {
</del><ins>+        if (is&lt;Text&gt;(current)) {
</ins><span class="cx">             if (current-&gt;renderer())
</span><span class="cx">                 continue;
</span><del>-            attachTextRenderer(*toText(current), renderTreePosition);
</del><ins>+            attachTextRenderer(downcast&lt;Text&gt;(*current), renderTreePosition);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         if (current-&gt;isElementNode()) {
</span><span class="lines">@@ -651,8 +651,8 @@
</span><span class="cx"> static void detachDistributedChildren(InsertionPoint&amp; insertionPoint)
</span><span class="cx"> {
</span><span class="cx">     for (Node* current = insertionPoint.firstDistributed(); current; current = insertionPoint.nextDistributedTo(current)) {
</span><del>-        if (current-&gt;isTextNode()) {
-            detachTextRenderer(*toText(current));
</del><ins>+        if (is&lt;Text&gt;(current)) {
+            detachTextRenderer(downcast&lt;Text&gt;(*current));
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         if (current-&gt;isElementNode())
</span><span class="lines">@@ -666,8 +666,8 @@
</span><span class="cx">         detachDistributedChildren(downcast&lt;InsertionPoint&gt;(current));
</span><span class="cx"> 
</span><span class="cx">     for (Node* child = current.firstChild(); child; child = child-&gt;nextSibling()) {
</span><del>-        if (child-&gt;isTextNode()) {
-            Style::detachTextRenderer(*toText(child));
</del><ins>+        if (is&lt;Text&gt;(child)) {
+            Style::detachTextRenderer(downcast&lt;Text&gt;(*child));
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         if (child-&gt;isElementNode())
</span><span class="lines">@@ -815,8 +815,8 @@
</span><span class="cx">     for (Node* child = shadowRoot.firstChild(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">         if (child-&gt;renderer())
</span><span class="cx">             renderTreePosition.invalidateNextSibling(*child-&gt;renderer());
</span><del>-        if (child-&gt;isTextNode() &amp;&amp; child-&gt;needsStyleRecalc()) {
-            resolveTextNode(*toText(child), renderTreePosition);
</del><ins>+        if (is&lt;Text&gt;(child) &amp;&amp; child-&gt;needsStyleRecalc()) {
+            resolveTextNode(downcast&lt;Text&gt;(*child), renderTreePosition);
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         if (child-&gt;isElementNode())
</span><span class="lines">@@ -939,8 +939,8 @@
</span><span class="cx">         for (Node* child = current.firstChild(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">             if (RenderObject* childRenderer = child-&gt;renderer())
</span><span class="cx">                 childRenderTreePosition.invalidateNextSibling(*childRenderer);
</span><del>-            if (child-&gt;isTextNode() &amp;&amp; child-&gt;needsStyleRecalc()) {
-                resolveTextNode(*toText(child), childRenderTreePosition);
</del><ins>+            if (is&lt;Text&gt;(child) &amp;&amp; child-&gt;needsStyleRecalc()) {
+                resolveTextNode(downcast&lt;Text&gt;(*child), childRenderTreePosition);
</ins><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx">             if (!child-&gt;isElementNode())
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-09-29  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use the new is&lt;&gt;() / downcast&lt;&gt;() for Text Nodes
+        https://bugs.webkit.org/show_bug.cgi?id=137188
+
+        Reviewed by Darin Adler.
+
+        Use the new is&lt;&gt;() / downcast&lt;&gt;() functions for Text Nodes instead of
+        isText() / toText().
+
+        * WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
+        (-[WKDOMText data]):
+        (-[WKDOMText setData:]):
+
+2014-09-29  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Make is&lt;&gt;() / downcast&lt;&gt;() work for HTMLDocument and its subclasses
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137169
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm (174067 => 174068)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm        2014-09-29 17:16:32 UTC (rev 174067)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.mm        2014-09-29 17:20:18 UTC (rev 174068)
</span><span class="lines">@@ -35,14 +35,14 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSString *)data
</span><span class="cx"> {
</span><del>-    return WebCore::toText(_impl.get())-&gt;data();
</del><ins>+    return WebCore::downcast&lt;WebCore::Text&gt;(*_impl).data();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setData:(NSString *)data
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Do something about the exception.
</span><span class="cx">     WebCore::ExceptionCode ec;
</span><del>-    WebCore::toText(_impl.get())-&gt;setData(data, ec);
</del><ins>+    WebCore::downcast&lt;WebCore::Text&gt;(*_impl).setData(data, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre>
</div>
</div>

</body>
</html>