<!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<>() / downcast<>() for Text Nodes
https://bugs.webkit.org/show_bug.cgi?id=137188
Reviewed by Darin Adler.
Use the new is<>() / downcast<>() 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 <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Use the new is<>() / downcast<>() for Text Nodes
+ https://bugs.webkit.org/show_bug.cgi?id=137188
+
+ Reviewed by Darin Adler.
+
+ Use the new is<>() / downcast<>() 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 <cdumez@apple.com>
+
</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->node();
</span><del>- if (node && node->isTextNode())
- return toText(node)->wholeText();
</del><ins>+ if (node && is<Text>(node))
+ return downcast<Text>(*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<Attr*>(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<Text>(node)));
</ins><span class="cx"> case Node::CDATA_SECTION_NODE:
</span><span class="cx"> return WEBKIT_DOM_NODE(wrapCDATASection(static_cast<CDATASection*>(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->firstChild(); n; n = n->nextSibling()) {
- if (n->isElementNode()) {
</del><ins>+ for (Node* node = element->firstChild(); node; node = node->nextSibling()) {
+ if (node->isElementNode()) {
</ins><span class="cx"> result = false;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- if (n->isTextNode()) {
- Text* textNode = toText(n);
- if (!textNode->data().isEmpty()) {
</del><ins>+ if (is<Text>(node)) {
+ Text& textNode = downcast<Text>(*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<Text>(this));
+ if (is<Text>(this))
+ Style::updateTextRendererAfterContentChange(downcast<Text>(*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<Text>(this));
+ if (is<Text>(this))
+ Style::updateTextRendererAfterContentChange(downcast<Text>(*this), offsetOfReplacedData, oldLength);
</ins><span class="cx">
</span><span class="cx"> if (is<ProcessingInstruction>(this))
</span><span class="cx"> downcast<ProcessingInstruction>(*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<Text>(child))
+ Style::detachTextRenderer(downcast<Text>(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<Text> text = toText(node.get());
</del><ins>+ RefPtr<Text> text = downcast<Text>(node.get());
</ins><span class="cx">
</span><span class="cx"> // Remove empty text nodes.
</span><span class="cx"> if (!text->length()) {
</span><span class="lines">@@ -503,7 +503,7 @@
</span><span class="cx"> while (Node* nextSibling = node->nextSibling()) {
</span><span class="cx"> if (nextSibling->nodeType() != TEXT_NODE)
</span><span class="cx"> break;
</span><del>- RefPtr<Text> nextText = toText(nextSibling);
</del><ins>+ RefPtr<Text> nextText = downcast<Text>(nextSibling);
</ins><span class="cx">
</span><span class="cx"> // Remove empty text nodes.
</span><span class="cx"> if (!nextText->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 && m_anchorNode->isTextNode() ? toText(m_anchorNode.get()) : 0;
</del><ins>+ return m_anchorNode && is<Text>(*m_anchorNode) ? downcast<Text>(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->isTextNode());
- return 0;
</del><ins>+ ASSERT(!m_anchorNode || !is<Text>(*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()->isTextNode())
</del><ins>+ if (isNull() || !is<Text>(deprecatedNode()))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- RenderText* renderer = toText(deprecatedNode())->renderer();
</del><ins>+ RenderText* renderer = downcast<Text>(*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 && inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) && prev.deprecatedNode()->isTextNode()) {
- String string = toText(prev.deprecatedNode())->data();
</del><ins>+ if (prev != *this && inSameEnclosingBlockFlowElement(deprecatedNode(), prev.deprecatedNode()) && is<Text>(prev.deprecatedNode())) {
+ String string = downcast<Text>(*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()->isTextNode();
</del><ins>+ bool startIsText = is<Text>(m_start.container());
</ins><span class="cx"> if (startIsText && !m_start.container()->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<Node> container;
</span><span class="cx"> if (startIsText) {
</span><span class="cx"> container = m_start.container();
</span><del>- RefPtr<Text> newText = toText(container.get())->splitText(m_start.offset(), ec);
</del><ins>+ RefPtr<Text> newText = downcast<Text>(*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->isTextNode()) {
- if (RenderObject* renderer = toText(node)->renderer()) {
</del><ins>+ } else if (is<Text>(node)) {
+ if (RenderObject* renderer = downcast<Text>(*node).renderer()) {
</ins><span class="cx"> const RenderText& 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->previousSibling())) {
</span><del>- if (!node->isTextNode())
</del><ins>+ if (!is<Text>(node))
</ins><span class="cx"> break;
</span><del>- text = toText(node);
</del><ins>+ text = downcast<Text>(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->nextSibling())) {
</span><del>- if (!node->isTextNode())
</del><ins>+ if (!is<Text>(node))
</ins><span class="cx"> break;
</span><del>- text = toText(node);
</del><ins>+ text = downcast<Text>(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& node) { return node.isTextNode(); }
-void isText(const Text&); // Catch unnecessary runtime check of type known at compile time.
-void isText(const ContainerNode&); // Catch unnecessary runtime check of type known at compile time.
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(Text)
+ static bool isText(const Node& 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->isTextNode())
- return toText(root)->data();
</del><ins>+ if (is<Text>(root))
+ return downcast<Text>(*root).data();
</ins><span class="cx"> if (root->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->firstChild();
</span><del>- while (node && !node->isTextNode())
</del><ins>+ while (node && !is<Text>(node))
</ins><span class="cx"> node = node->nextSibling();
</span><del>- return toText(node);
</del><ins>+ return downcast<Text>(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->firstChild();
</span><del>- while (node && !node->isTextNode())
</del><ins>+ while (node && !is<Text>(node))
</ins><span class="cx"> node = NodeTraversal::next(node, current);
</span><del>- return toText(node);
</del><ins>+ return downcast<Text>(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 && !node->isTextNode())
</del><ins>+ while (node && !is<Text>(node))
</ins><span class="cx"> node = NodeTraversal::next(node);
</span><del>- return toText(node);
</del><ins>+ return downcast<Text>(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 && !node->isTextNode())
</del><ins>+ while (node && !is<Text>(node))
</ins><span class="cx"> node = NodeTraversal::next(node, stayWithin);
</span><del>- return toText(node);
</del><ins>+ return downcast<Text>(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->nextSibling();
</span><del>- while (node && !node->isTextNode())
</del><ins>+ while (node && !is<Text>(node))
</ins><span class="cx"> node = node->nextSibling();
</span><del>- return toText(node);
</del><ins>+ return downcast<Text>(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->isTextNode() || offset < 0 || offset >= textNode->maxCharacterOffset())
</del><ins>+ if (!textNode || !is<Text>(textNode) || offset < 0 || offset >= textNode->maxCharacterOffset())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- String textAtPosition = toText(textNode)->substringData(offset, 1, ec);
</del><ins>+ String textAtPosition = downcast<Text>(*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 "\n"
</span><span class="cx"> splitTextNode(text, 1);
</span><span class="cx">
</span><del>- if (text == start.containerNode() && text->previousSibling() && text->previousSibling()->isTextNode()) {
</del><ins>+ if (text == start.containerNode() && text->previousSibling() && is<Text>(text->previousSibling())) {
</ins><span class="cx"> ASSERT(start.offsetInContainerNode() < position.offsetInContainerNode());
</span><del>- start = Position(toText(text->previousSibling()), start.offsetInContainerNode());
</del><ins>+ start = Position(downcast<Text>(text->previousSibling()), start.offsetInContainerNode());
</ins><span class="cx"> }
</span><del>- if (text == end.containerNode() && text->previousSibling() && text->previousSibling()->isTextNode()) {
</del><ins>+ if (text == end.containerNode() && text->previousSibling() && is<Text>(text->previousSibling())) {
</ins><span class="cx"> ASSERT(end.offsetInContainerNode() < position.offsetInContainerNode());
</span><del>- end = Position(toText(text->previousSibling()), end.offsetInContainerNode());
</del><ins>+ end = Position(downcast<Text>(text->previousSibling()), end.offsetInContainerNode());
</ins><span class="cx"> }
</span><span class="cx"> if (text == m_endOfLastParagraph.containerNode()) {
</span><span class="cx"> if (m_endOfLastParagraph.offsetInContainerNode() < 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->previousSibling()->isTextNode()
- && static_cast<unsigned>(m_endOfLastParagraph.offsetInContainerNode()) <= toText(text->previousSibling())->length())
- m_endOfLastParagraph = Position(toText(text->previousSibling()), m_endOfLastParagraph.offsetInContainerNode());
</del><ins>+ if (is<Text>(text->previousSibling())
+ && static_cast<unsigned>(m_endOfLastParagraph.offsetInContainerNode()) <= downcast<Text>(text->previousSibling())->length())
+ m_endOfLastParagraph = Position(downcast<Text>(text->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& start, const Position& end)
</span><span class="cx"> {
</span><del>- ASSERT(end.containerNode()->isTextNode());
</del><ins>+ ASSERT(is<Text>(end.containerNode()));
</ins><span class="cx">
</span><span class="cx"> bool shouldUpdateStart = start.anchorType() == Position::PositionIsOffsetInAnchor && start.containerNode() == end.containerNode();
</span><del>- Text* text = toText(end.deprecatedNode());
- splitTextNode(text, end.offsetInContainerNode());
</del><ins>+ Text& text = downcast<Text>(*end.deprecatedNode());
+ splitTextNode(&text, end.offsetInContainerNode());
</ins><span class="cx">
</span><del>- Node* prevNode = text->previousSibling();
- if (!prevNode || !prevNode->isTextNode())
</del><ins>+ Node* prevNode = text.previousSibling();
+ if (!prevNode || !is<Text>(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<Text>(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->previousSibling())
</span><span class="cx"> return;
</span><span class="cx"> Node* firstTextNode = parentElement->previousSibling()->lastChild();
</span><del>- if (!firstTextNode || !firstTextNode->isTextNode())
</del><ins>+ if (!firstTextNode || !is<Text>(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<Text>(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 < textNodes.size(); ++i) {
</span><span class="cx"> Text* childText = textNodes[i].get();
</span><span class="cx"> Node* next = childText->nextSibling();
</span><del>- if (!next || !next->isTextNode())
</del><ins>+ if (!next || !is<Text>(next))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- Text* nextText = toText(next);
</del><ins>+ Text& nextText = downcast<Text>(*next);
</ins><span class="cx"> if (start.anchorType() == Position::PositionIsOffsetInAnchor && next == start.containerNode())
</span><span class="cx"> newStart = Position(childText, childText->length() + start.offsetInContainerNode());
</span><span class="cx"> if (end.anchorType() == Position::PositionIsOffsetInAnchor && next == end.containerNode())
</span><span class="cx"> newEnd = Position(childText, childText->length() + end.offsetInContainerNode());
</span><del>- String textToMove = nextText->data();
</del><ins>+ String textToMove = nextText.data();
</ins><span class="cx"> insertTextIntoNode(childText, childText->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->isTextNode()) {
- Text* textNode = toText(startNode);
- if ((unsigned)pos.deprecatedEditingOffset() >= textNode->length()) {
</del><ins>+ if (is<Text>(startNode)) {
+ Text& textNode = downcast<Text>(*startNode);
+ if ((unsigned)pos.deprecatedEditingOffset() >= textNode.length()) {
</ins><span class="cx"> startNode = NodeTraversal::next(startNode);
</span><span class="cx"> ASSERT(startNode);
</span><span class="cx"> } else if (pos.deprecatedEditingOffset() > 0)
</span><del>- splitTextNode(textNode, pos.deprecatedEditingOffset());
</del><ins>+ splitTextNode(&textNode, pos.deprecatedEditingOffset());
</ins><span class="cx"> } else if (pos.deprecatedEditingOffset() > 0) {
</span><span class="cx"> Node* childAtOffset = startNode->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) >= offset)
</span><span class="cx"> insertNodeBefore(insertChild, refChild);
</span><del>- else if (refChild->isTextNode() && caretMaxOffset(refChild) > offset) {
- splitTextNode(toText(refChild), offset);
</del><ins>+ else if (is<Text>(refChild) && caretMaxOffset(refChild) > offset) {
+ splitTextNode(downcast<Text>(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->inDocument())
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx"> if (pos.offsetInContainerNode() >= 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<Text>(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& position) const
</span><span class="cx"> {
</span><span class="cx"> Node* node = position.containerNode();
</span><del>- if (position.anchorType() != Position::PositionIsOffsetInAnchor || !node || !node->isTextNode())
</del><ins>+ if (position.anchorType() != Position::PositionIsOffsetInAnchor || !node || !is<Text>(node))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Text* textNode = toText(node);
- if (textNode->length() == 0)
</del><ins>+ Text& textNode = downcast<Text>(*node);
+ if (!textNode.length())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> node->document().updateStyleIfNeeded();
</span><span class="cx">
</span><del>- RenderObject* renderer = textNode->renderer();
</del><ins>+ RenderObject* renderer = textNode.renderer();
</ins><span class="cx"> if (renderer && !renderer->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)->data();
</del><ins>+ String text = downcast<Text>(*node).data();
</ins><span class="cx"> if (!isWhitespace(text[offset])) {
</span><span class="cx"> offset--;
</span><span class="cx"> if (offset < 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<Text>(node), position.offsetInContainerNode(), position.offsetInContainerNode());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(PassRefPtr<Text> prpTextNode, int startOffset, int endOffset)
</span><span class="lines">@@ -748,13 +748,13 @@
</span><span class="cx"> void CompositeEditCommand::prepareWhitespaceAtPositionForSplit(Position& position)
</span><span class="cx"> {
</span><span class="cx"> Node* node = position.deprecatedNode();
</span><del>- if (!node || !node->isTextNode())
</del><ins>+ if (!node || !is<Text>(node))
</ins><span class="cx"> return;
</span><del>- Text* textNode = toText(node);
</del><ins>+ Text& textNode = downcast<Text>(*node);
</ins><span class="cx">
</span><del>- if (textNode->length() == 0)
</del><ins>+ if (!textNode.length())
</ins><span class="cx"> return;
</span><del>- RenderObject* renderer = textNode->renderer();
</del><ins>+ RenderObject* renderer = textNode.renderer();
</ins><span class="cx"> if (renderer && !renderer->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()) && previous.deprecatedNode()->isTextNode() && !previous.deprecatedNode()->hasTagName(brTag))
- replaceTextInNodePreservingMarkers(toText(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
- if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) && position.deprecatedNode()->isTextNode() && !position.deprecatedNode()->hasTagName(brTag))
- replaceTextInNodePreservingMarkers(toText(position.deprecatedNode()), position.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+ if (deprecatedIsCollapsibleWhitespace(previousVisiblePos.characterAfter()) && is<Text>(previous.deprecatedNode()) && !is<HTMLBRElement>(previous.deprecatedNode()))
+ replaceTextInNodePreservingMarkers(downcast<Text>(previous.deprecatedNode()), previous.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
+ if (deprecatedIsCollapsibleWhitespace(visiblePos.characterAfter()) && is<Text>(position.deprecatedNode()) && !is<HTMLBRElement>(position.deprecatedNode()))
+ replaceTextInNodePreservingMarkers(downcast<Text>(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<RefPtr<Text>> nodes;
</span><span class="cx"> for (Node* node = start.deprecatedNode(); node; node = NodeTraversal::next(node)) {
</span><del>- if (node->isTextNode())
- nodes.append(toText(node));
</del><ins>+ if (is<Text>(node))
+ nodes.append(downcast<Text>(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()->hasTagName(brTag)) {
</del><ins>+ if (is<HTMLBRElement>(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<Text>(p.anchorNode()), p.offsetInContainerNode(), 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Node> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& 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->hasTagName(brTag))
</del><ins>+ if (is<HTMLBRElement>(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->length() == 1)
</del><ins>+ Text& textNode = downcast<Text>(*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(&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()->hasTagName(brTag))
</span><span class="cx"> removeNodeAndPruneAncestors(caretPos.deprecatedNode());
</span><del>- else if (caretPos.deprecatedNode()->isTextNode()) {
</del><ins>+ else if (is<Text>(caretPos.deprecatedNode())) {
</ins><span class="cx"> ASSERT(caretPos.deprecatedEditingOffset() == 0);
</span><del>- Text* textNode = toText(caretPos.deprecatedNode());
- ContainerNode* parentNode = textNode->parentNode();
</del><ins>+ Text& textNode = downcast<Text>(*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(&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 >= caretMaxOffset(startNode) && startNode->isTextNode()) {
- Text* text = toText(startNode);
- if (text->length() > (unsigned)caretMaxOffset(startNode))
- deleteTextFromNode(text, caretMaxOffset(startNode), text->length() - caretMaxOffset(startNode));
</del><ins>+ if (startOffset >= caretMaxOffset(startNode) && is<Text>(startNode)) {
+ Text& text = downcast<Text>(*startNode);
+ if (text.length() > static_cast<unsigned>(caretMaxOffset(startNode)))
+ deleteTextFromNode(&text, caretMaxOffset(startNode), text.length() - caretMaxOffset(startNode));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (startOffset >= 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 > 0) {
</span><del>- if (startNode->isTextNode()) {
</del><ins>+ if (is<Text>(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& text = downcast<Text>(*startNode);
+ deleteTextFromNode(&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<Node> node(startNode);
</span><span class="cx">
</span><span class="cx"> if (startOffset > 0) {
</span><del>- if (startNode->isTextNode()) {
</del><ins>+ if (is<Text>(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->length() - startOffset);
</del><ins>+ Text& text = downcast<Text>(*node);
+ deleteTextFromNode(&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->traverseToChildAt(startOffset);
</span><span class="cx"> }
</span><del>- } else if (startNode == m_upstreamEnd.deprecatedNode() && startNode->isTextNode()) {
- Text* text = toText(m_upstreamEnd.deprecatedNode());
- deleteTextFromNode(text, 0, m_upstreamEnd.deprecatedEditingOffset());
</del><ins>+ } else if (startNode == m_upstreamEnd.deprecatedNode() && is<Text>(startNode)) {
+ Text& text = downcast<Text>(*m_upstreamEnd.deprecatedNode());
+ deleteTextFromNode(&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()->isTextNode()) {
</del><ins>+ if (is<Text>(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& text = downcast<Text>(*m_downstreamEnd.deprecatedNode());
</ins><span class="cx"> if (m_downstreamEnd.deprecatedEditingOffset() > 0) {
</span><del>- deleteTextFromNode(text, 0, m_downstreamEnd.deprecatedEditingOffset());
</del><ins>+ deleteTextFromNode(&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() && !m_leadingWhitespace.isRenderedCharacter() && m_leadingWhitespace.deprecatedNode()->isTextNode()) {
- Text* textNode = toText(m_leadingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
- replaceTextInNodePreservingMarkers(textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+ if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharacter() && is<Text>(m_leadingWhitespace.deprecatedNode())) {
+ Text& textNode = downcast<Text>(*m_leadingWhitespace.deprecatedNode());
+ ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
+ replaceTextInNodePreservingMarkers(&textNode, m_leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</ins><span class="cx"> }
</span><del>- if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && m_trailingWhitespace.deprecatedNode()->isTextNode()) {
- Text* textNode = toText(m_trailingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
- replaceTextInNodePreservingMarkers(textNode, m_trailingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+ if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedCharacter() && is<Text>(m_trailingWhitespace.deprecatedNode())) {
+ Text& textNode = downcast<Text>(*m_trailingWhitespace.deprecatedNode());
+ ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
+ replaceTextInNodePreservingMarkers(&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 && node->isTextNode()) {
- Text* textNode = toText(node);
- if (textNode->length())
- shouldRebalaceWhiteSpace = textNode->renderer()->style().textSecurity() == TSNONE;
</del><ins>+ if (node && is<Text>(node)) {
+ Text& textNode = downcast<Text>(*node);
+ if (textNode.length())
+ shouldRebalaceWhiteSpace = textNode.renderer()->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 && baseNode == extentNode && baseNode->isTextNode() && baseOffset + text.length() == extentOffset) {
- m_compositionNode = toText(baseNode);
</del><ins>+ if (baseNode && baseNode == extentNode && is<Text>(baseNode) && baseOffset + text.length() == extentOffset) {
+ m_compositionNode = downcast<Text>(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() >= caretMaxOffset(pos.deprecatedNode()) || !pos.deprecatedNode()->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()->isTextNode()) {
</del><ins>+ } else if (is<Text>(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& textNode = downcast<Text>(*pos.deprecatedNode());
+ splitTextNode(&textNode, pos.deprecatedEditingOffset());
+ insertNodeBefore(nodeToInsert, &textNode);
+ Position endingPosition = firstPositionInNode(&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(&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->renderer() || textNode->renderer()->style().collapseWhiteSpace());
</del><ins>+ ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
</ins><span class="cx"> // Deleting insignificant whitespace will remove textNode if it contains nothing but insignificant whitespace.
</span><del>- if (textNode->inDocument())
- insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
</del><ins>+ if (textNode.inDocument())
+ insertTextIntoNode(&textNode, 0, nonBreakingSpaceString());
</ins><span class="cx"> else {
</span><span class="cx"> RefPtr<Text> 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() && leadingWhitespace.deprecatedNode()->isTextNode()) {
- Text* textNode = toText(leadingWhitespace.deprecatedNode());
- ASSERT(!textNode->renderer() || textNode->renderer()->style().collapseWhiteSpace());
- replaceTextInNodePreservingMarkers(textNode, leadingWhitespace.deprecatedEditingOffset(), 1, nonBreakingSpaceString());
</del><ins>+ if (leadingWhitespace.isNotNull() && is<Text>(leadingWhitespace.deprecatedNode())) {
+ Text& textNode = downcast<Text>(*leadingWhitespace.deprecatedNode());
+ ASSERT(!textNode.renderer() || textNode.renderer()->style().collapseWhiteSpace());
+ replaceTextInNodePreservingMarkers(&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 && insertionPosition.containerNode()->isTextNode()) {
- RefPtr<Text> textNode = toText(insertionPosition.containerNode());
</del><ins>+ if (insertionPosition.anchorType() == Position::PositionIsOffsetInAnchor && is<Text>(insertionPosition.containerNode())) {
+ RefPtr<Text> textNode = downcast<Text>(insertionPosition.containerNode());
</ins><span class="cx"> bool atEnd = static_cast<unsigned>(insertionPosition.offsetInContainerNode()) >= textNode->length();
</span><span class="cx"> if (insertionPosition.deprecatedEditingOffset() > 0 && !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()->renderer() || positionAfterSplit.containerNode()->renderer()->style().collapseWhiteSpace());
</span><span class="cx"> deleteInsignificantTextDownstream(positionAfterSplit);
</span><del>- if (positionAfterSplit.deprecatedNode()->isTextNode())
- insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0, nonBreakingSpaceString());
</del><ins>+ if (is<Text>(positionAfterSplit.deprecatedNode()))
+ insertTextIntoNode(downcast<Text>(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<Text> textNode = toText(node);
</del><ins>+ RefPtr<Text> textNode = downcast<Text>(node);
</ins><span class="cx"> insertTextIntoNode(textNode, offset, "\t");
</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<Element> spanNode = createTabSpanElement(document());
</span><span class="cx">
</span><span class="cx"> // place it
</span><del>- if (!node->isTextNode()) {
</del><ins>+ if (!is<Text>(node)) {
</ins><span class="cx"> insertNodeAt(spanNode.get(), insertPos);
</span><span class="cx"> } else {
</span><del>- RefPtr<Text> textNode = toText(node);
</del><ins>+ RefPtr<Text> textNode = downcast<Text>(node);
</ins><span class="cx"> if (offset >= textNode->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<Text>(node));
</ins><span class="cx"> break;
</span><span class="cx"> case Node::COMMENT_NODE:
</span><span class="cx"> appendComment(result, downcast<Comment>(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 && lastLeafInserted->isTextNode() && !hasRenderedText(toText(*lastLeafInserted))
</del><ins>+ if (lastLeafInserted && is<Text>(lastLeafInserted) && !hasRenderedText(downcast<Text>(*lastLeafInserted))
</ins><span class="cx"> && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
</span><span class="cx"> && !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 && firstNodeInserted->isTextNode() && !hasRenderedText(toText(*firstNodeInserted))) {
</del><ins>+ if (firstNodeInserted && is<Text>(firstNodeInserted) && !hasRenderedText(downcast<Text>(*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 && endNode->isTextNode() ? toText(endNode)->length() : 0;
</del><ins>+ int endOffset = endNode && is<Text>(endNode) ? downcast<Text>(*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) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(endOfInsertedContent.characterAfter(), false);
</span><span class="cx"> if (needsTrailingSpace && endNode) {
</span><span class="cx"> bool collapseWhiteSpace = !endNode->renderer() || endNode->renderer()->style().collapseWhiteSpace();
</span><del>- if (endNode->isTextNode()) {
- insertTextIntoNode(toText(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
</del><ins>+ if (is<Text>(endNode)) {
+ insertTextIntoNode(downcast<Text>(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
</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) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(startOfInsertedContent.previous().characterAfter(), true);
</span><span class="cx"> if (needsLeadingSpace && startNode) {
</span><span class="cx"> bool collapseWhiteSpace = !startNode->renderer() || startNode->renderer()->style().collapseWhiteSpace();
</span><del>- if (startNode->isTextNode()) {
- insertTextIntoNode(toText(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
</del><ins>+ if (is<Text>(startNode)) {
+ insertTextIntoNode(downcast<Text>(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " ");
</ins><span class="cx"> if (m_endOfInsertedContent.containerNode() == startNode && 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<Text> text = 0;
- if (positionIsOffsetInAnchor && position.containerNode() && position.containerNode()->isTextNode())
- text = toText(position.containerNode());
</del><ins>+ RefPtr<Text> text;
+ if (positionIsOffsetInAnchor && position.containerNode() && is<Text>(position.containerNode()))
+ text = downcast<Text>(position.containerNode());
</ins><span class="cx"> else {
</span><span class="cx"> Node* before = position.computeNodeBeforePosition();
</span><del>- if (before && before->isTextNode())
- text = toText(before);
</del><ins>+ if (before && is<Text>(before))
+ text = downcast<Text>(before);
</ins><span class="cx"> else {
</span><span class="cx"> Node* after = position.computeNodeAfterPosition();
</span><del>- if (after && after->isTextNode())
- text = toText(after);
</del><ins>+ if (after && is<Text>(after))
+ text = downcast<Text>(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->previousSibling() && text->previousSibling()->isTextNode()) {
- RefPtr<Text> previous = toText(text->previousSibling());
</del><ins>+ if (text->previousSibling() && is<Text>(text->previousSibling())) {
+ RefPtr<Text> previous = downcast<Text>(text->previousSibling());
</ins><span class="cx"> insertTextIntoNode(text, 0, previous->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->nextSibling() && text->nextSibling()->isTextNode()) {
- RefPtr<Text> next = toText(text->nextSibling());
</del><ins>+ if (text->nextSibling() && is<Text>(text->nextSibling())) {
+ RefPtr<Text> next = downcast<Text>(text->nextSibling());
</ins><span class="cx"> unsigned originalLength = text->length();
</span><span class="cx"> insertTextIntoNode(text, originalLength, next->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()->isTextNode() && textNodeOffset > 0)
- splitTextNode(toText(insertPos.deprecatedNode()), textNodeOffset);
</del><ins>+ if (is<Text>(insertPos.deprecatedNode()) && textNodeOffset > 0)
+ splitTextNode(downcast<Text>(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& fragment)
</span><span class="cx"> {
</span><del>- if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !fragment.firstChild()->isTextNode())
</del><ins>+ if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !is<Text>(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<Node> nodeAfterInsertionPos = endingSelection().end().downstream().anchorNode();
</span><del>- Text* textNode = toText(fragment.firstChild());
</del><ins>+ Text& textNode = downcast<Text>(*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->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& textNode = toText(*m_node);
</del><ins>+ Text& textNode = downcast<Text>(*m_node);
</ins><span class="cx">
</span><span class="cx"> if (m_fullyClippedStack.top() && !(m_behavior & 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& textNode = toText(*m_node);
</del><ins>+ Text& textNode = downcast<Text>(*m_node);
</ins><span class="cx">
</span><span class="cx"> auto& renderer = m_firstLetterText ? *m_firstLetterText : *textNode.renderer();
</span><span class="cx"> if (renderer.style().visibility() != VISIBLE && !(m_behavior & 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& textNode = toText(*m_node);
</del><ins>+ Text& textNode = downcast<Text>(*m_node);
</ins><span class="cx">
</span><span class="cx"> m_lastTextNode = &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->isTextNode() ? Position(toText(startNode), toInlineTextBox(startBox)->start())
</del><ins>+ return is<Text>(startNode) ? Position(downcast<Text>(startNode), toInlineTextBox(startBox)->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->hasTagName(brTag))
</span><span class="cx"> pos = positionBeforeNode(endNode);
</span><del>- else if (endBox->isInlineTextBox() && endNode->isTextNode()) {
</del><ins>+ else if (endBox->isInlineTextBox() && is<Text>(endNode)) {
</ins><span class="cx"> InlineTextBox* endTextBox = toInlineTextBox(endBox);
</span><span class="cx"> int endOffset = endTextBox->start();
</span><span class="cx"> if (!endTextBox->isLineBreak())
</span><span class="cx"> endOffset += endTextBox->len();
</span><del>- pos = Position(toText(endNode), endOffset);
</del><ins>+ pos = Position(downcast<Text>(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->isText() && toRenderText(r)->hasRenderedText()) {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(n));
</ins><span class="cx"> type = Position::PositionIsOffsetInAnchor;
</span><span class="cx"> if (style.preserveNewline()) {
</span><span class="cx"> StringImpl& text = *toRenderText(r)->text();
</span><span class="lines">@@ -1148,7 +1148,7 @@
</span><span class="cx"> i = std::max(0, o);
</span><span class="cx"> while (--i >= 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<Text>(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->isText() && toRenderText(r)->hasRenderedText()) {
</span><del>- ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
</del><ins>+ ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(n));
</ins><span class="cx"> type = Position::PositionIsOffsetInAnchor;
</span><span class="cx"> if (style.preserveNewline()) {
</span><span class="cx"> StringImpl& text = *toRenderText(r)->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 < 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<Text>(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()->renderer())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (!position.anchorNode()->isTextNode() || !position.anchorNode()->renderer()->style().preserveNewline())
</del><ins>+ if (!is<Text>(position.anchorNode()) || !position.anchorNode()->renderer()->style().preserveNewline())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- Text* textNode = toText(position.anchorNode());
</del><ins>+ Text& textNode = downcast<Text>(*position.anchorNode());
</ins><span class="cx"> unsigned offset = position.offsetInContainerNode();
</span><del>- return offset < textNode->length() && textNode->data()[offset] == '\n';
</del><ins>+ return offset < textNode.length() && 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& node, const Range* range)
</span><span class="cx"> {
</span><del>- if (!node.isTextNode())
</del><ins>+ if (!is<Text>(node))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><del>- const Text& textNode = toText(node);
</del><ins>+ const Text& textNode = downcast<Text>(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(&containerNode.get()) && hasOneTextChild(fragment.get())) {
</span><del>- toText(containerNode->firstChild())->setData(toText(fragment->firstChild())->data(), ec);
</del><ins>+ downcast<Text>(*containerNode->firstChild()).setData(downcast<Text>(*fragment->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(&containerNode.get())) {
</span><del>- toText(containerNode->firstChild())->setData(text, ec);
</del><ins>+ downcast<Text>(*containerNode->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& node, ExceptionCode& ec)
</span><span class="cx"> {
</span><span class="cx"> Node* next = node.nextSibling();
</span><del>- if (!next || !next->isTextNode())
</del><ins>+ if (!next || !is<Text>(next))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> Ref<Text> textNode(node);
</span><del>- Ref<Text> textNext(toText(*next));
</del><ins>+ Ref<Text> textNext(downcast<Text>(*next));
</ins><span class="cx"> textNode->appendData(textNext->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->replaceChild(fragment.release(), this, ec);
</span><span class="cx"> RefPtr<Node> node = next ? next->previousSibling() : nullptr;
</span><del>- if (!ec && node && node->isTextNode())
- mergeWithNextTextNode(toText(*node), ec);
- if (!ec && prev && prev->isTextNode())
- mergeWithNextTextNode(toText(*prev), ec);
</del><ins>+ if (!ec && node && is<Text>(*node))
+ mergeWithNextTextNode(downcast<Text>(*node), ec);
+ if (!ec && prev && is<Text>(*prev))
+ mergeWithNextTextNode(downcast<Text>(*prev), ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<DocumentFragment> HTMLElement::textToFragment(const String& text, ExceptionCode& ec)
</span><span class="lines">@@ -597,10 +597,10 @@
</span><span class="cx"> parent->replaceChild(newChild.release(), this, ec);
</span><span class="cx">
</span><span class="cx"> RefPtr<Node> node = next ? next->previousSibling() : nullptr;
</span><del>- if (!ec && node && node->isTextNode())
- mergeWithNextTextNode(toText(*node), ec);
- if (!ec && prev && prev->isTextNode())
- mergeWithNextTextNode(toText(*prev), ec);
</del><ins>+ if (!ec && node && is<Text>(*node))
+ mergeWithNextTextNode(downcast<Text>(*node), ec);
+ if (!ec && prev && is<Text>(*prev))
+ mergeWithNextTextNode(downcast<Text>(*prev), ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* HTMLElement::insertAdjacent(const String& where, Node* newChild, ExceptionCode& 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->nextSibling()) {
</span><span class="cx"> // Ignore whitespace-only text, and <param> tags, any other content is fallback content.
</span><del>- if (child->isTextNode()) {
- if (!toText(child)->containsOnlyWhitespace())
</del><ins>+ if (is<Text>(child)) {
+ if (!downcast<Text>(*child).containsOnlyWhitespace())
</ins><span class="cx"> return true;
</span><del>- } else if (!child->hasTagName(paramTag))
</del><ins>+ } else if (!is<HTMLParamElement>(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->tagQName()) && !element->hasTagName(paramTag))
</span><span class="cx"> isNamedItem = false;
</span><del>- } else if (child->isTextNode()) {
- if (!toText(child)->containsOnlyWhitespace())
</del><ins>+ } else if (is<Text>(child)) {
+ if (!downcast<Text>(*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 && child->isTextNode() && !child->nextSibling())
- toText(child)->setData(text, ec);
</del><ins>+ if (child && is<Text>(child) && !child->nextSibling())
+ downcast<Text>(*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<HTMLScriptElement> protectFromMutationEvents(*this);
</span><span class="cx">
</span><del>- if (hasOneChild() && firstChild()->isTextNode()) {
- toText(firstChild())->setData(value, IGNORE_EXCEPTION);
</del><ins>+ if (hasOneChild() && is<Text>(firstChild())) {
+ downcast<Text>(*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->hasTagName(brTag))
</del><ins>+ if (is<HTMLBRElement>(node))
</ins><span class="cx"> result.append(newlineCharacter);
</span><del>- else if (node->isTextNode())
- result.append(toText(node)->data());
</del><ins>+ else if (is<Text>(node))
+ result.append(downcast<Text>(*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->isTextNode()) {
- Text& text = toText(*node);
</del><ins>+ } else if (is<Text>(node)) {
+ Text& text = downcast<Text>(*node);
</ins><span class="cx"> if (remainingCharactersToMoveForward < text.length())
</span><span class="cx"> return Position(&text, remainingCharactersToMoveForward);
</span><span class="cx"> remainingCharactersToMoveForward -= text.length();
</span><span class="lines">@@ -607,14 +607,14 @@
</span><span class="cx"> ASSERT(innerText->contains(startNode));
</span><span class="cx">
</span><span class="cx"> for (Node* node = startNode; node; node = NodeTraversal::previous(node, innerText)) {
</span><del>- if (node->isTextNode()) {
- unsigned length = toText(*node).length();
</del><ins>+ if (is<Text>(node)) {
+ unsigned length = downcast<Text>(*node).length();
</ins><span class="cx"> if (node == passedPosition.containerNode())
</span><span class="cx"> index += std::min<unsigned>(length, passedPosition.offsetInContainerNode());
</span><span class="cx"> else
</span><span class="cx"> index += length;
</span><del>- } else if (node->hasTagName(brTag))
- index++;
</del><ins>+ } else if (is<HTMLBRElement>(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->firstChild(); node; node = NodeTraversal::next(node, innerText)) {
</span><del>- if (node->hasTagName(brTag))
</del><ins>+ if (is<HTMLBRElement>(node))
</ins><span class="cx"> result.append(newlineCharacter);
</span><del>- else if (node->isTextNode()) {
- String data = toText(node)->data();
</del><ins>+ else if (is<Text>(node)) {
+ String data = downcast<Text>(*node).data();
</ins><span class="cx"> unsigned length = data.length();
</span><span class="cx"> unsigned position = 0;
</span><span class="cx"> while (breakNode == node && breakOffset <= 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<HTMLTitleElement> protectFromMutationEvents(*this);
</span><span class="cx">
</span><del>- if (hasOneChild() && firstChild()->isTextNode())
- toText(firstChild())->setData(value, IGNORE_EXCEPTION);
</del><ins>+ if (hasOneChild() && is<Text>(firstChild()))
+ downcast<Text>(*firstChild()).setData(value, IGNORE_EXCEPTION);
</ins><span class="cx"> else {
</span><span class="cx"> // We make a copy here because entity of "value" 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 <https://bugs.webkit.org/show_bug.cgi?id=55898>.
</span><span class="cx">
</span><span class="cx"> Node* previousChild = task.nextChild ? task.nextChild->previousSibling() : task.parent->lastChild();
</span><del>- if (previousChild && previousChild->isTextNode()) {
</del><ins>+ if (previousChild && is<Text>(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->parserAppendData(characters, 0, lengthLimit);
</del><ins>+ Text& textNode = downcast<Text>(*previousChild);
+ currentPosition = textNode.parserAppendData(characters, 0, lengthLimit);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> while (currentPosition < 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->replaceWholeText(toText(node), value, errorString);
</del><ins>+ m_domEditor->replaceWholeText(downcast<Text>(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<Inspector::Protocol::Array<Inspector::Protocol::DOM::EventListener>>& 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&, PassRefPtr<StringImpl>);
</span><span class="cx">
</span><del>- Text& textNode() const { return toText(nodeForNonAnonymous()); }
</del><ins>+ Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); }
</ins><span class="cx">
</span><span class="cx"> void combineText();
</span><span class="cx"> void adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& 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->firstTextBox(); box; box = box->nextTextBox()) {
</span><span class="cx"> if (offsetTop + box->logicalBottom() < logicalTopForRegion)
</span><span class="cx"> continue;
</span><del>- range->setStart(Position(toText(node), box->start()));
</del><ins>+ range->setStart(Position(downcast<Text>(node), box->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->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->firstTextBox(); box; box = box->nextTextBox()) {
</span><span class="cx"> if ((offsetTop + box->logicalTop()) < 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->setEnd(Position(toText(node), lastBox->start() + lastBox->len()));
</del><ins>+ range->setEnd(Position(downcast<Text>(node), lastBox->start() + lastBox->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<Text>(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&, const String&);
</span><span class="cx">
</span><del>- Text& textNode() const { return toText(nodeForNonAnonymous()); }
</del><ins>+ Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); }
</ins><span class="cx">
</span><span class="cx"> bool characterStartsNewTextChunk(int position) const;
</span><span class="cx"> SVGTextLayoutAttributes* layoutAttributes() { return &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->isTextNode())
</del><ins>+ if (!is<Text>(sibling))
</ins><span class="cx"> continue;
</span><del>- Text& textSibling = toText(*sibling);
</del><ins>+ Text& textSibling = downcast<Text>(*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->renderer());
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (child->isTextNode()) {
- attachTextRenderer(*toText(child), renderTreePosition);
</del><ins>+ if (is<Text>(child)) {
+ attachTextRenderer(downcast<Text>(*child), renderTreePosition);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (child->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->renderer())
</span><span class="cx"> renderTreePosition.invalidateNextSibling(*current->renderer());
</span><del>- if (current->isTextNode()) {
</del><ins>+ if (is<Text>(current)) {
</ins><span class="cx"> if (current->renderer())
</span><span class="cx"> continue;
</span><del>- attachTextRenderer(*toText(current), renderTreePosition);
</del><ins>+ attachTextRenderer(downcast<Text>(*current), renderTreePosition);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (current->isElementNode()) {
</span><span class="lines">@@ -651,8 +651,8 @@
</span><span class="cx"> static void detachDistributedChildren(InsertionPoint& insertionPoint)
</span><span class="cx"> {
</span><span class="cx"> for (Node* current = insertionPoint.firstDistributed(); current; current = insertionPoint.nextDistributedTo(current)) {
</span><del>- if (current->isTextNode()) {
- detachTextRenderer(*toText(current));
</del><ins>+ if (is<Text>(current)) {
+ detachTextRenderer(downcast<Text>(*current));
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (current->isElementNode())
</span><span class="lines">@@ -666,8 +666,8 @@
</span><span class="cx"> detachDistributedChildren(downcast<InsertionPoint>(current));
</span><span class="cx">
</span><span class="cx"> for (Node* child = current.firstChild(); child; child = child->nextSibling()) {
</span><del>- if (child->isTextNode()) {
- Style::detachTextRenderer(*toText(child));
</del><ins>+ if (is<Text>(child)) {
+ Style::detachTextRenderer(downcast<Text>(*child));
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (child->isElementNode())
</span><span class="lines">@@ -815,8 +815,8 @@
</span><span class="cx"> for (Node* child = shadowRoot.firstChild(); child; child = child->nextSibling()) {
</span><span class="cx"> if (child->renderer())
</span><span class="cx"> renderTreePosition.invalidateNextSibling(*child->renderer());
</span><del>- if (child->isTextNode() && child->needsStyleRecalc()) {
- resolveTextNode(*toText(child), renderTreePosition);
</del><ins>+ if (is<Text>(child) && child->needsStyleRecalc()) {
+ resolveTextNode(downcast<Text>(*child), renderTreePosition);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (child->isElementNode())
</span><span class="lines">@@ -939,8 +939,8 @@
</span><span class="cx"> for (Node* child = current.firstChild(); child; child = child->nextSibling()) {
</span><span class="cx"> if (RenderObject* childRenderer = child->renderer())
</span><span class="cx"> childRenderTreePosition.invalidateNextSibling(*childRenderer);
</span><del>- if (child->isTextNode() && child->needsStyleRecalc()) {
- resolveTextNode(*toText(child), childRenderTreePosition);
</del><ins>+ if (is<Text>(child) && child->needsStyleRecalc()) {
+ resolveTextNode(downcast<Text>(*child), childRenderTreePosition);
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> if (!child->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 <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Use the new is<>() / downcast<>() for Text Nodes
+ https://bugs.webkit.org/show_bug.cgi?id=137188
+
+ Reviewed by Darin Adler.
+
+ Use the new is<>() / downcast<>() functions for Text Nodes instead of
+ isText() / toText().
+
+ * WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
+ (-[WKDOMText data]):
+ (-[WKDOMText setData:]):
+
+2014-09-29 Christophe Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Make is<>() / downcast<>() 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())->data();
</del><ins>+ return WebCore::downcast<WebCore::Text>(*_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())->setData(data, ec);
</del><ins>+ WebCore::downcast<WebCore::Text>(*_impl).setData(data, ec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @end
</span></span></pre>
</div>
</div>
</body>
</html>