<!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>[174403] 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/174403">174403</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-07 12:33:53 -0700 (Tue, 07 Oct 2014)</dd>
</dl>

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

Reviewed by Darin Adler.

Source/WebCore:

Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment, and
clean up the surrounding code.

No new tests, no behavior change.

* WebCore.exp.in:
Export symbol for RenderInline::linesBoundingBox() as it is used by
RenderInline::orderBoundingBox() which is inlined and now called in
WebRenderNode.mm.

* WebCore.xcodeproj/project.pbxproj:
Make RenderInline.h header as Private so that it can be included by
WebRenderNode.mm, similarly to RenderText.h.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement):
(WebCore::AccessibilityRenderObject::boundingBoxRect):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::passwordFieldValue):
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::getLengthForTextRange):
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMNode textHeight]):
(-[DOMNode findExplodedTextNodeAtPoint:]):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getUpperLeftCorner):
(WebCore::ContainerNode::getLowerRightCorner):
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
* dom/Position.cpp:
(WebCore::hasInlineBoxWrapper):
(WebCore::Position::upstream):
(WebCore::Position::downstream):
(WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
(WebCore::Position::isCandidate):
(WebCore::Position::rendersInDifferentPosition):
(WebCore::searchAheadForBetterMatch):
(WebCore::Position::getInlineBoxAndOffset):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate):
* dom/Range.cpp:
(WebCore::Range::textRects):
(WebCore::Range::textQuads):
(WebCore::Range::getBorderAndTextQuads):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::debugRenderer):
* editing/TextIterator.cpp:
(WebCore::hasVisibleTextNode):
(WebCore::TextIterator::handleTextNode):
(WebCore::maxOffsetIncludingCollapsedSpaces):
(WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter):
* editing/VisibleUnits.cpp:
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* page/FrameView.cpp:
(WebCore::countRenderedCharactersInRenderObjectWithThreshold):
* rendering/BidiRun.cpp:
(WebCore::BidiRun::BidiRun):
* rendering/InlineIterator.cpp:
(WebCore::InlineIterator::surrogateTextDirection):
* rendering/InlineIterator.h:
(WebCore::InlineIterator::atTextParagraphSeparator):
(WebCore::InlineIterator::atParagraphSeparator):
(WebCore::isEmptyInline):
(WebCore::InlineIterator::fastIncrementInTextNode):
(WebCore::InlineIterator::increment):
(WebCore::InlineIterator::characterAt):
(WebCore::InlineIterator::direction):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::renderer):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
(WebCore::isVisibleRenderText):
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
(WebCore::stripTrailingSpace):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::createInlineBoxForRenderer):
(WebCore::dirtyLineBoxesForRenderer):
(WebCore::reachedEndOfTextRenderer):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
(WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
(WebCore::RenderBlockFlow::handleTrailingSpaces):
(WebCore::RenderBlockFlow::determineStartPosition):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::hasImmediateNonWhitespaceTextChildOrBorderOrOutline):
(WebCore::RenderElement::addChild):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::generateCulledLineBoxRects):
(WebCore::RenderInline::culledInlineFirstLineBox):
(WebCore::RenderInline::culledInlineLastLineBox):
(WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
(WebCore::RenderInline::dirtyLineBoxes):
* rendering/RenderInline.h:
Make borderBoundingBox() public so that call sites (here
WebRenderNode.mm) can use tighter typing and benefit from the virtual
function being final.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::getOverhang):
* rendering/RenderSelectionInfo.cpp:
(WebCore::RenderSelectionInfo::RenderSelectionInfo):
* rendering/RenderText.cpp:
(WebCore::isInlineFlowOrEmptyText):
(WebCore::RenderText::previousCharacter):
* rendering/RenderText.h:
(WebCore::Text::renderer):
* rendering/RenderTextFragment.h:
(isType):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::write):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):
(WebCore::SimpleLineLayout::create):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
(WebCore::SimpleLineLayout::hitTestFlow):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::RunResolver):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::addNode):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::containerIsRowOfLinks):
(WebCore::TextAutosizer::measureDescendantTextWidth):
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::shouldAddBorderPaddingMargin):
(WebCore::shouldSkipWhitespaceAfterStartObject):
(WebCore::BreakingContext::handleText):
(WebCore::textBeginsWithBreakablePosition):
(WebCore::BreakingContext::canBreakAtThisPosition):

Source/WebKit/mac:

* WebView/WebRenderNode.mm:
(copyRenderNode):

Source/WebKit2:

Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment.

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp">trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerControllercpp">trunk/Source/WebCore/dom/DocumentMarkerController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositionIteratorcpp">trunk/Source/WebCore/dom/PositionIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.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="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingBidiRuncpp">trunk/Source/WebCore/rendering/BidiRun.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorcpp">trunk/Source/WebCore/rendering/InlineIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorh">trunk/Source/WebCore/rendering/InlineIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineTextBoxh">trunk/Source/WebCore/rendering/InlineTextBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlineh">trunk/Source/WebCore/rendering/RenderInline.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLineBoxListcpp">trunk/Source/WebCore/rendering/RenderLineBoxList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowThreadcpp">trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyRuncpp">trunk/Source/WebCore/rendering/RenderRubyRun.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSelectionInfocpp">trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTexth">trunk/Source/WebCore/rendering/RenderText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextFragmenth">trunk/Source/WebCore/rendering/RenderTextFragment.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutcpp">trunk/Source/WebCore/rendering/SimpleLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp">trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutResolverh">trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutoSizingcpp">trunk/Source/WebCore/rendering/TextAutoSizing.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutosizercpp">trunk/Source/WebCore/rendering/TextAutosizer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh">trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineLineBreakercpp">trunk/Source/WebCore/rendering/line/LineBreaker.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebRenderNodemm">trunk/Source/WebKit/mac/WebView/WebRenderNode.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebRenderObjectcpp">trunk/Source/WebKit2/Shared/WebRenderObject.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/ChangeLog        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1,3 +1,154 @@
</span><ins>+2014-10-07  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment
+        https://bugs.webkit.org/show_bug.cgi?id=137476
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment, and
+        clean up the surrounding code.
+
+        No new tests, no behavior change.
+
+        * WebCore.exp.in:
+        Export symbol for RenderInline::linesBoundingBox() as it is used by
+        RenderInline::orderBoundingBox() which is inlined and now called in
+        WebRenderNode.mm.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Make RenderInline.h header as Private so that it can be included by
+        WebRenderNode.mm, similarly to RenderText.h.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textUnderElement):
+        (WebCore::AccessibilityRenderObject::boundingBoxRect):
+        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::passwordFieldValue):
+        * accessibility/atk/AccessibilityObjectAtk.cpp:
+        (WebCore::AccessibilityObject::getLengthForTextRange):
+        * bindings/objc/DOMUIKitExtensions.mm:
+        (-[DOMNode textHeight]):
+        (-[DOMNode findExplodedTextNodeAtPoint:]):
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getUpperLeftCorner):
+        (WebCore::ContainerNode::getLowerRightCorner):
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::addMarker):
+        * dom/Position.cpp:
+        (WebCore::hasInlineBoxWrapper):
+        (WebCore::Position::upstream):
+        (WebCore::Position::downstream):
+        (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
+        (WebCore::Position::isCandidate):
+        (WebCore::Position::rendersInDifferentPosition):
+        (WebCore::searchAheadForBetterMatch):
+        (WebCore::Position::getInlineBoxAndOffset):
+        * dom/PositionIterator.cpp:
+        (WebCore::PositionIterator::isCandidate):
+        * dom/Range.cpp:
+        (WebCore::Range::textRects):
+        (WebCore::Range::textQuads):
+        (WebCore::Range::getBorderAndTextQuads):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::debugRenderer):
+        * editing/TextIterator.cpp:
+        (WebCore::hasVisibleTextNode):
+        (WebCore::TextIterator::handleTextNode):
+        (WebCore::maxOffsetIncludingCollapsedSpaces):
+        (WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter):
+        * editing/VisibleUnits.cpp:
+        (WebCore::startOfParagraph):
+        (WebCore::endOfParagraph):
+        * page/FrameView.cpp:
+        (WebCore::countRenderedCharactersInRenderObjectWithThreshold):
+        * rendering/BidiRun.cpp:
+        (WebCore::BidiRun::BidiRun):
+        * rendering/InlineIterator.cpp:
+        (WebCore::InlineIterator::surrogateTextDirection):
+        * rendering/InlineIterator.h:
+        (WebCore::InlineIterator::atTextParagraphSeparator):
+        (WebCore::InlineIterator::atParagraphSeparator):
+        (WebCore::isEmptyInline):
+        (WebCore::InlineIterator::fastIncrementInTextNode):
+        (WebCore::InlineIterator::increment):
+        (WebCore::InlineIterator::characterAt):
+        (WebCore::InlineIterator::direction):
+        * rendering/InlineTextBox.h:
+        (WebCore::InlineTextBox::renderer):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateFirstLetterStyle):
+        (WebCore::RenderBlock::updateFirstLetter):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
+        (WebCore::isVisibleRenderText):
+        (WebCore::RenderBlockFlow::adjustComputedFontSizes):
+        (WebCore::stripTrailingSpace):
+        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::createInlineBoxForRenderer):
+        (WebCore::dirtyLineBoxesForRenderer):
+        (WebCore::reachedEndOfTextRenderer):
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
+        (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
+        (WebCore::RenderBlockFlow::handleTrailingSpaces):
+        (WebCore::RenderBlockFlow::determineStartPosition):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::moveChildrenTo):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::hasImmediateNonWhitespaceTextChildOrBorderOrOutline):
+        (WebCore::RenderElement::addChild):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::generateCulledLineBoxRects):
+        (WebCore::RenderInline::culledInlineFirstLineBox):
+        (WebCore::RenderInline::culledInlineLastLineBox):
+        (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
+        (WebCore::RenderInline::dirtyLineBoxes):
+        * rendering/RenderInline.h:
+        Make borderBoundingBox() public so that call sites (here
+        WebRenderNode.mm) can use tighter typing and benefit from the virtual
+        function being final.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLineBoxList.cpp:
+        (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
+        * rendering/RenderNamedFlowThread.cpp:
+        (WebCore::RenderNamedFlowThread::getRanges):
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::getOverhang):
+        * rendering/RenderSelectionInfo.cpp:
+        (WebCore::RenderSelectionInfo::RenderSelectionInfo):
+        * rendering/RenderText.cpp:
+        (WebCore::isInlineFlowOrEmptyText):
+        (WebCore::RenderText::previousCharacter):
+        * rendering/RenderText.h:
+        (WebCore::Text::renderer):
+        * rendering/RenderTextFragment.h:
+        (isType):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        (WebCore::write):
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::canUseFor):
+        (WebCore::SimpleLineLayout::create):
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::paintFlow):
+        (WebCore::SimpleLineLayout::hitTestFlow):
+        * rendering/SimpleLineLayoutResolver.h:
+        (WebCore::SimpleLineLayout::RunResolver::RunResolver):
+        * rendering/TextAutoSizing.cpp:
+        (WebCore::TextAutoSizingValue::addNode):
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::containerIsRowOfLinks):
+        (WebCore::TextAutosizer::measureDescendantTextWidth):
+        * rendering/line/BreakingContextInlineHeaders.h:
+        (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
+        (WebCore::shouldAddBorderPaddingMargin):
+        (WebCore::shouldSkipWhitespaceAfterStartObject):
+        (WebCore::BreakingContext::handleText):
+        (WebCore::textBeginsWithBreakablePosition):
+        (WebCore::BreakingContext::canBreakAtThisPosition):
+
</ins><span class="cx"> 2014-10-07  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Media] Expose AudioTracks in the &quot;captions&quot; menu.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1628,6 +1628,7 @@
</span><span class="cx"> __ZNK7WebCore11RenderStyle15fontDescriptionEv
</span><span class="cx"> __ZNK7WebCore11RenderStyle21visitedDependentColorEi
</span><span class="cx"> __ZNK7WebCore11RenderStyle4fontEv
</span><ins>+__ZNK7WebCore12RenderInline16linesBoundingBoxEv
</ins><span class="cx"> __ZNK7WebCore12RenderObject14enclosingLayerEv
</span><span class="cx"> __ZNK7WebCore12RenderObject15localToAbsoluteERKNS_10FloatPointEj
</span><span class="cx"> __ZNK7WebCore12RenderObject16repaintRectangleERKNS_10LayoutRectEb
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -5413,7 +5413,7 @@
</span><span class="cx">                 BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4836097D93020094C9E4 /* RenderImage.cpp */; };
</span><span class="cx">                 BCEA4876097D93020094C9E4 /* RenderImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4837097D93020094C9E4 /* RenderImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4838097D93020094C9E4 /* RenderInline.cpp */; };
</span><del>-                BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4839097D93020094C9E4 /* RenderInline.h */; };
</del><ins>+                BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA4839097D93020094C9E4 /* RenderInline.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BCEA4879097D93020094C9E4 /* RenderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA483A097D93020094C9E4 /* RenderLayer.cpp */; };
</span><span class="cx">                 BCEA487A097D93020094C9E4 /* RenderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA483B097D93020094C9E4 /* RenderLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4840097D93020094C9E4 /* RenderObject.cpp */; };
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -647,13 +647,13 @@
</span><span class="cx"> #if ENABLE(MATHML)
</span><span class="cx">     // Math operators create RenderText nodes on the fly that are not tied into the DOM in a reasonable way,
</span><span class="cx">     // so rangeOfContents does not work for them (nor does regular text selection).
</span><del>-    if (m_renderer-&gt;isText() &amp;&amp; m_renderer-&gt;isAnonymous() &amp;&amp; ancestorsOfType&lt;RenderMathMLOperator&gt;(*m_renderer).first())
-        return toRenderText(*m_renderer).text();
</del><ins>+    if (is&lt;RenderText&gt;(*m_renderer) &amp;&amp; m_renderer-&gt;isAnonymous() &amp;&amp; ancestorsOfType&lt;RenderMathMLOperator&gt;(*m_renderer).first())
+        return downcast&lt;RenderText&gt;(*m_renderer).text();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // We use a text iterator for text objects AND for those cases where we are
</span><span class="cx">     // explicitly asking for the full text under a given element.
</span><del>-    if (m_renderer-&gt;isText() || mode.childrenInclusion == AccessibilityTextUnderElementMode::TextUnderElementModeIncludeAllChildren) {
</del><ins>+    if (is&lt;RenderText&gt;(*m_renderer) || mode.childrenInclusion == AccessibilityTextUnderElementMode::TextUnderElementModeIncludeAllChildren) {
</ins><span class="cx">         // If possible, use a text iterator to get the text, so that whitespace
</span><span class="cx">         // is handled consistently.
</span><span class="cx">         Document* nodeDocument = nullptr;
</span><span class="lines">@@ -692,18 +692,18 @@
</span><span class="cx">     
</span><span class="cx">         // Sometimes text fragments don't have Nodes associated with them (like when
</span><span class="cx">         // CSS content is used to insert text or when a RenderCounter is used.)
</span><del>-        if (m_renderer-&gt;isText()) {
-            RenderText* renderTextObject = toRenderText(m_renderer);
-            if (renderTextObject-&gt;isTextFragment()) {
-                
</del><ins>+        if (is&lt;RenderText&gt;(*m_renderer)) {
+            RenderText&amp; renderTextObject = downcast&lt;RenderText&gt;(*m_renderer);
+            if (is&lt;RenderTextFragment&gt;(renderTextObject)) {
+                RenderTextFragment&amp; renderTextFragment = downcast&lt;RenderTextFragment&gt;(renderTextObject);
</ins><span class="cx">                 // The alt attribute may be set on a text fragment through CSS, which should be honored.
</span><del>-                const String&amp; altText = toRenderTextFragment(renderTextObject)-&gt;altText();
</del><ins>+                const String&amp; altText = renderTextFragment.altText();
</ins><span class="cx">                 if (!altText.isEmpty())
</span><span class="cx">                     return altText;
</span><del>-                return String(static_cast&lt;RenderTextFragment*&gt;(m_renderer)-&gt;contentString());
</del><ins>+                return renderTextFragment.contentString();
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            return String(renderTextObject-&gt;text());
</del><ins>+            return renderTextObject.text();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -821,8 +821,8 @@
</span><span class="cx">     if (obj-&gt;isSVGRoot())
</span><span class="cx">         isSVGRoot = true;
</span><span class="cx"> 
</span><del>-    if (obj-&gt;isText())
-        quads = toRenderText(obj)-&gt;absoluteQuadsClippedToEllipsis();
</del><ins>+    if (is&lt;RenderText&gt;(*obj))
+        quads = downcast&lt;RenderText&gt;(*obj).absoluteQuadsClippedToEllipsis();
</ins><span class="cx">     else if (isWebArea() || isSVGRoot)
</span><span class="cx">         obj-&gt;absoluteQuads(quads);
</span><span class="cx">     else
</span><span class="lines">@@ -1211,12 +1211,12 @@
</span><span class="cx">     if (m_renderer-&gt;isBR())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (m_renderer-&gt;isText()) {
</del><ins>+    if (is&lt;RenderText&gt;(*m_renderer)) {
</ins><span class="cx">         // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level
</span><span class="cx">         AccessibilityObject* parent = parentObjectUnignored();
</span><span class="cx">         if (parent &amp;&amp; (parent-&gt;isMenuItem() || parent-&gt;ariaRoleAttribute() == MenuButtonRole))
</span><span class="cx">             return true;
</span><del>-        auto&amp; renderText = toRenderText(*m_renderer);
</del><ins>+        auto&amp; renderText = downcast&lt;RenderText&gt;(*m_renderer);
</ins><span class="cx">         if (!renderText.hasRenderedText())
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><span class="lines">@@ -1227,8 +1227,8 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // The alt attribute may be set on a text fragment through CSS, which should be honored.
</span><del>-        if (renderText.isTextFragment()) {
-            AccessibilityObjectInclusion altTextInclusion = objectInclusionFromAltText(toRenderTextFragment(&amp;renderText)-&gt;altText());
</del><ins>+        if (is&lt;RenderTextFragment&gt;(renderText)) {
+            AccessibilityObjectInclusion altTextInclusion = objectInclusionFromAltText(downcast&lt;RenderTextFragment&gt;(renderText).altText());
</ins><span class="cx">             if (altTextInclusion == IgnoreObject)
</span><span class="cx">                 return true;
</span><span class="cx">             if (altTextInclusion == IncludeObject)
</span><span class="lines">@@ -3443,14 +3443,14 @@
</span><span class="cx"> 
</span><span class="cx">     // Look for the RenderText object in the RenderObject tree for this input field.
</span><span class="cx">     RenderObject* renderer = node()-&gt;renderer();
</span><del>-    while (renderer &amp;&amp; !renderer-&gt;isText())
-        renderer = toRenderElement(renderer)-&gt;firstChild();
</del><ins>+    while (renderer &amp;&amp; !is&lt;RenderText&gt;(renderer))
+        renderer = downcast&lt;RenderElement&gt;(*renderer).firstChild();
</ins><span class="cx"> 
</span><del>-    if (!renderer || !renderer-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(renderer))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     // Return the text that is actually being rendered in the input field.
</span><del>-    return toRenderText(renderer)-&gt;textWithoutConvertingBackslashToYenSymbol();
</del><ins>+    return downcast&lt;RenderText&gt;(*renderer).textWithoutConvertingBackslashToYenSymbol();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollableArea* AccessibilityRenderObject::getScrollableAreaIfScrollable() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -166,9 +166,9 @@
</span><span class="cx"> 
</span><span class="cx">     // Gtk ATs need this for all text objects; not just text controls.
</span><span class="cx">     Node* node = this-&gt;node();
</span><del>-    RenderObject* renderer = node ? node-&gt;renderer() : 0;
-    if (renderer &amp;&amp; renderer-&gt;isText())
-        textLength = toRenderText(*renderer).textLength();
</del><ins>+    RenderObject* renderer = node ? node-&gt;renderer() : nullptr;
+    if (is&lt;RenderText&gt;(renderer))
+        textLength = downcast&lt;RenderText&gt;(*renderer).textLength();
</ins><span class="cx"> 
</span><span class="cx">     // Get the text length from the elements under the
</span><span class="cx">     // accessibility object if the value is still zero.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -242,11 +242,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (CGFloat)textHeight
</span><span class="cx"> {  
</span><del>-    RenderObject *o = core(self)-&gt;renderer();
-    if (o &amp;&amp; o-&gt;isText()) {
-        RenderText *t = toRenderText(o);
-        return t-&gt;style().computedLineHeight();;
-    }
</del><ins>+    RenderObject* renderer = core(self)-&gt;renderer();
+    if (is&lt;RenderText&gt;(renderer))
+        return downcast&lt;RenderText&gt;(*renderer).style().computedLineHeight();
</ins><span class="cx">     
</span><span class="cx">     return CGFLOAT_MAX;
</span><span class="cx"> }
</span><span class="lines">@@ -258,11 +256,11 @@
</span><span class="cx">     // a node returned from elementAtPoint.  We make the assumption that either the node or one
</span><span class="cx">     // of its immediate children contains the root line boxes in question.
</span><span class="cx">     // See &lt;rdar://problem/6824650&gt; for context.
</span><del>-    RenderObject *renderer = core(self)-&gt;renderer();
-    if (!renderer || !renderer-&gt;isRenderBlockFlow())
</del><ins>+    RenderObject* renderer = core(self)-&gt;renderer();
+    if (!is&lt;RenderBlockFlow&gt;(renderer))
</ins><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    RenderBlock *block = static_cast&lt;RenderBlock *&gt;(renderer);
</del><ins>+    RenderBlock* block = downcast&lt;RenderBlockFlow&gt;(renderer);
</ins><span class="cx">     
</span><span class="cx">     FloatPoint absPoint(point);
</span><span class="cx">     FloatPoint localPoint = block-&gt;absoluteToLocal(absPoint);
</span><span class="lines">@@ -279,7 +277,7 @@
</span><span class="cx">                 nextChild = nextChild-&gt;nextSiblingBox();
</span><span class="cx">             if (!nextChild) {
</span><span class="cx">                 if (localPoint.y() &gt;= top) {
</span><del>-                    block = static_cast&lt;RenderBlock *&gt;(child);
</del><ins>+                    block = downcast&lt;RenderBlock&gt;(child);
</ins><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="cx">                 continue;
</span><span class="lines">@@ -287,8 +285,8 @@
</span><span class="cx">             
</span><span class="cx">             float bottom = nextChild-&gt;y();
</span><span class="cx">             
</span><del>-            if (localPoint.y() &gt;= top &amp;&amp; localPoint.y() &lt; bottom &amp;&amp; child-&gt;isRenderBlock()) {
-                block = static_cast&lt;RenderBlock *&gt;(child);
</del><ins>+            if (localPoint.y() &gt;= top &amp;&amp; localPoint.y() &lt; bottom &amp;&amp; is&lt;RenderBlock&gt;(*child)) {
+                block = downcast&lt;RenderBlock&gt;(child);
</ins><span class="cx">                 break;
</span><span class="cx">             }                
</span><span class="cx">         }
</span><span class="lines">@@ -299,25 +297,24 @@
</span><span class="cx">         localPoint = block-&gt;absoluteToLocal(absPoint);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderBlockFlow *blockFlow = toRenderBlockFlow(block);
</del><ins>+    RenderBlockFlow&amp; blockFlow = downcast&lt;RenderBlockFlow&gt;(*block);
</ins><span class="cx">     
</span><span class="cx">     // Only check the gaps between the root line boxes.  We deliberately ignore overflow because
</span><span class="cx">     // experience has shown that hit tests on an exploded text node can fail when within the
</span><span class="cx">     // overflow region.
</span><del>-    for (RootInlineBox *cur = blockFlow-&gt;firstRootBox(); cur &amp;&amp; cur != blockFlow-&gt;lastRootBox(); cur = cur-&gt;nextRootBox()) {
-        float currentBottom = cur-&gt;y() + cur-&gt;logicalHeight();        
</del><ins>+    for (RootInlineBox* current = blockFlow.firstRootBox(); current &amp;&amp; current != blockFlow.lastRootBox(); current = current-&gt;nextRootBox()) {
+        float currentBottom = current-&gt;y() + current-&gt;logicalHeight();
</ins><span class="cx">         if (localPoint.y() &lt; currentBottom)
</span><span class="cx">             return nil;
</span><span class="cx"> 
</span><del>-        RootInlineBox *next = cur-&gt;nextRootBox();
</del><ins>+        RootInlineBox* next = current-&gt;nextRootBox();
</ins><span class="cx">         float nextTop = next-&gt;y();
</span><span class="cx">         if (localPoint.y() &lt; nextTop) {
</span><del>-            InlineBox *inlineBox = cur-&gt;closestLeafChildForLogicalLeftPosition(localPoint.x());
-            if (inlineBox &amp;&amp; inlineBox-&gt;behavesLikeText() &amp;&amp; inlineBox-&gt;renderer().isText()) {
-                RenderText *t = toRenderText(&amp;inlineBox-&gt;renderer());
-                if (t-&gt;textNode()) {
-                    return kit(t-&gt;textNode());
-                }
</del><ins>+            InlineBox* inlineBox = current-&gt;closestLeafChildForLogicalLeftPosition(localPoint.x());
+            if (inlineBox &amp;&amp; inlineBox-&gt;behavesLikeText() &amp;&amp; is&lt;RenderText&gt;(inlineBox-&gt;renderer())) {
+                RenderText&amp; renderText = downcast&lt;RenderText&gt;(inlineBox-&gt;renderer());
+                if (renderText.textNode())
+                    return kit(renderText.textNode());
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -841,16 +841,14 @@
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (p-&gt;node() &amp;&amp; p-&gt;node() == this &amp;&amp; o-&gt;isText() &amp;&amp; !toRenderText(o)-&gt;firstTextBox()) {
</del><ins>+        if (p-&gt;node() &amp;&amp; p-&gt;node() == this &amp;&amp; is&lt;RenderText&gt;(*o) &amp;&amp; !downcast&lt;RenderText&gt;(*o).firstTextBox()) {
</ins><span class="cx">             // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
</span><del>-        } else if (o-&gt;isText() || o-&gt;isReplaced()) {
</del><ins>+        } else if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
</ins><span class="cx">             point = FloatPoint();
</span><del>-            if (o-&gt;isText() &amp;&amp; toRenderText(o)-&gt;firstTextBox()) {
-                point.move(toRenderText(o)-&gt;linesBoundingBox().x(), toRenderText(o)-&gt;firstTextBox()-&gt;root().lineTop());
-            } else if (o-&gt;isBox()) {
-                RenderBox* box = toRenderBox(o);
-                point.moveBy(box-&gt;location());
-            }
</del><ins>+            if (is&lt;RenderText&gt;(*o) &amp;&amp; downcast&lt;RenderText&gt;(*o).firstTextBox())
+                point.move(downcast&lt;RenderText&gt;(*o).linesBoundingBox().x(), downcast&lt;RenderText&gt;(*o).firstTextBox()-&gt;root().lineTop());
+            else if (is&lt;RenderBox&gt;(*o))
+                point.moveBy(downcast&lt;RenderBox&gt;(*o).location());
</ins><span class="cx">             point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="lines">@@ -894,18 +892,15 @@
</span><span class="cx">             o = prev;
</span><span class="cx">         }
</span><span class="cx">         ASSERT(o);
</span><del>-        if (o-&gt;isText() || o-&gt;isReplaced()) {
</del><ins>+        if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
</ins><span class="cx">             point = FloatPoint();
</span><del>-            if (o-&gt;isText()) {
-                RenderText* text = toRenderText(o);
-                IntRect linesBox = text-&gt;linesBoundingBox();
</del><ins>+            if (is&lt;RenderText&gt;(*o)) {
+                IntRect linesBox = downcast&lt;RenderText&gt;(*o).linesBoundingBox();
</ins><span class="cx">                 if (!linesBox.maxX() &amp;&amp; !linesBox.maxY())
</span><span class="cx">                     continue;
</span><span class="cx">                 point.moveBy(linesBox.maxXMaxYCorner());
</span><del>-            } else {
-                RenderBox* box = toRenderBox(o);
-                point.moveBy(box-&gt;frameRect().maxXMaxYCorner());
-            }
</del><ins>+            } else
+                point.moveBy(downcast&lt;RenderBox&gt;(*o).frameRect().maxXMaxYCorner());
</ins><span class="cx">             point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
</span><span class="cx">             return true;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarkerController.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -169,10 +169,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (auto* renderer = node-&gt;renderer()) {
</span><span class="cx">         // FIXME: Factor the marker painting code out of InlineTextBox and teach simple line layout to use it.
</span><del>-        if (renderer-&gt;isText())
-            toRenderText(*renderer).ensureLineBoxes();
-        else if (renderer-&gt;isRenderBlockFlow())
-            toRenderBlockFlow(*renderer).ensureLineBoxes();
</del><ins>+        if (is&lt;RenderText&gt;(*renderer))
+            downcast&lt;RenderText&gt;(*renderer).ensureLineBoxes();
+        else if (is&lt;RenderBlockFlow&gt;(*renderer))
+            downcast&lt;RenderBlockFlow&gt;(*renderer).ensureLineBoxes();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_possiblyExistingMarkerTypes.add(newMarker.type());
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/dom/Position.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx"> 
</span><span class="cx"> static bool hasInlineBoxWrapper(RenderObject&amp; renderer)
</span><span class="cx"> {
</span><del>-    if (renderer.isBox() &amp;&amp; toRenderBox(renderer).inlineBoxWrapper())
</del><ins>+    if (is&lt;RenderBox&gt;(renderer) &amp;&amp; downcast&lt;RenderBox&gt;(renderer).inlineBoxWrapper())
</ins><span class="cx">         return true;
</span><del>-    if (renderer.isText() &amp;&amp; toRenderText(renderer).firstTextBox())
</del><ins>+    if (is&lt;RenderText&gt;(renderer) &amp;&amp; downcast&lt;RenderText&gt;(renderer).firstTextBox())
</ins><span class="cx">         return true;
</span><del>-    if (renderer.isLineBreak() &amp;&amp; toRenderLineBreak(renderer).inlineBoxWrapper())
</del><ins>+    if (is&lt;RenderLineBreak&gt;(renderer) &amp;&amp; downcast&lt;RenderLineBreak&gt;(renderer).inlineBoxWrapper())
</ins><span class="cx">         return true;
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -625,8 +625,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // return current position if it is in rendered text
</span><del>-        if (renderer-&gt;isText()) {
-            auto&amp; textRenderer = toRenderText(*renderer);
</del><ins>+        if (is&lt;RenderText&gt;(*renderer)) {
+            auto&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
</ins><span class="cx">             textRenderer.ensureLineBoxes();
</span><span class="cx"> 
</span><span class="cx">             if (!textRenderer.firstTextBox())
</span><span class="lines">@@ -757,8 +757,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // return current position if it is in rendered text
</span><del>-        if (renderer-&gt;isText()) {
-            auto&amp; textRenderer = toRenderText(*renderer);
</del><ins>+        if (is&lt;RenderText&gt;(*renderer)) {
+            auto&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
</ins><span class="cx">             textRenderer.ensureLineBoxes();
</span><span class="cx"> 
</span><span class="cx">             if (!textRenderer.firstTextBox())
</span><span class="lines">@@ -846,23 +846,23 @@
</span><span class="cx">     for (RenderObject* o = renderer.firstChild(); o &amp;&amp; o != stop; o = o-&gt;nextInPreOrder()) {
</span><span class="cx">         if (!o-&gt;nonPseudoNode())
</span><span class="cx">             continue;
</span><del>-        if (o-&gt;isText()) {
-            if (boundingBoxLogicalHeight(o, toRenderText(o)-&gt;linesBoundingBox()))
</del><ins>+        if (is&lt;RenderText&gt;(*o)) {
+            if (boundingBoxLogicalHeight(o, downcast&lt;RenderText&gt;(*o).linesBoundingBox()))
</ins><span class="cx">                 return true;
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (o-&gt;isLineBreak()) {
-            if (boundingBoxLogicalHeight(o, toRenderLineBreak(o)-&gt;linesBoundingBox()))
</del><ins>+        if (is&lt;RenderLineBreak&gt;(*o)) {
+            if (boundingBoxLogicalHeight(o, downcast&lt;RenderLineBreak&gt;(*o).linesBoundingBox()))
</ins><span class="cx">                 return true;
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (o-&gt;isBox()) {
-            if (toRenderBox(o)-&gt;pixelSnappedLogicalHeight())
</del><ins>+        if (is&lt;RenderBox&gt;(*o)) {
+            if (downcast&lt;RenderBox&gt;(*o).pixelSnappedLogicalHeight())
</ins><span class="cx">                 return true;
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (o-&gt;isRenderInline()) {
-            const RenderInline&amp; renderInline = toRenderInline(*o);
</del><ins>+        if (is&lt;RenderInline&gt;(*o)) {
+            const RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*o);
</ins><span class="cx">             if (isEmptyInline(renderInline) &amp;&amp; boundingBoxLogicalHeight(o, renderInline.linesBoundingBox()))
</span><span class="cx">                 return true;
</span><span class="cx">             continue;
</span><span class="lines">@@ -926,8 +926,8 @@
</span><span class="cx">         // FIXME: The condition should be m_anchorType == PositionIsBeforeAnchor, but for now we still need to support legacy positions.
</span><span class="cx">         return !m_offset &amp;&amp; m_anchorType != PositionIsAfterAnchor &amp;&amp; !nodeIsUserSelectNone(deprecatedNode()-&gt;parentNode());
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;isText())
-        return !nodeIsUserSelectNone(deprecatedNode()) &amp;&amp; toRenderText(renderer)-&gt;containsCaretOffset(m_offset);
</del><ins>+    if (is&lt;RenderText&gt;(*renderer))
+        return !nodeIsUserSelectNone(deprecatedNode()) &amp;&amp; downcast&lt;RenderText&gt;(*renderer).containsCaretOffset(m_offset);
</ins><span class="cx"> 
</span><span class="cx">     if (isRenderedTable(deprecatedNode()) || editingIgnoresContent(deprecatedNode()))
</span><span class="cx">         return (atFirstEditingPositionForNode() || atLastEditingPositionForNode()) &amp;&amp; !nodeIsUserSelectNone(deprecatedNode()-&gt;parentNode());
</span><span class="lines">@@ -935,8 +935,8 @@
</span><span class="cx">     if (m_anchorNode-&gt;hasTagName(htmlTag))
</span><span class="cx">         return false;
</span><span class="cx">         
</span><del>-    if (renderer-&gt;isRenderBlockFlow()) {
-        RenderBlockFlow&amp; block = toRenderBlockFlow(*renderer);
</del><ins>+    if (is&lt;RenderBlockFlow&gt;(*renderer)) {
+        RenderBlockFlow&amp; block = downcast&lt;RenderBlockFlow&gt;(*renderer);
</ins><span class="cx">         if (block.logicalHeight() || m_anchorNode-&gt;hasTagName(bodyTag)) {
</span><span class="cx">             if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><span class="cx">                 return atFirstEditingPositionForNode() &amp;&amp; !Position::nodeIsUserSelectNone(deprecatedNode());
</span><span class="lines">@@ -1004,14 +1004,14 @@
</span><span class="cx">     if (!inSameEnclosingBlockFlowElement(deprecatedNode(), pos.deprecatedNode()))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;isText() &amp;&amp; !toRenderText(renderer)-&gt;containsCaretOffset(m_offset))
</del><ins>+    if (is&lt;RenderText&gt;(*renderer) &amp;&amp; !downcast&lt;RenderText&gt;(*renderer).containsCaretOffset(m_offset))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (posRenderer-&gt;isText() &amp;&amp; !toRenderText(posRenderer)-&gt;containsCaretOffset(pos.m_offset))
</del><ins>+    if (is&lt;RenderText&gt;(*posRenderer) &amp;&amp; !downcast&lt;RenderText&gt;(*posRenderer).containsCaretOffset(pos.m_offset))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    int thisRenderedOffset = renderer-&gt;isText() ? toRenderText(renderer)-&gt;countRenderedCharacterOffsetsUntil(m_offset) : m_offset;
-    int posRenderedOffset = posRenderer-&gt;isText() ? toRenderText(posRenderer)-&gt;countRenderedCharacterOffsetsUntil(pos.m_offset) : pos.m_offset;
</del><ins>+    int thisRenderedOffset = is&lt;RenderText&gt;(*renderer) ? downcast&lt;RenderText&gt;(*renderer).countRenderedCharacterOffsetsUntil(m_offset) : m_offset;
+    int posRenderedOffset = is&lt;RenderText&gt;(*posRenderer) ? downcast&lt;RenderText&gt;(*posRenderer).countRenderedCharacterOffsetsUntil(pos.m_offset) : pos.m_offset;
</ins><span class="cx"> 
</span><span class="cx">     if (renderer == posRenderer &amp;&amp; thisRenderedOffset == posRenderedOffset)
</span><span class="cx">         return false;
</span><span class="lines">@@ -1109,16 +1109,16 @@
</span><span class="cx">     RenderBlock* container = renderer-&gt;containingBlock();
</span><span class="cx">     RenderObject* next = renderer;
</span><span class="cx">     while ((next = next-&gt;nextInPreOrder(container))) {
</span><del>-        if (next-&gt;isRenderBlock())
-            return 0;
</del><ins>+        if (is&lt;RenderBlock&gt;(*next))
+            return nullptr;
</ins><span class="cx">         if (next-&gt;isBR())
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx">         if (isNonTextLeafChild(next))
</span><del>-            return 0;
-        if (next-&gt;isText()) {
-            InlineTextBox* match = 0;
</del><ins>+            return nullptr;
+        if (is&lt;RenderText&gt;(*next)) {
+            InlineTextBox* match = nullptr;
</ins><span class="cx">             int minOffset = INT_MAX;
</span><del>-            for (InlineTextBox* box = toRenderText(next)-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</del><ins>+            for (InlineTextBox* box = downcast&lt;RenderText&gt;(*next).firstTextBox(); box; box = box-&gt;nextTextBox()) {
</ins><span class="cx">                 int caretMinOffset = box-&gt;caretMinOffset();
</span><span class="cx">                 if (caretMinOffset &lt; minOffset) {
</span><span class="cx">                     match = box;
</span><span class="lines">@@ -1129,7 +1129,7 @@
</span><span class="cx">                 return match;
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Position downstreamIgnoringEditingBoundaries(Position position)
</span><span class="lines">@@ -1159,14 +1159,14 @@
</span><span class="cx"> 
</span><span class="cx">     if (renderer-&gt;isBR())
</span><span class="cx">         inlineBox = !caretOffset ? toRenderLineBreak(renderer)-&gt;inlineBoxWrapper() : nullptr;
</span><del>-    else if (renderer-&gt;isText()) {
-        auto textRenderer = toRenderText(renderer);
-        textRenderer-&gt;ensureLineBoxes();
</del><ins>+    else if (is&lt;RenderText&gt;(*renderer)) {
+        auto&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
+        textRenderer.ensureLineBoxes();
</ins><span class="cx"> 
</span><span class="cx">         InlineTextBox* box;
</span><del>-        InlineTextBox* candidate = 0;
</del><ins>+        InlineTextBox* candidate = nullptr;
</ins><span class="cx"> 
</span><del>-        for (box = textRenderer-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</del><ins>+        for (box = textRenderer.firstTextBox(); box; box = box-&gt;nextTextBox()) {
</ins><span class="cx">             int caretMinOffset = box-&gt;caretMinOffset();
</span><span class="cx">             int caretMaxOffset = box-&gt;caretMaxOffset();
</span><span class="cx"> 
</span><span class="lines">@@ -1185,15 +1185,15 @@
</span><span class="cx"> 
</span><span class="cx">             candidate = box;
</span><span class="cx">         }
</span><del>-        if (candidate &amp;&amp; candidate == textRenderer-&gt;lastTextBox() &amp;&amp; affinity == DOWNSTREAM) {
-            box = searchAheadForBetterMatch(textRenderer);
</del><ins>+        if (candidate &amp;&amp; candidate == textRenderer.lastTextBox() &amp;&amp; affinity == DOWNSTREAM) {
+            box = searchAheadForBetterMatch(&amp;textRenderer);
</ins><span class="cx">             if (box)
</span><span class="cx">                 caretOffset = box-&gt;caretMinOffset();
</span><span class="cx">         }
</span><span class="cx">         inlineBox = box ? box : candidate;
</span><span class="cx">     } else {
</span><del>-        inlineBox = 0;
-        if (canHaveChildrenForEditing(deprecatedNode()) &amp;&amp; renderer-&gt;isRenderBlockFlow() &amp;&amp; hasRenderedNonAnonymousDescendantsWithHeight(toRenderBlock(*renderer))) {
</del><ins>+        inlineBox = nullptr;
+        if (canHaveChildrenForEditing(deprecatedNode()) &amp;&amp; is&lt;RenderBlockFlow&gt;(*renderer) &amp;&amp; hasRenderedNonAnonymousDescendantsWithHeight(downcast&lt;RenderBlockFlow&gt;(*renderer))) {
</ins><span class="cx">             // Try a visually equivalent position with possibly opposite editability. This helps in case |this| is in
</span><span class="cx">             // an editable block but surrounded by non-editable positions. It acts to negate the logic at the beginning
</span><span class="cx">             // of RenderObject::createVisiblePosition().
</span><span class="lines">@@ -1207,8 +1207,8 @@
</span><span class="cx">             equivalent.getInlineBoxAndOffset(UPSTREAM, primaryDirection, inlineBox, caretOffset);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (renderer-&gt;isBox()) {
-            inlineBox = toRenderBox(renderer)-&gt;inlineBoxWrapper();
</del><ins>+        if (is&lt;RenderBox&gt;(*renderer)) {
+            inlineBox = downcast&lt;RenderBox&gt;(*renderer).inlineBoxWrapper();
</ins><span class="cx">             if (!inlineBox || (caretOffset &gt; inlineBox-&gt;caretMinOffset() &amp;&amp; caretOffset &lt; inlineBox-&gt;caretMaxOffset()))
</span><span class="cx">                 return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PositionIterator.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PositionIterator.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/dom/PositionIterator.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -26,9 +26,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;PositionIterator.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;HTMLBodyElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><ins>+#include &quot;HTMLHtmlElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><del>-#include &quot;RenderBlock.h&quot;
</del><ins>+#include &quot;RenderBlockFlow.h&quot;
</ins><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;htmlediting.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -154,15 +156,15 @@
</span><span class="cx">     if (renderer-&gt;isBR())
</span><span class="cx">         return !m_offsetInAnchor &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode-&gt;parentNode());
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;isText())
-        return !Position::nodeIsUserSelectNone(m_anchorNode) &amp;&amp; toRenderText(renderer)-&gt;containsCaretOffset(m_offsetInAnchor);
</del><ins>+    if (is&lt;RenderText&gt;(*renderer))
+        return !Position::nodeIsUserSelectNone(m_anchorNode) &amp;&amp; downcast&lt;RenderText&gt;(*renderer).containsCaretOffset(m_offsetInAnchor);
</ins><span class="cx"> 
</span><span class="cx">     if (isRenderedTable(m_anchorNode) || editingIgnoresContent(m_anchorNode))
</span><span class="cx">         return (atStartOfNode() || atEndOfNode()) &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode-&gt;parentNode());
</span><span class="cx"> 
</span><del>-    if (!m_anchorNode-&gt;hasTagName(htmlTag) &amp;&amp; renderer-&gt;isRenderBlockFlow()) {
-        RenderBlock&amp; block = toRenderBlock(*renderer);
-        if (block.logicalHeight() || m_anchorNode-&gt;hasTagName(bodyTag)) {
</del><ins>+    if (!is&lt;HTMLHtmlElement&gt;(*m_anchorNode) &amp;&amp; is&lt;RenderBlockFlow&gt;(*renderer)) {
+        RenderBlockFlow&amp; block = downcast&lt;RenderBlockFlow&gt;(*renderer);
+        if (block.logicalHeight() || is&lt;HTMLBodyElement&gt;(*m_anchorNode)) {
</ins><span class="cx">             if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><span class="cx">                 return atStartOfNode() &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode);
</span><span class="cx">             return m_anchorNode-&gt;hasEditableStyle() &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode) &amp;&amp; Position(*this).atEditingBoundary();
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/dom/Range.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1614,16 +1614,16 @@
</span><span class="cx"> 
</span><span class="cx">     Node* stopNode = pastLastNode();
</span><span class="cx">     for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
</span><del>-        RenderObject* r = node-&gt;renderer();
-        if (!r)
</del><ins>+        RenderObject* renderer = node-&gt;renderer();
+        if (!renderer)
</ins><span class="cx">             continue;
</span><span class="cx">         bool isFixed = false;
</span><del>-        if (r-&gt;isBR())
-            r-&gt;absoluteRects(rects, flooredLayoutPoint(r-&gt;localToAbsolute()));
-        else if (r-&gt;isText()) {
</del><ins>+        if (renderer-&gt;isBR())
+            renderer-&gt;absoluteRects(rects, flooredLayoutPoint(renderer-&gt;localToAbsolute()));
+        else if (is&lt;RenderText&gt;(*renderer)) {
</ins><span class="cx">             int startOffset = node == startContainer ? m_start.offset() : 0;
</span><span class="cx">             int endOffset = node == endContainer ? m_end.offset() : std::numeric_limits&lt;int&gt;::max();
</span><del>-            rects.appendVector(toRenderText(r)-&gt;absoluteRectsForRange(startOffset, endOffset, useSelectionHeight, &amp;isFixed));
</del><ins>+            rects.appendVector(downcast&lt;RenderText&gt;(*renderer).absoluteRectsForRange(startOffset, endOffset, useSelectionHeight, &amp;isFixed));
</ins><span class="cx">         } else
</span><span class="cx">             continue;
</span><span class="cx">         allFixed &amp;= isFixed;
</span><span class="lines">@@ -1650,16 +1650,16 @@
</span><span class="cx"> 
</span><span class="cx">     Node* stopNode = pastLastNode();
</span><span class="cx">     for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(node)) {
</span><del>-        RenderObject* r = node-&gt;renderer();
-        if (!r)
</del><ins>+        RenderObject* renderer = node-&gt;renderer();
+        if (!renderer)
</ins><span class="cx">             continue;
</span><span class="cx">         bool isFixed = false;
</span><del>-        if (r-&gt;isBR())
-            r-&gt;absoluteQuads(quads, &amp;isFixed);
-        else if (r-&gt;isText()) {
</del><ins>+        if (renderer-&gt;isBR())
+            renderer-&gt;absoluteQuads(quads, &amp;isFixed);
+        else if (is&lt;RenderText&gt;(*renderer)) {
</ins><span class="cx">             int startOffset = node == startContainer ? m_start.offset() : 0;
</span><span class="cx">             int endOffset = node == endContainer ? m_end.offset() : std::numeric_limits&lt;int&gt;::max();
</span><del>-            quads.appendVector(toRenderText(r)-&gt;absoluteQuadsForRange(startOffset, endOffset, useSelectionHeight, &amp;isFixed));
</del><ins>+            quads.appendVector(downcast&lt;RenderText&gt;(*renderer).absoluteQuadsForRange(startOffset, endOffset, useSelectionHeight, &amp;isFixed));
</ins><span class="cx">         } else
</span><span class="cx">             continue;
</span><span class="cx">         allFixed &amp;= isFixed;
</span><span class="lines">@@ -2233,13 +2233,12 @@
</span><span class="cx">                 quads.appendVector(elementQuads);
</span><span class="cx">             }
</span><span class="cx">         } else if (is&lt;Text&gt;(*node)) {
</span><del>-            if (RenderObject* renderer = downcast&lt;Text&gt;(*node).renderer()) {
-                const RenderText&amp; renderText = toRenderText(*renderer);
</del><ins>+            if (RenderText* renderText = downcast&lt;Text&gt;(*node).renderer()) {
</ins><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 class="cx">                 
</span><del>-                auto textQuads = renderText.absoluteQuadsForRange(startOffset, endOffset);
-                ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText.style());
</del><ins>+                auto textQuads = renderText-&gt;absoluteQuadsForRange(startOffset, endOffset);
+                ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText-&gt;style());
</ins><span class="cx"> 
</span><span class="cx">                 quads.appendVector(textQuads);
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1525,15 +1525,15 @@
</span><span class="cx">     if (is&lt;Element&gt;(*renderer-&gt;node())) {
</span><span class="cx">         Element&amp; element = downcast&lt;Element&gt;(*renderer-&gt;node());
</span><span class="cx">         fprintf(stderr, &quot;%s%s\n&quot;, selected ? &quot;==&gt; &quot; : &quot;    &quot;, element.localName().string().utf8().data());
</span><del>-    } else if (renderer-&gt;isText()) {
-        RenderText* textRenderer = toRenderText(renderer);
-        if (!textRenderer-&gt;textLength() || !textRenderer-&gt;firstTextBox()) {
</del><ins>+    } else if (is&lt;RenderText&gt;(*renderer)) {
+        RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
+        if (!textRenderer.textLength() || !textRenderer.firstTextBox()) {
</ins><span class="cx">             fprintf(stderr, &quot;%s#text (empty)\n&quot;, selected ? &quot;==&gt; &quot; : &quot;    &quot;);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         static const int max = 36;
</span><del>-        String text = textRenderer-&gt;text();
</del><ins>+        String text = textRenderer.text();
</ins><span class="cx">         int textLength = text.length();
</span><span class="cx">         if (selected) {
</span><span class="cx">             int offset = 0;
</span><span class="lines">@@ -1543,7 +1543,7 @@
</span><span class="cx">                 offset = m_selection.end().computeOffsetInContainerNode();
</span><span class="cx"> 
</span><span class="cx">             int pos;
</span><del>-            InlineTextBox* box = textRenderer-&gt;findNextInlineTextBox(offset, pos);
</del><ins>+            InlineTextBox* box = textRenderer.findNextInlineTextBox(offset, pos);
</ins><span class="cx">             text = text.substring(box-&gt;start(), box-&gt;len());
</span><span class="cx">             
</span><span class="cx">             String show;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -490,8 +490,8 @@
</span><span class="cx"> {
</span><span class="cx">     if (renderer.style().visibility() == VISIBLE)
</span><span class="cx">         return true;
</span><del>-    if (renderer.isTextFragment()) {
-        if (auto firstLetter = toRenderTextFragment(renderer).firstLetter()) {
</del><ins>+    if (is&lt;RenderTextFragment&gt;(renderer)) {
+        if (auto firstLetter = downcast&lt;RenderTextFragment&gt;(renderer).firstLetter()) {
</ins><span class="cx">             if (firstLetter-&gt;style().visibility() == VISIBLE)
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="lines">@@ -518,8 +518,8 @@
</span><span class="cx">             emitCharacter(' ', textNode, nullptr, runStart, runStart);
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><del>-        if (!m_handledFirstLetter &amp;&amp; renderer.isTextFragment() &amp;&amp; !m_offset) {
-            handleTextNodeFirstLetter(toRenderTextFragment(renderer));
</del><ins>+        if (!m_handledFirstLetter &amp;&amp; is&lt;RenderTextFragment&gt;(renderer) &amp;&amp; !m_offset) {
+            handleTextNodeFirstLetter(downcast&lt;RenderTextFragment&gt;(renderer));
</ins><span class="cx">             if (m_firstLetterText) {
</span><span class="cx">                 String firstLetter = m_firstLetterText-&gt;text();
</span><span class="cx">                 emitText(textNode, *m_firstLetterText, m_offset, m_offset + firstLetter.length());
</span><span class="lines">@@ -575,9 +575,9 @@
</span><span class="cx">     if (renderer.firstTextBox())
</span><span class="cx">         m_textBox = renderer.firstTextBox();
</span><span class="cx"> 
</span><del>-    bool shouldHandleFirstLetter = !m_handledFirstLetter &amp;&amp; renderer.isTextFragment() &amp;&amp; !m_offset;
</del><ins>+    bool shouldHandleFirstLetter = !m_handledFirstLetter &amp;&amp; is&lt;RenderTextFragment&gt;(renderer) &amp;&amp; !m_offset;
</ins><span class="cx">     if (shouldHandleFirstLetter)
</span><del>-        handleTextNodeFirstLetter(toRenderTextFragment(renderer));
</del><ins>+        handleTextNodeFirstLetter(downcast&lt;RenderTextFragment&gt;(renderer));
</ins><span class="cx"> 
</span><span class="cx">     if (!renderer.firstTextBox() &amp;&amp; rendererText.length() &amp;&amp; !shouldHandleFirstLetter) {
</span><span class="cx">         if (renderer.style().visibility() != VISIBLE &amp;&amp; !(m_behavior &amp; TextIteratorIgnoresStyleVisibility))
</span><span class="lines">@@ -912,8 +912,8 @@
</span><span class="cx"> {
</span><span class="cx">     int offset = caretMaxOffset(&amp;node);
</span><span class="cx">     if (auto* renderer = node.renderer()) {
</span><del>-        if (renderer-&gt;isText())
-            offset += collapsedSpaceLength(toRenderText(*renderer), offset);
</del><ins>+        if (is&lt;RenderText&gt;(*renderer))
+            offset += collapsedSpaceLength(downcast&lt;RenderText&gt;(*renderer), offset);
</ins><span class="cx">     }
</span><span class="cx">     return offset;
</span><span class="cx"> }
</span><span class="lines">@@ -1301,31 +1301,31 @@
</span><span class="cx"> 
</span><span class="cx"> RenderText* SimplifiedBackwardsTextIterator::handleFirstLetter(int&amp; startOffset, int&amp; offsetInNode)
</span><span class="cx"> {
</span><del>-    RenderText* renderer = toRenderText(m_node-&gt;renderer());
</del><ins>+    RenderText&amp; renderer = downcast&lt;RenderText&gt;(*m_node-&gt;renderer());
</ins><span class="cx">     startOffset = (m_node == m_startContainer) ? m_startOffset : 0;
</span><span class="cx"> 
</span><del>-    if (!renderer-&gt;isTextFragment()) {
</del><ins>+    if (!is&lt;RenderTextFragment&gt;(renderer)) {
</ins><span class="cx">         offsetInNode = 0;
</span><del>-        return renderer;
</del><ins>+        return &amp;renderer;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderTextFragment* fragment = toRenderTextFragment(renderer);
-    int offsetAfterFirstLetter = fragment-&gt;start();
</del><ins>+    RenderTextFragment&amp; fragment = downcast&lt;RenderTextFragment&gt;(renderer);
+    int offsetAfterFirstLetter = fragment.start();
</ins><span class="cx">     if (startOffset &gt;= offsetAfterFirstLetter) {
</span><span class="cx">         ASSERT(!m_shouldHandleFirstLetter);
</span><span class="cx">         offsetInNode = offsetAfterFirstLetter;
</span><del>-        return renderer;
</del><ins>+        return &amp;renderer;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_shouldHandleFirstLetter &amp;&amp; startOffset + offsetAfterFirstLetter &lt; m_offset) {
</span><span class="cx">         m_shouldHandleFirstLetter = true;
</span><span class="cx">         offsetInNode = offsetAfterFirstLetter;
</span><del>-        return renderer;
</del><ins>+        return &amp;renderer;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_shouldHandleFirstLetter = false;
</span><span class="cx">     offsetInNode = 0;
</span><del>-    return firstRenderTextInFirstLetter(fragment-&gt;firstLetter());
</del><ins>+    return firstRenderTextInFirstLetter(fragment.firstLetter());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SimplifiedBackwardsTextIterator::handleReplacedElement()
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1142,11 +1142,11 @@
</span><span class="cx">         if (r-&gt;isBR() || isBlock(n))
</span><span class="cx">             break;
</span><span class="cx"> 
</span><del>-        if (r-&gt;isText() &amp;&amp; toRenderText(r)-&gt;hasRenderedText()) {
</del><ins>+        if (is&lt;RenderText&gt;(*r) &amp;&amp; downcast&lt;RenderText&gt;(*r).hasRenderedText()) {
</ins><span class="cx">             ASSERT_WITH_SECURITY_IMPLICATION(is&lt;Text&gt;(*n));
</span><span class="cx">             type = Position::PositionIsOffsetInAnchor;
</span><span class="cx">             if (style.preserveNewline()) {
</span><del>-                StringImpl&amp; text = *toRenderText(r)-&gt;text();
</del><ins>+                StringImpl&amp; text = *downcast&lt;RenderText&gt;(*r).text();
</ins><span class="cx">                 int i = text.length();
</span><span class="cx">                 int o = offset;
</span><span class="cx">                 if (n == startNode &amp;&amp; o &lt; i)
</span><span class="lines">@@ -1225,11 +1225,11 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         // FIXME: We avoid returning a position where the renderer can't accept the caret.
</span><del>-        if (r-&gt;isText() &amp;&amp; toRenderText(r)-&gt;hasRenderedText()) {
</del><ins>+        if (is&lt;RenderText&gt;(*r) &amp;&amp; downcast&lt;RenderText&gt;(*r).hasRenderedText()) {
</ins><span class="cx">             ASSERT_WITH_SECURITY_IMPLICATION(is&lt;Text&gt;(*n));
</span><span class="cx">             type = Position::PositionIsOffsetInAnchor;
</span><span class="cx">             if (style.preserveNewline()) {
</span><del>-                StringImpl&amp; text = *toRenderText(r)-&gt;text();
</del><ins>+                StringImpl&amp; text = *downcast&lt;RenderText&gt;(*r).text();
</ins><span class="cx">                 int o = n == startNode ? offset : 0;
</span><span class="cx">                 int length = text.length();
</span><span class="cx">                 for (int i = o; i &lt; length; ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -2237,8 +2237,8 @@
</span><span class="cx"> static unsigned countRenderedCharactersInRenderObjectWithThreshold(const RenderObject&amp; renderer, unsigned countSoFar, unsigned threshold)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Consider writing this using RenderObject::nextInPreOrder() instead of using recursion.
</span><del>-    if (renderer.isText())
-        countSoFar += toRenderText(renderer).text()-&gt;length();
</del><ins>+    if (is&lt;RenderText&gt;(renderer))
+        countSoFar += downcast&lt;RenderText&gt;(renderer).text()-&gt;length();
</ins><span class="cx"> 
</span><span class="cx">     for (RenderObject* child = renderer.firstChildSlow(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">         if (countSoFar &gt;= threshold)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingBidiRuncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/BidiRun.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/BidiRun.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/BidiRun.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     bidiRunCounter.increment();
</span><span class="cx"> #endif
</span><del>-    ASSERT(!m_renderer.isText() || static_cast&lt;unsigned&gt;(stop) &lt;= toRenderText(m_renderer).textLength());
</del><ins>+    ASSERT(!is&lt;RenderText&gt;(m_renderer) || static_cast&lt;unsigned&gt;(stop) &lt;= downcast&lt;RenderText&gt;(m_renderer).textLength());
</ins><span class="cx">     // Stored in base class to save space.
</span><span class="cx">     m_hasHyphen = false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineIterator.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/InlineIterator.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> UCharDirection InlineIterator::surrogateTextDirection(UChar currentCodeUnit) const
</span><span class="cx"> {
</span><del>-    RenderText&amp; text = toRenderText(*m_renderer);
</del><ins>+    RenderText&amp; text = downcast&lt;RenderText&gt;(*m_renderer);
</ins><span class="cx">     UChar lead;
</span><span class="cx">     UChar trail;
</span><span class="cx">     if (U16_IS_LEAD(currentCodeUnit)) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineIterator.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/InlineIterator.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -83,13 +83,12 @@
</span><span class="cx">     void fastDecrement();
</span><span class="cx">     bool atEnd() const;
</span><span class="cx"> 
</span><del>-    inline bool atTextParagraphSeparator()
</del><ins>+    bool atTextParagraphSeparator() const
</ins><span class="cx">     {
</span><del>-        return m_renderer &amp;&amp; m_renderer-&gt;preservesNewline() &amp;&amp; m_renderer-&gt;isText() &amp;&amp; toRenderText(m_renderer)-&gt;textLength()
-            &amp;&amp; toRenderText(m_renderer)-&gt;characterAt(m_pos) == '\n';
</del><ins>+        return is&lt;RenderText&gt;(m_renderer) &amp;&amp; m_renderer-&gt;preservesNewline() &amp;&amp; downcast&lt;RenderText&gt;(*m_renderer).characterAt(m_pos) == '\n';
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    inline bool atParagraphSeparator()
</del><ins>+    bool atParagraphSeparator() const
</ins><span class="cx">     {
</span><span class="cx">         return (m_renderer &amp;&amp; m_renderer-&gt;isBR()) || atTextParagraphSeparator();
</span><span class="cx">     }
</span><span class="lines">@@ -195,15 +194,15 @@
</span><span class="cx"> 
</span><span class="cx"> static bool isEmptyInline(const RenderInline&amp; renderer)
</span><span class="cx"> {
</span><del>-    for (RenderObject* curr = renderer.firstChild(); curr; curr = curr-&gt;nextSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (RenderObject* current = renderer.firstChild(); current; current = current-&gt;nextSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><del>-        if (curr-&gt;isText()) {
-            if (!toRenderText(curr)-&gt;isAllCollapsibleWhitespace())
</del><ins>+        if (is&lt;RenderText&gt;(*current)) {
+            if (!downcast&lt;RenderText&gt;(*current).isAllCollapsibleWhitespace())
</ins><span class="cx">                 return false;
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><del>-        if (!curr-&gt;isRenderInline() || !isEmptyInline(toRenderInline(*curr)))
</del><ins>+        if (!is&lt;RenderInline&gt;(*current) || !isEmptyInline(downcast&lt;RenderInline&gt;(*current)))
</ins><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="lines">@@ -331,9 +330,8 @@
</span><span class="cx"> inline void InlineIterator::fastIncrementInTextNode()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_renderer);
</span><del>-    ASSERT(m_renderer-&gt;isText());
-    ASSERT(m_pos &lt;= toRenderText(m_renderer)-&gt;textLength());
-    m_pos++;
</del><ins>+    ASSERT(m_pos &lt;= downcast&lt;RenderText&gt;(*m_renderer).textLength());
+    ++m_pos;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void InlineIterator::setOffset(unsigned position)
</span><span class="lines">@@ -384,9 +382,9 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return;
</span><del>-    if (m_renderer-&gt;isText()) {
</del><ins>+    if (is&lt;RenderText&gt;(*m_renderer)) {
</ins><span class="cx">         fastIncrementInTextNode();
</span><del>-        if (m_pos &lt; toRenderText(m_renderer)-&gt;textLength())
</del><ins>+        if (m_pos &lt; downcast&lt;RenderText&gt;(*m_renderer).textLength())
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx">     // bidiNext can return 0, so use moveTo instead of moveToStartOf
</span><span class="lines">@@ -409,10 +407,10 @@
</span><span class="cx"> 
</span><span class="cx"> inline UChar InlineIterator::characterAt(unsigned index) const
</span><span class="cx"> {
</span><del>-    if (!m_renderer || !m_renderer-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(m_renderer))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return toRenderText(m_renderer)-&gt;characterAt(index);
</del><ins>+    return downcast&lt;RenderText&gt;(*m_renderer).characterAt(index);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline UChar InlineIterator::current() const
</span><span class="lines">@@ -430,8 +428,8 @@
</span><span class="cx">     if (UNLIKELY(!m_renderer))
</span><span class="cx">         return U_OTHER_NEUTRAL;
</span><span class="cx"> 
</span><del>-    if (LIKELY(m_renderer-&gt;isText())) {
-        UChar codeUnit = toRenderText(*m_renderer).characterAt(m_pos);
</del><ins>+    if (LIKELY(is&lt;RenderText&gt;(*m_renderer))) {
+        UChar codeUnit = downcast&lt;RenderText&gt;(*m_renderer).characterAt(m_pos);
</ins><span class="cx">         if (LIKELY(U16_IS_SINGLE(codeUnit)))
</span><span class="cx">             return u_charDirection(codeUnit);
</span><span class="cx">         return surrogateTextDirection(codeUnit);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineTextBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineTextBox.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual ~InlineTextBox();
</span><span class="cx"> 
</span><del>-    RenderText&amp; renderer() const { return toRenderText(InlineBox::renderer()); }
</del><ins>+    RenderText&amp; renderer() const { return downcast&lt;RenderText&gt;(InlineBox::renderer()); }
</ins><span class="cx">     const RenderStyle&amp; lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
</span><span class="cx"> 
</span><span class="cx">     InlineTextBox* prevTextBox() const { return m_prevTextBox; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -3151,14 +3151,14 @@
</span><span class="cx">         // Move the first letter into the new renderer.
</span><span class="cx">         LayoutStateDisabler layoutStateDisabler(&amp;view());
</span><span class="cx">         while (RenderObject* child = firstLetter-&gt;firstChild()) {
</span><del>-            if (child-&gt;isText())
-                toRenderText(child)-&gt;removeAndDestroyTextBoxes();
</del><ins>+            if (is&lt;RenderText&gt;(*child))
+                downcast&lt;RenderText&gt;(*child).removeAndDestroyTextBoxes();
</ins><span class="cx">             firstLetter-&gt;removeChild(*child);
</span><del>-            newFirstLetter-&gt;addChild(child, 0);
</del><ins>+            newFirstLetter-&gt;addChild(child, nullptr);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         RenderObject* nextSibling = firstLetter-&gt;nextSibling();
</span><del>-        if (RenderTextFragment* remainingText = toRenderBoxModelObject(firstLetter)-&gt;firstLetterRemainingText()) {
</del><ins>+        if (RenderTextFragment* remainingText = downcast&lt;RenderBoxModelObject&gt;(*firstLetter).firstLetterRemainingText()) {
</ins><span class="cx">             ASSERT(remainingText-&gt;isAnonymous() || remainingText-&gt;textNode()-&gt;renderer() == remainingText);
</span><span class="cx">             // Replace the old renderer with the new one.
</span><span class="cx">             remainingText-&gt;setFirstLetter(*newFirstLetter);
</span><span class="lines">@@ -3314,14 +3314,14 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!firstLetterObj-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(*firstLetterObj))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Our layout state is not valid for the repaints we are going to trigger by
</span><span class="cx">     // adding and removing children of firstLetterContainer.
</span><span class="cx">     LayoutStateDisabler layoutStateDisabler(&amp;view());
</span><span class="cx"> 
</span><del>-    createFirstLetterRenderer(firstLetterContainer, toRenderText(firstLetterObj));
</del><ins>+    createFirstLetterRenderer(firstLetterContainer, downcast&lt;RenderText&gt;(firstLetterObj));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderBlock::paginationStrut() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -3500,7 +3500,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_lineLayoutPath == SimpleLinesPath);
</span><span class="cx">     lineBoxes().deleteLineBoxes();
</span><del>-    toRenderText(firstChild())-&gt;deleteLineBoxesBeforeSimpleLineLayout();
</del><ins>+    downcast&lt;RenderText&gt;(*firstChild()).deleteLineBoxesBeforeSimpleLineLayout();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderBlockFlow::ensureLineBoxes()
</span><span class="lines">@@ -3555,10 +3555,10 @@
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> inline static bool isVisibleRenderText(RenderObject* renderer)
</span><span class="cx"> {
</span><del>-    if (!renderer-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(*renderer))
</ins><span class="cx">         return false;
</span><del>-    RenderText* renderText = toRenderText(renderer);
-    return !renderText-&gt;linesBoundingBox().isEmpty() &amp;&amp; !renderText-&gt;text()-&gt;containsOnlyWhitespace();
</del><ins>+    RenderText&amp; renderText = downcast&lt;RenderText&gt;(*renderer);
+    return !renderText.linesBoundingBox().isEmpty() &amp;&amp; !renderText.text()-&gt;containsOnlyWhitespace();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline static bool resizeTextPermitted(RenderObject* render)
</span><span class="lines">@@ -3638,8 +3638,8 @@
</span><span class="cx">     
</span><span class="cx">     for (RenderObject* descendent = traverseNext(this, isNonBlocksOrNonFixedHeightListItems); descendent; descendent = descendent-&gt;traverseNext(this, isNonBlocksOrNonFixedHeightListItems)) {
</span><span class="cx">         if (isVisibleRenderText(descendent) &amp;&amp; resizeTextPermitted(descendent)) {
</span><del>-            RenderText* text = toRenderText(descendent);
-            RenderStyle&amp; oldStyle = text-&gt;style();
</del><ins>+            RenderText&amp; text = downcast&lt;RenderText&gt;(*descendent);
+            RenderStyle&amp; oldStyle = text.style();
</ins><span class="cx">             FontDescription fontDescription = oldStyle.fontDescription();
</span><span class="cx">             float specifiedSize = fontDescription.specifiedSize();
</span><span class="cx">             float scaledSize = roundf(specifiedSize * scale);
</span><span class="lines">@@ -3654,8 +3654,8 @@
</span><span class="cx">                 float candidateNewSize = 0;
</span><span class="cx">                 float lineTextMultiplier = lineCount == ONE_LINE ? oneLineTextMultiplier(specifiedSize) : textMultiplier(specifiedSize);
</span><span class="cx">                 candidateNewSize = roundf(std::min(minFontSize, specifiedSize * lineTextMultiplier));
</span><del>-                if (candidateNewSize &gt; specifiedSize &amp;&amp; candidateNewSize != fontDescription.computedSize() &amp;&amp; text-&gt;textNode() &amp;&amp; oldStyle.textSizeAdjust().isAuto())
-                    document().addAutoSizingNode(text-&gt;textNode(), candidateNewSize);
</del><ins>+                if (candidateNewSize &gt; specifiedSize &amp;&amp; candidateNewSize != fontDescription.computedSize() &amp;&amp; text.textNode() &amp;&amp; oldStyle.textSizeAdjust().isAuto())
+                    document().addAutoSizingNode(text.textNode(), candidateNewSize);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -3931,12 +3931,12 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void stripTrailingSpace(float&amp; inlineMax, float&amp; inlineMin, RenderObject* trailingSpaceChild)
</span><span class="cx"> {
</span><del>-    if (trailingSpaceChild &amp;&amp; trailingSpaceChild-&gt;isText()) {
</del><ins>+    if (is&lt;RenderText&gt;(trailingSpaceChild)) {
</ins><span class="cx">         // Collapse away the trailing space at the end of a block.
</span><del>-        RenderText* t = toRenderText(trailingSpaceChild);
</del><ins>+        RenderText&amp; renderText = downcast&lt;RenderText&gt;(*trailingSpaceChild);
</ins><span class="cx">         const UChar space = ' ';
</span><del>-        const Font&amp; font = t-&gt;style().font(); // FIXME: This ignores first-line.
-        float spaceWidth = font.width(RenderBlock::constructTextRun(t, font, &amp;space, 1, t-&gt;style()));
</del><ins>+        const Font&amp; font = renderText.style().font(); // FIXME: This ignores first-line.
+        float spaceWidth = font.width(RenderBlock::constructTextRun(&amp;renderText, font, &amp;space, 1, renderText.style()));
</ins><span class="cx">         inlineMax -= spaceWidth + font.wordSpacing();
</span><span class="cx">         if (inlineMin &gt; inlineMax)
</span><span class="cx">             inlineMin = inlineMax;
</span><span class="lines">@@ -3960,7 +3960,7 @@
</span><span class="cx">     // If we are at the start of a line, we want to ignore all white-space.
</span><span class="cx">     // Also strip spaces if we previously had text that ended in a trailing space.
</span><span class="cx">     bool stripFrontSpaces = true;
</span><del>-    RenderObject* trailingSpaceChild = 0;
</del><ins>+    RenderObject* trailingSpaceChild = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // Firefox and Opera will allow a table cell to grow to fit an image inside it under
</span><span class="cx">     // very specific cirucumstances (in order to match common WinIE renderings). 
</span><span class="lines">@@ -4121,14 +4121,14 @@
</span><span class="cx">                 // We are no longer stripping whitespace at the start of a line.
</span><span class="cx">                 if (!child-&gt;isFloating()) {
</span><span class="cx">                     stripFrontSpaces = false;
</span><del>-                    trailingSpaceChild = 0;
</del><ins>+                    trailingSpaceChild = nullptr;
</ins><span class="cx">                 }
</span><del>-            } else if (child-&gt;isText()) {
</del><ins>+            } else if (is&lt;RenderText&gt;(*child)) {
</ins><span class="cx">                 // Case (3). Text.
</span><del>-                RenderText* t = toRenderText(child);
</del><ins>+                RenderText&amp; renderText = downcast&lt;RenderText&gt;(*child);
</ins><span class="cx"> 
</span><del>-                if (t-&gt;style().hasTextCombine() &amp;&amp; t-&gt;isCombineText())
-                    toRenderCombineText(*t).combineText();
</del><ins>+                if (renderText.style().hasTextCombine() &amp;&amp; renderText.isCombineText())
+                    downcast&lt;RenderCombineText&gt;(renderText).combineText();
</ins><span class="cx"> 
</span><span class="cx">                 // Determine if we have a breakable character. Pass in
</span><span class="cx">                 // whether or not we should ignore any spaces at the front
</span><span class="lines">@@ -4139,7 +4139,7 @@
</span><span class="cx">                 float beginMin, endMin;
</span><span class="cx">                 bool beginWS, endWS;
</span><span class="cx">                 float beginMax, endMax;
</span><del>-                t-&gt;trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS,
</del><ins>+                renderText.trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS,
</ins><span class="cx">                                      hasBreakableChar, hasBreak, beginMax, endMax,
</span><span class="cx">                                      childMin, childMax, stripFrontSpaces);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -136,41 +136,41 @@
</span><span class="cx">     return rootBox;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline InlineBox* createInlineBoxForRenderer(RenderObject* obj, bool isRootLineBox, bool isOnlyRun = false)
</del><ins>+static inline InlineBox* createInlineBoxForRenderer(RenderObject* renderer, bool isRootLineBox, bool isOnlyRun = false)
</ins><span class="cx"> {
</span><span class="cx">     if (isRootLineBox)
</span><del>-        return toRenderBlockFlow(obj)-&gt;createAndAppendRootInlineBox();
</del><ins>+        return downcast&lt;RenderBlockFlow&gt;(*renderer).createAndAppendRootInlineBox();
</ins><span class="cx"> 
</span><del>-    if (obj-&gt;isText())
-        return toRenderText(obj)-&gt;createInlineTextBox();
</del><ins>+    if (is&lt;RenderText&gt;(*renderer))
+        return downcast&lt;RenderText&gt;(*renderer).createInlineTextBox();
</ins><span class="cx"> 
</span><del>-    if (obj-&gt;isBox()) {
</del><ins>+    if (is&lt;RenderBox&gt;(*renderer)) {
</ins><span class="cx">         // FIXME: This is terrible. This branch returns an *owned* pointer!
</span><del>-        return toRenderBox(obj)-&gt;createInlineBox().release();
</del><ins>+        return downcast&lt;RenderBox&gt;(*renderer).createInlineBox().release();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (obj-&gt;isLineBreak()) {
</del><ins>+    if (is&lt;RenderLineBreak&gt;(*renderer)) {
</ins><span class="cx">         // FIXME: This is terrible. This branch returns an *owned* pointer!
</span><del>-        auto inlineBox = toRenderLineBreak(obj)-&gt;createInlineBox().release();
</del><ins>+        auto inlineBox = downcast&lt;RenderLineBreak&gt;(*renderer).createInlineBox().release();
</ins><span class="cx">         // We only treat a box as text for a &lt;br&gt; if we are on a line by ourself or in strict mode
</span><span class="cx">         // (Note the use of strict mode. In &quot;almost strict&quot; mode, we don't treat the box for &lt;br&gt; as text.)
</span><del>-        inlineBox-&gt;setBehavesLikeText(isOnlyRun || obj-&gt;document().inNoQuirksMode() || obj-&gt;isLineBreakOpportunity());
</del><ins>+        inlineBox-&gt;setBehavesLikeText(isOnlyRun || renderer-&gt;document().inNoQuirksMode() || renderer-&gt;isLineBreakOpportunity());
</ins><span class="cx">         return inlineBox;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return toRenderInline(obj)-&gt;createAndAppendInlineFlowBox();
</del><ins>+    return downcast&lt;RenderInline&gt;(*renderer).createAndAppendInlineFlowBox();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline void dirtyLineBoxesForRenderer(RenderObject&amp; renderer, bool fullLayout)
</span><span class="cx"> {
</span><del>-    if (renderer.isText()) {
-        RenderText&amp; renderText = toRenderText(renderer);
</del><ins>+    if (is&lt;RenderText&gt;(renderer)) {
+        RenderText&amp; renderText = downcast&lt;RenderText&gt;(renderer);
</ins><span class="cx">         updateCounterIfNeeded(renderText);
</span><span class="cx">         renderText.dirtyLineBoxes(fullLayout);
</span><del>-    } else if (renderer.isLineBreak())
-        toRenderLineBreak(renderer).dirtyLineBoxes(fullLayout);
</del><ins>+    } else if (is&lt;RenderLineBreak&gt;(renderer))
+        downcast&lt;RenderLineBreak&gt;(renderer).dirtyLineBoxes(fullLayout);
</ins><span class="cx">     else
</span><del>-        toRenderInline(renderer).dirtyLineBoxes(fullLayout);
</del><ins>+        downcast&lt;RenderInline&gt;(renderer).dirtyLineBoxes(fullLayout);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool parentIsConstructedOrHaveNext(InlineFlowBox* parentBox)
</span><span class="lines">@@ -262,10 +262,10 @@
</span><span class="cx">     if (!run)
</span><span class="cx">         return true;
</span><span class="cx">     unsigned pos = run-&gt;stop();
</span><del>-    const RenderObject&amp; r = run-&gt;renderer();
-    if (!r.isText())
</del><ins>+    const RenderObject&amp; renderer = run-&gt;renderer();
+    if (!is&lt;RenderText&gt;(renderer))
</ins><span class="cx">         return false;
</span><del>-    const RenderText&amp; renderText = toRenderText(r);
</del><ins>+    const RenderText&amp; renderText = downcast&lt;RenderText&gt;(renderer);
</ins><span class="cx">     unsigned length = renderText.textLength();
</span><span class="cx">     if (pos &gt;= length)
</span><span class="cx">         return true;
</span><span class="lines">@@ -669,7 +669,7 @@
</span><span class="cx">     unsigned expansionOpportunityCount = 0;
</span><span class="cx">     bool isAfterExpansion = true;
</span><span class="cx">     Vector&lt;unsigned, 16&gt; expansionOpportunities;
</span><del>-    RenderObject* previousObject = 0;
</del><ins>+    RenderObject* previousObject = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     BidiRun* r = firstRun;
</span><span class="cx">     for (; r; r = r-&gt;next()) {
</span><span class="lines">@@ -677,23 +677,23 @@
</span><span class="cx">             continue; // Positioned objects are only participating to figure out their
</span><span class="cx">                       // correct static x position.  They have no effect on the width.
</span><span class="cx">                       // Similarly, line break boxes have no effect on the width.
</span><del>-        if (r-&gt;renderer().isText()) {
-            RenderText&amp; rt = toRenderText(r-&gt;renderer());
</del><ins>+        if (is&lt;RenderText&gt;(r-&gt;renderer())) {
+            RenderText&amp; renderText = downcast&lt;RenderText&gt;(r-&gt;renderer());
</ins><span class="cx">             if (textAlign == JUSTIFY &amp;&amp; r != trailingSpaceRun) {
</span><span class="cx">                 if (!isAfterExpansion)
</span><span class="cx">                     toInlineTextBox(r-&gt;box())-&gt;setCanHaveLeadingExpansion(true);
</span><del>-                unsigned opportunitiesInRun = Font::expansionOpportunityCount(rt.stringView(r-&gt;m_start, r-&gt;m_stop), r-&gt;box()-&gt;direction(), isAfterExpansion);
</del><ins>+                unsigned opportunitiesInRun = Font::expansionOpportunityCount(renderText.stringView(r-&gt;m_start, r-&gt;m_stop), r-&gt;box()-&gt;direction(), isAfterExpansion);
</ins><span class="cx">                 expansionOpportunities.append(opportunitiesInRun);
</span><span class="cx">                 expansionOpportunityCount += opportunitiesInRun;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (int length = rt.textLength()) {
-                if (!r-&gt;m_start &amp;&amp; needsWordSpacing &amp;&amp; isSpaceOrNewline(rt.characterAt(r-&gt;m_start)))
-                    totalLogicalWidth += lineStyle(*rt.parent(), lineInfo).font().wordSpacing();
-                needsWordSpacing = !isSpaceOrNewline(rt.characterAt(r-&gt;m_stop - 1)) &amp;&amp; r-&gt;m_stop == length;
</del><ins>+            if (int length = renderText.textLength()) {
+                if (!r-&gt;m_start &amp;&amp; needsWordSpacing &amp;&amp; isSpaceOrNewline(renderText.characterAt(r-&gt;m_start)))
+                    totalLogicalWidth += lineStyle(*renderText.parent(), lineInfo).font().wordSpacing();
+                needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(r-&gt;m_stop - 1)) &amp;&amp; r-&gt;m_stop == length;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            setLogicalWidthForTextRun(lineBox, r, &amp;rt, totalLogicalWidth, lineInfo, textBoxDataMap, verticalPositionCache, wordMeasurements);
</del><ins>+            setLogicalWidthForTextRun(lineBox, r, &amp;renderText, totalLogicalWidth, lineInfo, textBoxDataMap, verticalPositionCache, wordMeasurements);
</ins><span class="cx">         } else {
</span><span class="cx">             isAfterExpansion = false;
</span><span class="cx">             if (!r-&gt;renderer().isRenderInline()) {
</span><span class="lines">@@ -741,12 +741,12 @@
</span><span class="cx"> 
</span><span class="cx">         // Position is used to properly position both replaced elements and
</span><span class="cx">         // to update the static normal flow x/y of positioned elements.
</span><del>-        if (r-&gt;renderer().isText())
-            toRenderText(r-&gt;renderer()).positionLineBox(toInlineTextBox(box));
-        else if (r-&gt;renderer().isBox())
-            toRenderBox(r-&gt;renderer()).positionLineBox(toInlineElementBox(box));
-        else if (r-&gt;renderer().isLineBreak())
-            toRenderLineBreak(r-&gt;renderer()).replaceInlineBoxWrapper(toInlineElementBox(box));
</del><ins>+        if (is&lt;RenderText&gt;(r-&gt;renderer()))
+            downcast&lt;RenderText&gt;(r-&gt;renderer()).positionLineBox(toInlineTextBox(box));
+        else if (is&lt;RenderBox&gt;(r-&gt;renderer()))
+            downcast&lt;RenderBox&gt;(r-&gt;renderer()).positionLineBox(toInlineElementBox(box));
+        else if (is&lt;RenderLineBreak&gt;(r-&gt;renderer()))
+            downcast&lt;RenderLineBreak&gt;(r-&gt;renderer()).replaceInlineBoxWrapper(toInlineElementBox(box));
</ins><span class="cx">     }
</span><span class="cx">     // Positioned objects and zero-length text nodes destroy their boxes in
</span><span class="cx">     // position(), which unnecessarily dirties the line.
</span><span class="lines">@@ -783,14 +783,14 @@
</span><span class="cx">     if (!bidiRuns.runCount()
</span><span class="cx">         || !bidiRuns.logicallyLastRun()-&gt;renderer().style().breakOnlyAfterWhiteSpace()
</span><span class="cx">         || !bidiRuns.logicallyLastRun()-&gt;renderer().style().autoWrap())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     BidiRun* trailingSpaceRun = bidiRuns.logicallyLastRun();
</span><span class="cx">     const RenderObject&amp; lastObject = trailingSpaceRun-&gt;renderer();
</span><del>-    if (!lastObject.isText())
-        return 0;
</del><ins>+    if (!is&lt;RenderText&gt;(lastObject))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    const RenderText&amp; lastText = toRenderText(lastObject);
</del><ins>+    const RenderText&amp; lastText = downcast&lt;RenderText&gt;(lastObject);
</ins><span class="cx">     int firstSpace;
</span><span class="cx">     if (lastText.is8Bit())
</span><span class="cx">         firstSpace = findFirstTrailingSpace(lastText, lastText.characters8(), trailingSpaceRun-&gt;start(), trailingSpaceRun-&gt;stop());
</span><span class="lines">@@ -798,7 +798,7 @@
</span><span class="cx">         firstSpace = findFirstTrailingSpace(lastText, lastText.characters16(), trailingSpaceRun-&gt;start(), trailingSpaceRun-&gt;stop());
</span><span class="cx"> 
</span><span class="cx">     if (firstSpace == trailingSpaceRun-&gt;stop())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     TextDirection direction = style().direction();
</span><span class="cx">     bool shouldReorder = trailingSpaceRun != (direction == LTR ? bidiRuns.lastRun() : bidiRuns.firstRun());
</span><span class="lines">@@ -1561,10 +1561,11 @@
</span><span class="cx">             // We have a dirty line.
</span><span class="cx">             if (RootInlineBox* prevRootBox = curr-&gt;prevRootBox()) {
</span><span class="cx">                 // We have a previous line.
</span><del>-                if (!dirtiedByFloat &amp;&amp; (!prevRootBox-&gt;endsWithBreak() || !prevRootBox-&gt;lineBreakObj() || (prevRootBox-&gt;lineBreakObj()-&gt;isText() &amp;&amp; prevRootBox-&gt;lineBreakPos() &gt;= toRenderText(prevRootBox-&gt;lineBreakObj())-&gt;textLength())))
</del><ins>+                if (!dirtiedByFloat &amp;&amp; (!prevRootBox-&gt;endsWithBreak() || !prevRootBox-&gt;lineBreakObj() || (is&lt;RenderText&gt;(*prevRootBox-&gt;lineBreakObj()) &amp;&amp; prevRootBox-&gt;lineBreakPos() &gt;= downcast&lt;RenderText&gt;(*prevRootBox-&gt;lineBreakObj()).textLength()))) {
</ins><span class="cx">                     // The previous line didn't break cleanly or broke at a newline
</span><span class="cx">                     // that has been deleted, so treat it as dirty too.
</span><span class="cx">                     curr = prevRootBox;
</span><ins>+                }
</ins><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             // No dirty lines were found.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -2709,9 +2709,9 @@
</span><span class="cx">         // Check to make sure we're not saving the firstLetter as the nextSibling.
</span><span class="cx">         // When the |child| object will be moved, its firstLetter will be recreated,
</span><span class="cx">         // so saving it now in nextSibling would let us with a destroyed object.
</span><del>-        if (child-&gt;isText() &amp;&amp; toRenderText(child)-&gt;isTextFragment() &amp;&amp; nextSibling &amp;&amp; nextSibling-&gt;isText()) {
</del><ins>+        if (is&lt;RenderTextFragment&gt;(*child) &amp;&amp; is&lt;RenderText&gt;(nextSibling)) {
</ins><span class="cx">             RenderObject* firstLetterObj = nullptr;
</span><del>-            if (RenderBlock* block = toRenderTextFragment(child)-&gt;blockForAccompanyingFirstLetter()) {
</del><ins>+            if (RenderBlock* block = downcast&lt;RenderTextFragment&gt;(*child).blockForAccompanyingFirstLetter()) {
</ins><span class="cx">                 RenderElement* firstLetterContainer = nullptr;
</span><span class="cx">                 block-&gt;getFirstLetter(firstLetterObj, firstLetterContainer, child);
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx"> inline bool RenderElement::hasImmediateNonWhitespaceTextChildOrBorderOrOutline() const
</span><span class="cx"> {
</span><span class="cx">     for (auto&amp; child : childrenOfType&lt;RenderObject&gt;(*this)) {
</span><del>-        if (child.isText() &amp;&amp; !toRenderText(child).isAllCollapsibleWhitespace())
</del><ins>+        if (is&lt;RenderText&gt;(child) &amp;&amp; !downcast&lt;RenderText&gt;(child).isAllCollapsibleWhitespace())
</ins><span class="cx">             return true;
</span><span class="cx">         if (child.style().hasOutline() || child.style().hasBorder())
</span><span class="cx">             return true;
</span><span class="lines">@@ -494,8 +494,8 @@
</span><span class="cx">     } else
</span><span class="cx">         insertChildInternal(newChild, beforeChild, NotifyChildren);
</span><span class="cx"> 
</span><del>-    if (newChild-&gt;isText())
-        toRenderText(newChild)-&gt;styleDidChange(StyleDifferenceEqual, nullptr);
</del><ins>+    if (is&lt;RenderText&gt;(newChild))
+        downcast&lt;RenderText&gt;(*newChild).styleDidChange(StyleDifferenceEqual, nullptr);
</ins><span class="cx"> 
</span><span class="cx">     // SVG creates renderers for &lt;g display=&quot;none&quot;&gt;, as SVG requires children of hidden
</span><span class="cx">     // &lt;g&gt;s to have renderers - at least that's how our implementation works. Consider:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -570,31 +570,31 @@
</span><span class="cx"> 
</span><span class="cx">     bool isHorizontal = style().isHorizontalWritingMode();
</span><span class="cx"> 
</span><del>-    for (RenderObject* curr = firstChild(); curr; curr = curr-&gt;nextSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx">             
</span><span class="cx">         // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
</span><span class="cx">         // direction (aligned to the root box's baseline).
</span><del>-        if (curr-&gt;isBox()) {
-            RenderBox* currBox = toRenderBox(curr);
-            if (currBox-&gt;inlineBoxWrapper()) {
-                const RootInlineBox&amp; rootBox = currBox-&gt;inlineBoxWrapper()-&gt;root();
</del><ins>+        if (is&lt;RenderBox&gt;(*current)) {
+            RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
+            if (renderBox.inlineBoxWrapper()) {
+                const RootInlineBox&amp; rootBox = renderBox.inlineBoxWrapper()-&gt;root();
</ins><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="cx">                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="cx">                 int logicalHeight = containerStyle.font().fontMetrics().height();
</span><span class="cx">                 if (isHorizontal)
</span><del>-                    context.addRect(FloatRect(currBox-&gt;inlineBoxWrapper()-&gt;x() - currBox-&gt;marginLeft(), logicalTop, currBox-&gt;width() + currBox-&gt;horizontalMarginExtent(), logicalHeight));
</del><ins>+                    context.addRect(FloatRect(renderBox.inlineBoxWrapper()-&gt;x() - renderBox.marginLeft(), logicalTop, renderBox.width() + renderBox.horizontalMarginExtent(), logicalHeight));
</ins><span class="cx">                 else
</span><del>-                    context.addRect(FloatRect(logicalTop, currBox-&gt;inlineBoxWrapper()-&gt;y() - currBox-&gt;marginTop(), logicalHeight, currBox-&gt;height() + currBox-&gt;verticalMarginExtent()));
</del><ins>+                    context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()-&gt;y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
</ins><span class="cx">             }
</span><del>-        } else if (curr-&gt;isRenderInline()) {
</del><ins>+        } else if (is&lt;RenderInline&gt;(*current)) {
</ins><span class="cx">             // If the child doesn't need line boxes either, then we can recur.
</span><del>-            RenderInline* currInline = toRenderInline(curr);
-            if (!currInline-&gt;alwaysCreateLineBoxes())
-                currInline-&gt;generateCulledLineBoxRects(context, container);
</del><ins>+            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
+            if (!renderInline.alwaysCreateLineBoxes())
+                renderInline.generateCulledLineBoxRects(context, container);
</ins><span class="cx">             else {
</span><del>-                for (InlineFlowBox* childLine = currInline-&gt;firstLineBox(); childLine; childLine = childLine-&gt;nextLineBox()) {
</del><ins>+                for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine-&gt;nextLineBox()) {
</ins><span class="cx">                     const RootInlineBox&amp; rootBox = childLine-&gt;root();
</span><span class="cx">                     const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="cx">                     int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="lines">@@ -612,9 +612,9 @@
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-        } else if (curr-&gt;isText()) {
-            RenderText* currText = toRenderText(curr);
-            for (InlineTextBox* childText = currText-&gt;firstTextBox(); childText; childText = childText-&gt;nextTextBox()) {
</del><ins>+        } else if (is&lt;RenderText&gt;(*current)) {
+            RenderText&amp; currText = downcast&lt;RenderText&gt;(*current);
+            for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText-&gt;nextTextBox()) {
</ins><span class="cx">                 const RootInlineBox&amp; rootBox = childText-&gt;root();
</span><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="cx">                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
</span><span class="lines">@@ -624,8 +624,8 @@
</span><span class="cx">                 else
</span><span class="cx">                     context.addRect(FloatRect(logicalTop, childText-&gt;y(), logicalHeight, childText-&gt;logicalWidth()));
</span><span class="cx">             }
</span><del>-        } else if (curr-&gt;isLineBreak()) {
-            if (InlineBox* inlineBox = toRenderLineBreak(curr)-&gt;inlineBoxWrapper()) {
</del><ins>+        } else if (is&lt;RenderLineBreak&gt;(*current)) {
+            if (InlineBox* inlineBox = downcast&lt;RenderLineBreak&gt;(*current).inlineBoxWrapper()) {
</ins><span class="cx">                 // FIXME: This could use a helper to share these with text path.
</span><span class="cx">                 const RootInlineBox&amp; rootBox = inlineBox-&gt;root();
</span><span class="cx">                 const RenderStyle&amp; containerStyle = rootBox.isFirstLine() ? container-&gt;firstLineStyle() : container-&gt;style();
</span><span class="lines">@@ -930,58 +930,56 @@
</span><span class="cx"> 
</span><span class="cx"> InlineBox* RenderInline::culledInlineFirstLineBox() const
</span><span class="cx"> {
</span><del>-    for (RenderObject* curr = firstChild(); curr; curr = curr-&gt;nextSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx">             
</span><span class="cx">         // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
</span><span class="cx">         // direction (aligned to the root box's baseline).
</span><del>-        if (curr-&gt;isBox())
-            return toRenderBox(curr)-&gt;inlineBoxWrapper();
-        if (curr-&gt;isLineBreak()) {
-            RenderLineBreak* renderBR = toRenderLineBreak(curr);
-            if (renderBR-&gt;inlineBoxWrapper())
-                return renderBR-&gt;inlineBoxWrapper();
-        } else if (curr-&gt;isRenderInline()) {
-            RenderInline* currInline = toRenderInline(curr);
-            InlineBox* result = currInline-&gt;firstLineBoxIncludingCulling();
-            if (result)
</del><ins>+        if (is&lt;RenderBox&gt;(*current))
+            return downcast&lt;RenderBox&gt;(*current).inlineBoxWrapper();
+        if (is&lt;RenderLineBreak&gt;(*current)) {
+            RenderLineBreak&amp; renderBR = downcast&lt;RenderLineBreak&gt;(*current);
+            if (renderBR.inlineBoxWrapper())
+                return renderBR.inlineBoxWrapper();
+        } else if (is&lt;RenderInline&gt;(*current)) {
+            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
+            if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
</ins><span class="cx">                 return result;
</span><del>-        } else if (curr-&gt;isText()) {
-            RenderText* currText = toRenderText(curr);
-            if (currText-&gt;firstTextBox())
-                return currText-&gt;firstTextBox();
</del><ins>+        } else if (is&lt;RenderText&gt;(*current)) {
+            RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
+            if (renderText.firstTextBox())
+                return renderText.firstTextBox();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InlineBox* RenderInline::culledInlineLastLineBox() const
</span><span class="cx"> {
</span><del>-    for (RenderObject* curr = lastChild(); curr; curr = curr-&gt;previousSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (RenderObject* current = lastChild(); current; current = current-&gt;previousSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx">             
</span><span class="cx">         // We want to get the margin box in the inline direction, and then use our font ascent/descent in the block
</span><span class="cx">         // direction (aligned to the root box's baseline).
</span><del>-        if (curr-&gt;isBox())
-            return toRenderBox(curr)-&gt;inlineBoxWrapper();
-        if (curr-&gt;isLineBreak()) {
-            RenderLineBreak* renderBR = toRenderLineBreak(curr);
-            if (renderBR-&gt;inlineBoxWrapper())
-                return renderBR-&gt;inlineBoxWrapper();
-        } else if (curr-&gt;isRenderInline()) {
-            RenderInline* currInline = toRenderInline(curr);
-            InlineBox* result = currInline-&gt;lastLineBoxIncludingCulling();
-            if (result)
</del><ins>+        if (is&lt;RenderBox&gt;(*current))
+            return downcast&lt;RenderBox&gt;(*current).inlineBoxWrapper();
+        if (is&lt;RenderLineBreak&gt;(*current)) {
+            RenderLineBreak&amp; renderBR = downcast&lt;RenderLineBreak&gt;(*current);
+            if (renderBR.inlineBoxWrapper())
+                return renderBR.inlineBoxWrapper();
+        } else if (is&lt;RenderInline&gt;(*current)) {
+            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
+            if (InlineBox* result = renderInline.lastLineBoxIncludingCulling())
</ins><span class="cx">                 return result;
</span><del>-        } else if (curr-&gt;isText()) {
-            RenderText* currText = toRenderText(curr);
-            if (currText-&gt;lastTextBox())
-                return currText-&gt;lastTextBox();
</del><ins>+        } else if (is&lt;RenderText&gt;(*current)) {
+            RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
+            if (renderText.lastTextBox())
+                return renderText.lastTextBox();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const
</span><span class="lines">@@ -991,35 +989,35 @@
</span><span class="cx">     generateCulledLineBoxRects(context, this);
</span><span class="cx">     LayoutRect result(enclosingLayoutRect(floatResult));
</span><span class="cx">     bool isHorizontal = style().isHorizontalWritingMode();
</span><del>-    for (RenderObject* curr = firstChild(); curr; curr = curr-&gt;nextSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx">             
</span><span class="cx">         // For overflow we just have to propagate by hand and recompute it all.
</span><del>-        if (curr-&gt;isBox()) {
-            RenderBox* currBox = toRenderBox(curr);
-            if (!currBox-&gt;hasSelfPaintingLayer() &amp;&amp; currBox-&gt;inlineBoxWrapper()) {
-                LayoutRect logicalRect = currBox-&gt;logicalVisualOverflowRectForPropagation(&amp;style());
</del><ins>+        if (is&lt;RenderBox&gt;(*current)) {
+            RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
+            if (!renderBox.hasSelfPaintingLayer() &amp;&amp; renderBox.inlineBoxWrapper()) {
+                LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&amp;style());
</ins><span class="cx">                 if (isHorizontal) {
</span><del>-                    logicalRect.moveBy(currBox-&gt;location());
</del><ins>+                    logicalRect.moveBy(renderBox.location());
</ins><span class="cx">                     result.uniteIfNonZero(logicalRect);
</span><span class="cx">                 } else {
</span><del>-                    logicalRect.moveBy(currBox-&gt;location());
</del><ins>+                    logicalRect.moveBy(renderBox.location());
</ins><span class="cx">                     result.uniteIfNonZero(logicalRect.transposedRect());
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-        } else if (curr-&gt;isRenderInline()) {
</del><ins>+        } else if (is&lt;RenderInline&gt;(*current)) {
</ins><span class="cx">             // If the child doesn't need line boxes either, then we can recur.
</span><del>-            RenderInline* currInline = toRenderInline(curr);
-            if (!currInline-&gt;alwaysCreateLineBoxes())
-                result.uniteIfNonZero(currInline-&gt;culledInlineVisualOverflowBoundingBox());
-            else if (!currInline-&gt;hasSelfPaintingLayer())
-                result.uniteIfNonZero(currInline-&gt;linesVisualOverflowBoundingBox());
-        } else if (curr-&gt;isText()) {
</del><ins>+            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
+            if (!renderInline.alwaysCreateLineBoxes())
+                result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox());
+            else if (!renderInline.hasSelfPaintingLayer())
+                result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
+        } else if (is&lt;RenderText&gt;(*current)) {
</ins><span class="cx">             // FIXME; Overflow from text boxes is lost. We will need to cache this information in
</span><span class="cx">             // InlineTextBoxes.
</span><del>-            RenderText* currText = toRenderText(curr);
-            result.uniteIfNonZero(currText-&gt;linesVisualOverflowBoundingBox());
</del><ins>+            RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
+            result.uniteIfNonZero(renderText.linesVisualOverflowBoundingBox());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return result;
</span><span class="lines">@@ -1354,26 +1352,26 @@
</span><span class="cx"> 
</span><span class="cx">     if (!alwaysCreateLineBoxes()) {
</span><span class="cx">         // We have to grovel into our children in order to dirty the appropriate lines.
</span><del>-        for (RenderObject* curr = firstChild(); curr; curr = curr-&gt;nextSibling()) {
-            if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+        for (RenderObject* current = firstChild(); current; current = current-&gt;nextSibling()) {
+            if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">                 continue;
</span><del>-            if (curr-&gt;isBox() &amp;&amp; !curr-&gt;needsLayout()) {
-                RenderBox* currBox = toRenderBox(curr);
-                if (currBox-&gt;inlineBoxWrapper())
-                    currBox-&gt;inlineBoxWrapper()-&gt;root().markDirty();
-            } else if (!curr-&gt;selfNeedsLayout()) {
-                if (curr-&gt;isRenderInline()) {
-                    RenderInline* currInline = toRenderInline(curr);
-                    for (InlineFlowBox* childLine = currInline-&gt;firstLineBox(); childLine; childLine = childLine-&gt;nextLineBox())
</del><ins>+            if (is&lt;RenderBox&gt;(*current) &amp;&amp; !current-&gt;needsLayout()) {
+                RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*current);
+                if (renderBox.inlineBoxWrapper())
+                    renderBox.inlineBoxWrapper()-&gt;root().markDirty();
+            } else if (!current-&gt;selfNeedsLayout()) {
+                if (is&lt;RenderInline&gt;(*current)) {
+                    RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*current);
+                    for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine-&gt;nextLineBox())
</ins><span class="cx">                         childLine-&gt;root().markDirty();
</span><del>-                } else if (curr-&gt;isText()) {
-                    RenderText* currText = toRenderText(curr);
-                    for (InlineTextBox* childText = currText-&gt;firstTextBox(); childText; childText = childText-&gt;nextTextBox())
</del><ins>+                } else if (is&lt;RenderText&gt;(*current)) {
+                    RenderText&amp; renderText = downcast&lt;RenderText&gt;(*current);
+                    for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText-&gt;nextTextBox())
</ins><span class="cx">                         childText-&gt;root().markDirty();
</span><del>-                } else if (curr-&gt;isLineBreak()) {
-                    RenderLineBreak* currBR = toRenderLineBreak(curr);
-                    if (currBR-&gt;inlineBoxWrapper())
-                        currBR-&gt;inlineBoxWrapper()-&gt;root().markDirty();
</del><ins>+                } else if (is&lt;RenderLineBreak&gt;(*current)) {
+                    RenderLineBreak&amp; renderBR = downcast&lt;RenderLineBreak&gt;(*current);
+                    if (renderBR.inlineBoxWrapper())
+                        renderBR.inlineBoxWrapper()-&gt;root().markDirty();
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlineh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderInline.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -53,6 +53,12 @@
</span><span class="cx"> 
</span><span class="cx">     virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&amp;, bool* offsetDependsOnPoint = 0) const override final;
</span><span class="cx"> 
</span><ins>+    virtual IntRect borderBoundingBox() const override final
+    {
+        IntRect boundingBox = linesBoundingBox();
+        return IntRect(0, 0, boundingBox.width(), boundingBox.height());
+    }
+
</ins><span class="cx">     IntRect linesBoundingBox() const;
</span><span class="cx">     LayoutRect linesVisualOverflowBoundingBox() const;
</span><span class="cx">     LayoutRect linesVisualOverflowBoundingBoxInRegion(const RenderRegion*) const;
</span><span class="lines">@@ -148,12 +154,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual LayoutRect frameRectForStickyPositioning() const override final { return linesBoundingBox(); }
</span><span class="cx"> 
</span><del>-    virtual IntRect borderBoundingBox() const override final
-    {
-        IntRect boundingBox = linesBoundingBox();
-        return IntRect(0, 0, boundingBox.width(), boundingBox.height());
-    }
-
</del><span class="cx">     virtual std::unique_ptr&lt;InlineFlowBox&gt; createInlineFlowBox(); // Subclassed by RenderSVGInline
</span><span class="cx"> 
</span><span class="cx">     virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -6286,16 +6286,16 @@
</span><span class="cx">         if (++siblingCount &gt; maxSiblingCount)
</span><span class="cx">             return true;
</span><span class="cx">         
</span><del>-        if (child.isText()) {
</del><ins>+        if (is&lt;RenderText&gt;(child)) {
</ins><span class="cx">             bool isSelectable = renderer.style().userSelect() != SELECT_NONE;
</span><del>-            if (isSelectable || !toRenderText(child).isAllCollapsibleWhitespace())
</del><ins>+            if (isSelectable || !downcast&lt;RenderText&gt;(child).isAllCollapsibleWhitespace())
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (!child.isRenderElement())
</del><ins>+        if (!is&lt;RenderElement&gt;(child))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        const RenderElement&amp; renderElementChild = toRenderElement(child);
</del><ins>+        const RenderElement&amp; renderElementChild = downcast&lt;RenderElement&gt;(child);
</ins><span class="cx"> 
</span><span class="cx">         if (renderElementChild.isRenderLayerModelObject() &amp;&amp; toRenderLayerModelObject(renderElementChild).hasSelfPaintingLayer())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLineBoxListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -335,24 +335,23 @@
</span><span class="cx">     // Try to figure out which line box we belong in.  First try to find a previous
</span><span class="cx">     // line box by examining our siblings.  If we didn't find a line box, then use our 
</span><span class="cx">     // parent's first line box.
</span><del>-    RootInlineBox* box = 0;
-    RenderObject* curr = 0;
-    for (curr = child-&gt;previousSibling(); curr; curr = curr-&gt;previousSibling()) {
-        if (curr-&gt;isFloatingOrOutOfFlowPositioned())
</del><ins>+    RootInlineBox* box = nullptr;
+    RenderObject* current;
+    for (current = child-&gt;previousSibling(); current; current = current-&gt;previousSibling()) {
+        if (current-&gt;isFloatingOrOutOfFlowPositioned())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (curr-&gt;isReplaced()) {
-            if (auto wrapper = toRenderBox(curr)-&gt;inlineBoxWrapper())
</del><ins>+        if (current-&gt;isReplaced()) {
+            if (auto wrapper = downcast&lt;RenderBox&gt;(*current).inlineBoxWrapper())
</ins><span class="cx">                 box = &amp;wrapper-&gt;root();
</span><del>-        } if (curr-&gt;isLineBreak()) {
-            if (auto wrapper = toRenderLineBreak(curr)-&gt;inlineBoxWrapper())
</del><ins>+        } if (is&lt;RenderLineBreak&gt;(*current)) {
+            if (auto wrapper = downcast&lt;RenderLineBreak&gt;(*current).inlineBoxWrapper())
</ins><span class="cx">                 box = &amp;wrapper-&gt;root();
</span><del>-        } else if (curr-&gt;isText()) {
-            InlineTextBox* textBox = toRenderText(curr)-&gt;lastTextBox();
-            if (textBox)
</del><ins>+        } else if (is&lt;RenderText&gt;(*current)) {
+            if (InlineTextBox* textBox = downcast&lt;RenderText&gt;(*current).lastTextBox())
</ins><span class="cx">                 box = &amp;textBox-&gt;root();
</span><del>-        } else if (curr-&gt;isRenderInline()) {
-            InlineBox* lastSiblingBox = toRenderInline(curr)-&gt;lastLineBoxIncludingCulling();
</del><ins>+        } else if (is&lt;RenderInline&gt;(*current)) {
+            InlineBox* lastSiblingBox = downcast&lt;RenderInline&gt;(*current).lastLineBoxIncludingCulling();
</ins><span class="cx">             if (lastSiblingBox)
</span><span class="cx">                 box = &amp;lastSiblingBox-&gt;root();
</span><span class="cx">         }
</span><span class="lines">@@ -396,7 +395,7 @@
</span><span class="cx">         // space, the search for |child|'s linebox will go past the leading space to the previous linebox and select that
</span><span class="cx">         // one as |box|. If we hit that situation here, dirty the |box| actually containing the child too. 
</span><span class="cx">         bool insertedAfterLeadingSpace = box-&gt;lineBreakObj() == child-&gt;previousSibling();
</span><del>-        if (adjacentBox &amp;&amp; (adjacentBox-&gt;lineBreakObj() == child || child-&gt;isBR() || (curr &amp;&amp; curr-&gt;isBR())
</del><ins>+        if (adjacentBox &amp;&amp; (adjacentBox-&gt;lineBreakObj() == child || child-&gt;isBR() || (current &amp;&amp; current-&gt;isBR())
</ins><span class="cx">             || insertedAfterLeadingSpace || isIsolated(container-&gt;style().unicodeBidi())))
</span><span class="cx">             adjacentBox-&gt;markDirty();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -658,7 +658,7 @@
</span><span class="cx">         bool startsAboveRegion = true;
</span><span class="cx">         bool endsBelowRegion = true;
</span><span class="cx">         bool skipOverOutsideNodes = false;
</span><del>-        Node* lastEndNode = 0;
</del><ins>+        Node* lastEndNode = nullptr;
</ins><span class="cx"> 
</span><span class="cx">         for (Node* node = contentElement; node; node = nextNodeInsideContentElement(node, contentElement)) {
</span><span class="cx">             RenderObject* renderer = node-&gt;renderer();
</span><span class="lines">@@ -666,16 +666,17 @@
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="cx">             LayoutRect boundingBox;
</span><del>-            if (renderer-&gt;isRenderInline())
-                boundingBox = toRenderInline(renderer)-&gt;linesBoundingBox();
-            else if (renderer-&gt;isText())
-                boundingBox = toRenderText(renderer)-&gt;linesBoundingBox();
-            else if (renderer-&gt;isLineBreak())
-                boundingBox = toRenderLineBreak(renderer)-&gt;linesBoundingBox();
</del><ins>+            if (is&lt;RenderInline&gt;(*renderer))
+                boundingBox = downcast&lt;RenderInline&gt;(*renderer).linesBoundingBox();
+            else if (is&lt;RenderText&gt;(*renderer))
+                boundingBox = downcast&lt;RenderText&gt;(*renderer).linesBoundingBox();
+            else if (is&lt;RenderLineBreak&gt;(*renderer))
+                boundingBox = downcast&lt;RenderLineBreak&gt;(*renderer).linesBoundingBox();
</ins><span class="cx">             else if (renderer-&gt;isBox()) {
</span><del>-                boundingBox = toRenderBox(renderer)-&gt;frameRect();
-                if (toRenderBox(renderer)-&gt;isRelPositioned())
-                    boundingBox.move(toRenderBox(renderer)-&gt;relativePositionLogicalOffset());
</del><ins>+                RenderBox&amp; renderBox = downcast&lt;RenderBox&gt;(*renderer);
+                boundingBox = renderBox.frameRect();
+                if (renderBox.isRelPositioned())
+                    boundingBox.move(renderBox.relativePositionLogicalOffset());
</ins><span class="cx">             } else
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="lines">@@ -710,11 +711,11 @@
</span><span class="cx"> 
</span><span class="cx">             // start position
</span><span class="cx">             if (logicalTopForRenderer &lt; logicalTopForRegion &amp;&amp; startsAboveRegion) {
</span><del>-                if (renderer-&gt;isText()) {
</del><ins>+                if (is&lt;RenderText&gt;(*renderer)) {
</ins><span class="cx">                     // Text crosses region top
</span><span class="cx">                     // for Text elements, just find the last textbox that is contained inside the region and use its start() offset as start position
</span><del>-                    RenderText* textRenderer = toRenderText(renderer);
-                    for (InlineTextBox* box = textRenderer-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</del><ins>+                    RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
+                    for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box-&gt;nextTextBox()) {
</ins><span class="cx">                         if (offsetTop + box-&gt;logicalBottom() &lt; logicalTopForRegion)
</span><span class="cx">                             continue;
</span><span class="cx">                         range-&gt;setStart(Position(downcast&lt;Text&gt;(node), box-&gt;start()));
</span><span class="lines">@@ -742,11 +743,11 @@
</span><span class="cx">             // end position
</span><span class="cx">             if (logicalBottomForRegion &lt; logicalBottomForRenderer &amp;&amp; (endsBelowRegion || (!endsBelowRegion &amp;&amp; !node-&gt;isDescendantOf(lastEndNode)))) {
</span><span class="cx">                 // for Text elements, just find just find the last textbox that is contained inside the region and use its start()+len() offset as end position
</span><del>-                if (renderer-&gt;isText()) {
</del><ins>+                if (is&lt;RenderText&gt;(*renderer)) {
</ins><span class="cx">                     // Text crosses region bottom
</span><del>-                    RenderText* textRenderer = toRenderText(renderer);
</del><ins>+                    RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*renderer);
</ins><span class="cx">                     InlineTextBox* lastBox = nullptr;
</span><del>-                    for (InlineTextBox* box = textRenderer-&gt;firstTextBox(); box; box = box-&gt;nextTextBox()) {
</del><ins>+                    for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box-&gt;nextTextBox()) {
</ins><span class="cx">                         if ((offsetTop + box-&gt;logicalTop()) &lt; logicalBottomForRegion) {
</span><span class="cx">                             lastBox = box;
</span><span class="cx">                             continue;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyRuncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyRun.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderRubyRun.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -344,9 +344,9 @@
</span><span class="cx">     const RenderStyle&amp; rubyTextStyle = firstLine ? rubyText-&gt;firstLineStyle() : rubyText-&gt;style();
</span><span class="cx">     int halfWidthOfFontSize = rubyTextStyle.fontSize() / 2;
</span><span class="cx">     if (startOverhang)
</span><del>-        startOverhang = std::min&lt;int&gt;(startOverhang, std::min&lt;int&gt;(toRenderText(startRenderer)-&gt;minLogicalWidth(), halfWidthOfFontSize));
</del><ins>+        startOverhang = std::min&lt;int&gt;(startOverhang, std::min&lt;int&gt;(downcast&lt;RenderText&gt;(*startRenderer).minLogicalWidth(), halfWidthOfFontSize));
</ins><span class="cx">     if (endOverhang)
</span><del>-        endOverhang = std::min&lt;int&gt;(endOverhang, std::min&lt;int&gt;(toRenderText(endRenderer)-&gt;minLogicalWidth(), halfWidthOfFontSize));
</del><ins>+        endOverhang = std::min&lt;int&gt;(endOverhang, std::min&lt;int&gt;(downcast&lt;RenderText&gt;(*endRenderer).minLogicalWidth(), halfWidthOfFontSize));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSelectionInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderSelectionInfo.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -46,8 +46,8 @@
</span><span class="cx">     : RenderSelectionInfoBase(renderer)
</span><span class="cx"> {
</span><span class="cx">     if (renderer.canUpdateSelectionOnRootLineBoxes()) {
</span><del>-        if (renderer.isText())
-            m_rect = toRenderText(renderer).collectSelectionRectsForLineBoxes(m_repaintContainer, clipToVisibleContent, m_collectedSelectionRects);
</del><ins>+        if (is&lt;RenderText&gt;(renderer))
+            m_rect = downcast&lt;RenderText&gt;(renderer).collectSelectionRectsForLineBoxes(m_repaintContainer, clipToVisibleContent, m_collectedSelectionRects);
</ins><span class="cx">         else
</span><span class="cx">             m_rect = renderer.selectionRectForRepaint(m_repaintContainer, clipToVisibleContent);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;Range.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="cx"> #include &quot;RenderCombineText.h&quot;
</span><ins>+#include &quot;RenderInline.h&quot;
</ins><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -961,13 +962,13 @@
</span><span class="cx">     setText(text, force || m_linesDirty);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isInlineFlowOrEmptyText(const RenderObject* o)
</del><ins>+static inline bool isInlineFlowOrEmptyText(const RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    if (o-&gt;isRenderInline())
</del><ins>+    if (is&lt;RenderInline&gt;(renderer))
</ins><span class="cx">         return true;
</span><del>-    if (!o-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(renderer))
</ins><span class="cx">         return false;
</span><del>-    StringImpl* text = toRenderText(o)-&gt;text();
</del><ins>+    StringImpl* text = downcast&lt;RenderText&gt;(renderer).text();
</ins><span class="cx">     if (!text)
</span><span class="cx">         return true;
</span><span class="cx">     return !text-&gt;length();
</span><span class="lines">@@ -978,12 +979,13 @@
</span><span class="cx">     // find previous text renderer if one exists
</span><span class="cx">     const RenderObject* previousText = this;
</span><span class="cx">     while ((previousText = previousText-&gt;previousInPreOrder()))
</span><del>-        if (!isInlineFlowOrEmptyText(previousText))
</del><ins>+        if (!isInlineFlowOrEmptyText(*previousText))
</ins><span class="cx">             break;
</span><span class="cx">     UChar prev = ' ';
</span><del>-    if (previousText &amp;&amp; previousText-&gt;isText())
-        if (StringImpl* previousString = toRenderText(previousText)-&gt;text())
</del><ins>+    if (is&lt;RenderText&gt;(previousText)) {
+        if (StringImpl* previousString = downcast&lt;RenderText&gt;(*previousText).text())
</ins><span class="cx">             prev = (*previousString)[previousString-&gt;length() - 1];
</span><ins>+    }
</ins><span class="cx">     return prev;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderText.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -223,8 +223,6 @@
</span><span class="cx">     RenderTextLineBoxes m_lineBoxes;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderText, isText())
-
</del><span class="cx"> inline UChar RenderText::uncheckedCharacterAt(unsigned i) const
</span><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(i &lt; textLength());
</span><span class="lines">@@ -254,7 +252,7 @@
</span><span class="cx">     
</span><span class="cx"> inline RenderText* Text::renderer() const
</span><span class="cx"> {
</span><del>-    return toRenderText(Node::renderer());
</del><ins>+    return downcast&lt;RenderText&gt;(Node::renderer());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextFragmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextFragment.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextFragment.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderTextFragment.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -72,10 +72,11 @@
</span><span class="cx">     RenderBoxModelObject* m_firstLetter;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTextFragment, isText() &amp;&amp; toRenderText(renderer).isTextFragment())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTextFragment, isText() &amp;&amp; toRenderText(renderer).isTextFragment())
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderTextFragment)
+    static bool isType(const WebCore::RenderText&amp; renderer) { return renderer.isTextFragment(); }
+    static bool isType(const WebCore::RenderObject&amp; renderer) { return is&lt;WebCore::RenderText&gt;(renderer) &amp;&amp; isType(downcast&lt;WebCore::RenderText&gt;(renderer)); }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx"> 
</span><span class="cx"> #endif // RenderTextFragment_h
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -197,32 +197,32 @@
</span><span class="cx">     bool adjustForTableCells = cb ? cb-&gt;isTableCell() : false;
</span><span class="cx"> 
</span><span class="cx">     LayoutRect r;
</span><del>-    if (o.isText()) {
</del><ins>+    if (is&lt;RenderText&gt;(o)) {
</ins><span class="cx">         // FIXME: Would be better to dump the bounding box x and y rather than the first run's x and y, but that would involve updating
</span><span class="cx">         // many test results.
</span><del>-        const RenderText&amp; text = toRenderText(o);
</del><ins>+        const RenderText&amp; text = downcast&lt;RenderText&gt;(o);
</ins><span class="cx">         r = IntRect(text.firstRunLocation(), text.linesBoundingBox().size());
</span><span class="cx">         if (!text.firstTextBox() &amp;&amp; !text.simpleLineLayout())
</span><span class="cx">             adjustForTableCells = false;
</span><span class="cx">     } else if (o.isBR()) {
</span><del>-        const RenderLineBreak&amp; br = toRenderLineBreak(o);
</del><ins>+        const RenderLineBreak&amp; br = downcast&lt;RenderLineBreak&gt;(o);
</ins><span class="cx">         IntRect linesBox = br.linesBoundingBox();
</span><span class="cx">         r = IntRect(linesBox.x(), linesBox.y(), linesBox.width(), linesBox.height());
</span><span class="cx">         if (!br.inlineBoxWrapper())
</span><span class="cx">             adjustForTableCells = false;
</span><del>-    } else if (o.isRenderInline()) {
-        const RenderInline&amp; inlineFlow = toRenderInline(o);
</del><ins>+    } else if (is&lt;RenderInline&gt;(o)) {
+        const RenderInline&amp; inlineFlow = downcast&lt;RenderInline&gt;(o);
</ins><span class="cx">         // FIXME: Would be better not to just dump 0, 0 as the x and y here.
</span><span class="cx">         r = IntRect(0, 0, inlineFlow.linesBoundingBox().width(), inlineFlow.linesBoundingBox().height());
</span><span class="cx">         adjustForTableCells = false;
</span><del>-    } else if (o.isTableCell()) {
</del><ins>+    } else if (is&lt;RenderTableCell&gt;(o)) {
</ins><span class="cx">         // FIXME: Deliberately dump the &quot;inner&quot; box of table cells, since that is what current results reflect.  We'd like
</span><span class="cx">         // to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are
</span><span class="cx">         // captured by the results.
</span><del>-        const RenderTableCell&amp; cell = *toRenderTableCell(&amp;o);
</del><ins>+        const RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(o);
</ins><span class="cx">         r = LayoutRect(cell.x(), cell.y() + cell.intrinsicPaddingBefore(), cell.width(), cell.height() - cell.intrinsicPaddingBefore() - cell.intrinsicPaddingAfter());
</span><del>-    } else if (o.isBox())
-        r = toRenderBox(o).frameRect();
</del><ins>+    } else if (is&lt;RenderBox&gt;(o))
+        r = downcast&lt;RenderBox&gt;(o).frameRect();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Temporary in order to ensure compatibility with existing layout test results.
</span><span class="cx">     if (adjustForTableCells)
</span><span class="lines">@@ -261,10 +261,10 @@
</span><span class="cx">                 ts &lt;&lt; &quot; [textStrokeWidth=&quot; &lt;&lt; o.style().textStrokeWidth() &lt;&lt; &quot;]&quot;;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!o.isBoxModelObject() || o.isLineBreak())
</del><ins>+        if (!is&lt;RenderBoxModelObject&gt;(o) || is&lt;RenderLineBreak&gt;(o))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        const RenderBoxModelObject&amp; box = toRenderBoxModelObject(o);
</del><ins>+        const RenderBoxModelObject&amp; box = downcast&lt;RenderBoxModelObject&gt;(o);
</ins><span class="cx">         if (box.borderTop() || box.borderRight() || box.borderBottom() || box.borderLeft()) {
</span><span class="cx">             ts &lt;&lt; &quot; [border:&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -343,15 +343,15 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (o.isTableCell()) {
-        const RenderTableCell&amp; c = *toRenderTableCell(&amp;o);
</del><ins>+    if (is&lt;RenderTableCell&gt;(o)) {
+        const RenderTableCell&amp; c = downcast&lt;RenderTableCell&gt;(o);
</ins><span class="cx">         ts &lt;&lt; &quot; [r=&quot; &lt;&lt; c.rowIndex() &lt;&lt; &quot; c=&quot; &lt;&lt; c.col() &lt;&lt; &quot; rs=&quot; &lt;&lt; c.rowSpan() &lt;&lt; &quot; cs=&quot; &lt;&lt; c.colSpan() &lt;&lt; &quot;]&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DETAILS_ELEMENT)
</span><del>-    if (o.isDetailsMarker()) {
</del><ins>+    if (is&lt;RenderDetailsMarker&gt;(o)) {
</ins><span class="cx">         ts &lt;&lt; &quot;: &quot;;
</span><del>-        switch (toRenderDetailsMarker(o).orientation()) {
</del><ins>+        switch (downcast&lt;RenderDetailsMarker&gt;(o).orientation()) {
</ins><span class="cx">         case RenderDetailsMarker::Left:
</span><span class="cx">             ts &lt;&lt; &quot;left&quot;;
</span><span class="cx">             break;
</span><span class="lines">@@ -368,8 +368,8 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (o.isListMarker()) {
-        String text = toRenderListMarker(o).text();
</del><ins>+    if (is&lt;RenderListMarker&gt;(o)) {
+        String text = downcast&lt;RenderListMarker&gt;(o).text();
</ins><span class="cx">         if (!text.isEmpty()) {
</span><span class="cx">             if (text.length() != 1)
</span><span class="cx">                 text = quoteAndEscapeNonPrintables(text);
</span><span class="lines">@@ -444,8 +444,8 @@
</span><span class="cx">             ts &lt;&lt; &quot;)&quot;;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (behavior &amp; RenderAsTextShowOverflow &amp;&amp; o.isBox()) {
-        const RenderBox&amp; box = toRenderBox(o);
</del><ins>+    if (behavior &amp; RenderAsTextShowOverflow &amp;&amp; is&lt;RenderBox&gt;(o)) {
+        const RenderBox&amp; box = downcast&lt;RenderBox&gt;(o);
</ins><span class="cx">         if (box.hasRenderOverflow()) {
</span><span class="cx">             LayoutRect layoutOverflow = box.layoutOverflowRect();
</span><span class="cx">             ts &lt;&lt; &quot; (layout overflow &quot; &lt;&lt; layoutOverflow.x().toInt() &lt;&lt; &quot;,&quot; &lt;&lt; layoutOverflow.y().toInt() &lt;&lt; &quot; &quot; &lt;&lt; layoutOverflow.width().toInt() &lt;&lt; &quot;x&quot; &lt;&lt; layoutOverflow.height().toInt() &lt;&lt; &quot;)&quot;;
</span><span class="lines">@@ -500,36 +500,36 @@
</span><span class="cx"> 
</span><span class="cx"> void write(TextStream&amp; ts, const RenderObject&amp; o, int indent, RenderAsTextBehavior behavior)
</span><span class="cx"> {
</span><del>-    if (o.isSVGShape()) {
-        write(ts, *toRenderSVGShape(&amp;o), indent);
</del><ins>+    if (is&lt;RenderSVGShape&gt;(o)) {
+        write(ts, downcast&lt;RenderSVGShape&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGGradientStop()) {
-        writeSVGGradientStop(ts, *toRenderSVGGradientStop(&amp;o), indent);
</del><ins>+    if (is&lt;RenderSVGGradientStop&gt;(o)) {
+        writeSVGGradientStop(ts, downcast&lt;RenderSVGGradientStop&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGResourceContainer()) {
-        writeSVGResourceContainer(ts, toRenderSVGResourceContainer(o), indent);
</del><ins>+    if (is&lt;RenderSVGResourceContainer&gt;(o)) {
+        writeSVGResourceContainer(ts, downcast&lt;RenderSVGResourceContainer&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGContainer()) {
-        writeSVGContainer(ts, toRenderSVGContainer(o), indent);
</del><ins>+    if (is&lt;RenderSVGContainer&gt;(o)) {
+        writeSVGContainer(ts, downcast&lt;RenderSVGContainer&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGRoot()) {
-        write(ts, *toRenderSVGRoot(&amp;o), indent);
</del><ins>+    if (is&lt;RenderSVGRoot&gt;(o)) {
+        write(ts, downcast&lt;RenderSVGRoot&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGText()) {
-        writeSVGText(ts, *toRenderSVGText(&amp;o), indent);
</del><ins>+    if (is&lt;RenderSVGText&gt;(o)) {
+        writeSVGText(ts, downcast&lt;RenderSVGText&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGInlineText()) {
-        writeSVGInlineText(ts, toRenderSVGInlineText(o), indent);
</del><ins>+    if (is&lt;RenderSVGInlineText&gt;(o)) {
+        writeSVGInlineText(ts, downcast&lt;RenderSVGInlineText&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (o.isSVGImage()) {
-        writeSVGImage(ts, *toRenderSVGImage(&amp;o), indent);
</del><ins>+    if (is&lt;RenderSVGImage&gt;(o)) {
+        writeSVGImage(ts, downcast&lt;RenderSVGImage&gt;(o), indent);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -538,8 +538,8 @@
</span><span class="cx">     RenderTreeAsText::writeRenderObject(ts, o, behavior);
</span><span class="cx">     ts &lt;&lt; &quot;\n&quot;;
</span><span class="cx"> 
</span><del>-    if (o.isText()) {
-        auto&amp; text = toRenderText(o);
</del><ins>+    if (is&lt;RenderText&gt;(o)) {
+        auto&amp; text = downcast&lt;RenderText&gt;(o);
</ins><span class="cx">         if (auto layout = text.simpleLineLayout()) {
</span><span class="cx">             ASSERT(!text.firstTextBox());
</span><span class="cx">             auto resolver = runResolver(toRenderBlockFlow(*text.parent()), *layout);
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">     } else {
</span><del>-        for (RenderObject* child = toRenderElement(o).firstChild(); child; child = child-&gt;nextSibling()) {
</del><ins>+        for (RenderObject* child = downcast&lt;RenderElement&gt;(o).firstChild(); child; child = child-&gt;nextSibling()) {
</ins><span class="cx">             if (child-&gt;hasLayer())
</span><span class="cx">                 continue;
</span><span class="cx">             write(ts, *child, indent + 1, behavior);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">     // The &lt;blockflow&gt;&lt;inline&gt;#text&lt;/inline&gt;&lt;/blockflow&gt; case is also popular and should be relatively easy to cover.
</span><span class="cx">     if (flow.firstChild() != flow.lastChild())
</span><span class="cx">         return false;
</span><del>-    if (!flow.firstChild()-&gt;isText())
</del><ins>+    if (!is&lt;RenderText&gt;(flow.firstChild()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (!flow.isHorizontalWritingMode())
</span><span class="cx">         return false;
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (style.borderFit() == BorderFitLines)
</span><span class="cx">         return false;
</span><del>-    const RenderText&amp; textRenderer = toRenderText(*flow.firstChild());
</del><ins>+    const RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*flow.firstChild());
</ins><span class="cx">     if (flow.containsFloats()) {
</span><span class="cx">         // We can't use the code path if any lines would need to be shifted below floats. This is because we don't keep per-line y coordinates.
</span><span class="cx">         float minimumWidthNeeded = textRenderer.minLogicalWidth();
</span><span class="lines">@@ -441,7 +441,7 @@
</span><span class="cx">     Layout::RunVector runs;
</span><span class="cx">     unsigned lineCount = 0;
</span><span class="cx"> 
</span><del>-    RenderText&amp; textRenderer = toRenderText(*flow.firstChild());
</del><ins>+    RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*flow.firstChild());
</ins><span class="cx">     ASSERT(!textRenderer.firstTextBox());
</span><span class="cx"> 
</span><span class="cx">     if (textRenderer.is8Bit())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     if (style.visibility() != VISIBLE)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderText&amp; textRenderer = toRenderText(*flow.firstChild());
</del><ins>+    RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*flow.firstChild());
</ins><span class="cx">     ASSERT(!textRenderer.firstTextBox());
</span><span class="cx"> 
</span><span class="cx">     bool debugBordersEnabled = flow.frame().settings().simpleLineLayoutDebugBordersEnabled();
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     if (style.visibility() != VISIBLE || style.pointerEvents() == PE_NONE)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    RenderText&amp; textRenderer = toRenderText(*flow.firstChild());
</del><ins>+    RenderText&amp; textRenderer = downcast&lt;RenderText&gt;(*flow.firstChild());
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect rangeRect = locationInContainer.boundingBox();
</span><span class="cx">     rangeRect.moveBy(-accumulatedOffset);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline RunResolver::RunResolver(const RenderBlockFlow&amp; flow, const Layout&amp; layout)
</span><span class="cx">     : m_layout(layout)
</span><del>-    , m_string(toRenderText(*flow.firstChild()).text())
</del><ins>+    , m_string(downcast&lt;RenderText&gt;(*flow.firstChild()).text())
</ins><span class="cx">     , m_lineHeight(lineHeightFromFlow(flow))
</span><span class="cx">     , m_baseline(baselineFromFlow(flow))
</span><span class="cx">     , m_borderAndPaddingBefore(flow.borderAndPaddingBefore())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutoSizingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutoSizing.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -100,8 +100,7 @@
</span><span class="cx"> void TextAutoSizingValue::addNode(Node* node, float size)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(node);
</span><del>-    RenderText* renderText = toRenderText(node-&gt;renderer());
-    renderText-&gt;setCandidateComputedTextSize(size);
</del><ins>+    downcast&lt;RenderText&gt;(*node-&gt;renderer()).setCandidateComputedTextSize(size);
</ins><span class="cx">     m_autoSizedNodes.add(node);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutosizercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutosizer.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx"> 
</span><span class="cx">     while (renderer) {
</span><span class="cx">         if (!isAutosizingContainer(renderer)) {
</span><del>-            if (renderer-&gt;isText() &amp;&amp; toRenderText(renderer)-&gt;text()-&gt;stripWhiteSpace()-&gt;length() &gt; 3)
</del><ins>+            if (is&lt;RenderText&gt;(*renderer) &amp;&amp; downcast&lt;RenderText&gt;(*renderer).text()-&gt;stripWhiteSpace()-&gt;length() &gt; 3)
</ins><span class="cx">                 return false;
</span><span class="cx">             if (!renderer-&gt;isInline())
</span><span class="cx">                 return false;
</span><span class="lines">@@ -493,9 +493,9 @@
</span><span class="cx"> 
</span><span class="cx">     RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(container, container);
</span><span class="cx">     while (descendant) {
</span><del>-        if (!skipLocalText &amp;&amp; descendant-&gt;isText()) {
-            textWidth += toRenderText(descendant)-&gt;renderedTextLength() * descendant-&gt;style()-&gt;specifiedFontSize();
-        } else if (isAutosizingContainer(descendant)) {
</del><ins>+        if (!skipLocalText &amp;&amp; is&lt;RenderText&gt;(*descendant))
+            textWidth += downcast&lt;RenderText&gt;(*descendant).renderedTextLength() * descendant-&gt;style()-&gt;specifiedFontSize();
+        else if (isAutosizingContainer(descendant)) {
</ins><span class="cx">             RenderBlock* descendantBlock = toRenderBlock(descendant);
</span><span class="cx">             if (!isAutosizingCluster(descendantBlock, clusterInfo))
</span><span class="cx">                 measureDescendantTextWidth(descendantBlock, clusterInfo, minTextWidth, textWidth);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -125,10 +125,10 @@
</span><span class="cx">             m_lineBreak.clear();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void commitLineBreakAtCurrentWidth(RenderObject* object, unsigned offset = 0, int nextBreak = -1)
</del><ins>+    void commitLineBreakAtCurrentWidth(RenderObject&amp; object, unsigned offset = 0, int nextBreak = -1)
</ins><span class="cx">     {
</span><span class="cx">         m_width.commit();
</span><del>-        m_lineBreak.moveTo(object, offset, nextBreak);
</del><ins>+        m_lineBreak.moveTo(&amp;object, offset, nextBreak);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx"> inline bool shouldAddBorderPaddingMargin(RenderObject* child)
</span><span class="cx"> {
</span><span class="cx">     // When deciding whether we're at the edge of an inline, adjacent collapsed whitespace is the same as no sibling at all.
</span><del>-    return !child || (child-&gt;isText() &amp;&amp; !toRenderText(child)-&gt;textLength());
</del><ins>+    return !child || (is&lt;RenderText&gt;(*child) &amp;&amp; !downcast&lt;RenderText&gt;(*child).textLength());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderObject* previousInFlowSibling(RenderObject* child)
</span><span class="lines">@@ -359,11 +359,11 @@
</span><span class="cx">     while (next &amp;&amp; next-&gt;isFloatingOrOutOfFlowPositioned())
</span><span class="cx">         next = bidiNextSkippingEmptyInlines(block, next);
</span><span class="cx"> 
</span><del>-    if (next &amp;&amp; next-&gt;isText() &amp;&amp; toRenderText(next)-&gt;textLength() &gt; 0) {
-        RenderText* nextText = toRenderText(next);
-        UChar nextChar = nextText-&gt;characterAt(0);
-        if (nextText-&gt;style().isCollapsibleWhiteSpace(nextChar)) {
-            lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0));
</del><ins>+    if (is&lt;RenderText&gt;(next) &amp;&amp; downcast&lt;RenderText&gt;(*next).textLength() &gt; 0) {
+        RenderText&amp; nextText = downcast&lt;RenderText&gt;(*next);
+        UChar nextChar = nextText.characterAt(0);
+        if (nextText.style().isCollapsibleWhiteSpace(nextChar)) {
+            lineMidpointState.startIgnoringSpaces(InlineIterator(nullptr, o, 0));
</ins><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -585,16 +585,16 @@
</span><span class="cx">     if (!m_current.offset())
</span><span class="cx">         m_appliedStartWidth = false;
</span><span class="cx"> 
</span><del>-    RenderText* renderText = toRenderText(m_current.renderer());
</del><ins>+    RenderText&amp; renderText = downcast&lt;RenderText&gt;(*m_current.renderer());
</ins><span class="cx"> 
</span><del>-    bool isSVGText = renderText-&gt;isSVGInlineText();
</del><ins>+    bool isSVGText = renderText.isSVGInlineText();
</ins><span class="cx"> 
</span><span class="cx">     // If we have left a no-wrap inline and entered an autowrap inline while ignoring spaces
</span><span class="cx">     // then we need to mark the start of the autowrap inline as a potential linebreak now.
</span><span class="cx">     if (m_autoWrap &amp;&amp; !RenderStyle::autoWrap(m_lastWS) &amp;&amp; m_ignoringSpaces)
</span><del>-        commitLineBreakAtCurrentWidth(m_current.renderer());
</del><ins>+        commitLineBreakAtCurrentWidth(renderText);
</ins><span class="cx"> 
</span><del>-    if (renderText-&gt;style().hasTextCombine() &amp;&amp; m_current.renderer()-&gt;isCombineText() &amp;&amp; !toRenderCombineText(*m_current.renderer()).isCombined()) {
</del><ins>+    if (renderText.style().hasTextCombine() &amp;&amp; m_current.renderer()-&gt;isCombineText() &amp;&amp; !toRenderCombineText(*m_current.renderer()).isCombined()) {
</ins><span class="cx">         RenderCombineText&amp; combineRenderer = toRenderCombineText(*m_current.renderer());
</span><span class="cx">         combineRenderer.combineText();
</span><span class="cx">         // The length of the renderer's text may have changed. Increment stale iterator positions
</span><span class="lines">@@ -605,7 +605,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const RenderStyle&amp; style = lineStyle(*renderText-&gt;parent(), m_lineInfo);
</del><ins>+    const RenderStyle&amp; style = lineStyle(*renderText.parent(), m_lineInfo);
</ins><span class="cx">     const Font&amp; font = style.font();
</span><span class="cx">     bool isFixedPitch = font.isFixedPitch();
</span><span class="cx">     bool canHyphenate = style.hyphens() == HyphensAuto &amp;&amp; WebCore::canHyphenate(style.locale());
</span><span class="lines">@@ -630,15 +630,15 @@
</span><span class="cx">         breakAll = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_renderTextInfo.m_text != renderText) {
-        updateCounterIfNeeded(*renderText);
-        m_renderTextInfo.m_text = renderText;
</del><ins>+    if (m_renderTextInfo.m_text != &amp;renderText) {
+        updateCounterIfNeeded(renderText);
+        m_renderTextInfo.m_text = &amp;renderText;
</ins><span class="cx">         m_renderTextInfo.m_font = &amp;font;
</span><del>-        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
-        m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(renderText-&gt;text(), style.locale());
</del><ins>+        m_renderTextInfo.m_layout = font.createLayout(&amp;renderText, m_width.currentWidth(), m_collapseWhiteSpace);
+        m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(renderText.text(), style.locale());
</ins><span class="cx">     } else if (m_renderTextInfo.m_layout &amp;&amp; m_renderTextInfo.m_font != &amp;font) {
</span><span class="cx">         m_renderTextInfo.m_font = &amp;font;
</span><del>-        m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
</del><ins>+        m_renderTextInfo.m_layout = font.createLayout(&amp;renderText, m_width.currentWidth(), m_collapseWhiteSpace);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     TextLayout* textLayout = m_renderTextInfo.m_layout.get();
</span><span class="lines">@@ -646,11 +646,11 @@
</span><span class="cx">     // Non-zero only when kerning is enabled and TextLayout isn't used, in which case we measure
</span><span class="cx">     // words with their trailing space, then subtract its width.
</span><span class="cx">     HashSet&lt;const SimpleFontData*&gt; fallbackFonts;
</span><del>-    float wordTrailingSpaceWidth = (font.typesettingFeatures() &amp; Kerning) &amp;&amp; !textLayout ? font.width(RenderBlock::constructTextRun(renderText, font, &amp;space, 1, style), &amp;fallbackFonts) + wordSpacing : 0;
</del><ins>+    float wordTrailingSpaceWidth = (font.typesettingFeatures() &amp; Kerning) &amp;&amp; !textLayout ? font.width(RenderBlock::constructTextRun(&amp;renderText, font, &amp;space, 1, style), &amp;fallbackFonts) + wordSpacing : 0;
</ins><span class="cx"> 
</span><span class="cx">     UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter();
</span><span class="cx">     UChar secondToLastCharacter = m_renderTextInfo.m_lineBreakIterator.secondToLastCharacter();
</span><del>-    for (; m_current.offset() &lt; renderText-&gt;textLength(); m_current.fastIncrementInTextNode()) {
</del><ins>+    for (; m_current.offset() &lt; renderText.textLength(); m_current.fastIncrementInTextNode()) {
</ins><span class="cx">         bool previousCharacterIsSpace = m_currentCharacterIsSpace;
</span><span class="cx">         bool previousCharacterIsWS = m_currentCharacterIsWS;
</span><span class="cx">         UChar c = m_current.current();
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx">             m_lineInfo.setEmpty(false, &amp;m_block, &amp;m_width);
</span><span class="cx"> 
</span><span class="cx">         if (c == softHyphen &amp;&amp; m_autoWrap &amp;&amp; !hyphenWidth &amp;&amp; style.hyphens() != HyphensNone) {
</span><del>-            hyphenWidth = measureHyphenWidth(renderText, font, &amp;fallbackFonts);
</del><ins>+            hyphenWidth = measureHyphenWidth(&amp;renderText, font, &amp;fallbackFonts);
</ins><span class="cx">             m_width.addUncommittedWidth(hyphenWidth);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -670,8 +670,8 @@
</span><span class="cx"> 
</span><span class="cx">         if ((breakAll || breakWords) &amp;&amp; !midWordBreak &amp;&amp; (!m_currentCharacterIsSpace || style.whiteSpace() != PRE_WRAP)) {
</span><span class="cx">             wrapW += charWidth;
</span><del>-            bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) &amp;&amp; m_current.offset() + 1 &lt; renderText-&gt;textLength() &amp;&amp; U16_IS_TRAIL((*renderText)[m_current.offset() + 1]);
-            charWidth = textWidth(renderText, m_current.offset(), midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + wrapW, isFixedPitch, m_collapseWhiteSpace, fallbackFonts, textLayout);
</del><ins>+            bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) &amp;&amp; m_current.offset() + 1 &lt; renderText.textLength() &amp;&amp; U16_IS_TRAIL(renderText[m_current.offset() + 1]);
+            charWidth = textWidth(&amp;renderText, m_current.offset(), midWordBreakIsBeforeSurrogatePair ? 2 : 1, font, m_width.committedWidth() + wrapW, isFixedPitch, m_collapseWhiteSpace, fallbackFonts, textLayout);
</ins><span class="cx">             midWordBreak = m_width.committedWidth() + wrapW + charWidth &gt; m_width.availableWidth();
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -702,15 +702,15 @@
</span><span class="cx">             wordMeasurements.grow(wordMeasurements.size() + 1);
</span><span class="cx">             WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
</span><span class="cx"> 
</span><del>-            wordMeasurement.renderer = renderText;
</del><ins>+            wordMeasurement.renderer = &amp;renderText;
</ins><span class="cx">             wordMeasurement.endOffset = m_current.offset();
</span><span class="cx">             wordMeasurement.startOffset = lastSpace;
</span><span class="cx"> 
</span><span class="cx">             float additionalTempWidth;
</span><span class="cx">             if (wordTrailingSpaceWidth &amp;&amp; c == ' ')
</span><del>-                additionalTempWidth = textWidth(renderText, lastSpace, m_current.offset() + 1 - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth;
</del><ins>+                additionalTempWidth = textWidth(&amp;renderText, lastSpace, m_current.offset() + 1 - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) - wordTrailingSpaceWidth;
</ins><span class="cx">             else
</span><del>-                additionalTempWidth = textWidth(renderText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
</del><ins>+                additionalTempWidth = textWidth(&amp;renderText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
</ins><span class="cx"> 
</span><span class="cx">             if (wordMeasurement.fallbackFonts.isEmpty() &amp;&amp; !fallbackFonts.isEmpty())
</span><span class="cx">                 wordMeasurement.fallbackFonts.swap(fallbackFonts);
</span><span class="lines">@@ -738,7 +738,7 @@
</span><span class="cx">                 // as candidate width for this line.
</span><span class="cx">                 bool lineWasTooWide = false;
</span><span class="cx">                 if (m_width.fitsOnLine() &amp;&amp; m_currentCharacterIsWS &amp;&amp; m_currentStyle-&gt;breakOnlyAfterWhiteSpace() &amp;&amp; !midWordBreak) {
</span><del>-                    float charWidth = textWidth(renderText, m_current.offset(), 1, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) + (applyWordSpacing ? wordSpacing : 0);
</del><ins>+                    float charWidth = textWidth(&amp;renderText, m_current.offset(), 1, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) + (applyWordSpacing ? wordSpacing : 0);
</ins><span class="cx">                     // Check if line is too big even without the extra space
</span><span class="cx">                     // at the end of the line. If it is not, do nothing.
</span><span class="cx">                     // If the line needs the extra whitespace to be too long,
</span><span class="lines">@@ -752,7 +752,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 if (lineWasTooWide || !m_width.fitsOnLine()) {
</span><span class="cx">                     if (canHyphenate &amp;&amp; !m_width.fitsOnLine()) {
</span><del>-                        tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.offset(), m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.nextBreakablePosition(), m_lineBreaker.m_hyphenated);
</del><ins>+                        tryHyphenating(&amp;renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.offset(), m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.nextBreakablePosition(), m_lineBreaker.m_hyphenated);
</ins><span class="cx">                         if (m_lineBreaker.m_hyphenated) {
</span><span class="cx">                             m_atEnd = true;
</span><span class="cx">                             return false;
</span><span class="lines">@@ -765,7 +765,7 @@
</span><span class="cx">                         m_lineInfo.setPreviousLineBrokeCleanly(true);
</span><span class="cx">                         wordMeasurement.endOffset = m_lineBreak.offset();
</span><span class="cx">                     }
</span><del>-                    if (m_lineBreak.renderer() &amp;&amp; m_lineBreak.offset() &amp;&amp; m_lineBreak.renderer()-&gt;isText() &amp;&amp; toRenderText(m_lineBreak.renderer())-&gt;textLength() &amp;&amp; toRenderText(m_lineBreak.renderer())-&gt;characterAt(m_lineBreak.offset() - 1) == softHyphen &amp;&amp; style.hyphens() != HyphensNone)
</del><ins>+                    if (m_lineBreak.offset() &amp;&amp; downcast&lt;RenderText&gt;(m_lineBreak.renderer()) &amp;&amp; downcast&lt;RenderText&gt;(*m_lineBreak.renderer()).textLength() &amp;&amp; downcast&lt;RenderText&gt;(*m_lineBreak.renderer()).characterAt(m_lineBreak.offset() - 1) == softHyphen &amp;&amp; style.hyphens() != HyphensNone)
</ins><span class="cx">                         hyphenated = true;
</span><span class="cx">                     if (m_lineBreak.offset() &amp;&amp; m_lineBreak.offset() != (unsigned)wordMeasurement.endOffset &amp;&amp; !wordMeasurement.width) {
</span><span class="cx">                         if (charWidth) {
</span><span class="lines">@@ -846,7 +846,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (isSVGText &amp;&amp; m_current.offset()) {
</span><span class="cx">             // Force creation of new InlineBoxes for each absolute positioned character (those that start new text chunks).
</span><del>-            if (toRenderSVGInlineText(renderText)-&gt;characterStartsNewTextChunk(m_current.offset()))
</del><ins>+            if (downcast&lt;RenderSVGInlineText&gt;(renderText).characterStartsNewTextChunk(m_current.offset()))
</ins><span class="cx">                 ensureCharacterGetsLineBox(m_lineMidpointState, m_current);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -859,7 +859,7 @@
</span><span class="cx">             if (m_nextObject &amp;&amp; m_startOfIgnoredSpaces.offset() &amp;&amp; m_nextObject-&gt;isBR() &amp;&amp; (m_blockStyle.textAlign() == RIGHT || m_blockStyle.textAlign() == WEBKIT_RIGHT)) {
</span><span class="cx">                 m_startOfIgnoredSpaces.setOffset(m_startOfIgnoredSpaces.offset() - 1);
</span><span class="cx">                 // If there's just a single trailing space start ignoring it now so it collapses away.
</span><del>-                if (m_current.offset() == renderText-&gt;textLength() - 1)
</del><ins>+                if (m_current.offset() == renderText.textLength() - 1)
</ins><span class="cx">                     m_lineMidpointState.startIgnoringSpaces(m_startOfIgnoredSpaces);
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -870,7 +870,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (m_collapseWhiteSpace &amp;&amp; m_currentCharacterIsSpace &amp;&amp; !m_ignoringSpaces)
</span><del>-            m_trailingObjects.setTrailingWhitespace(toRenderText(m_current.renderer()));
</del><ins>+            m_trailingObjects.setTrailingWhitespace(downcast&lt;RenderText&gt;(m_current.renderer()));
</ins><span class="cx">         else if (!m_currentStyle-&gt;collapseWhiteSpace() || !m_currentCharacterIsSpace)
</span><span class="cx">             m_trailingObjects.clear();
</span><span class="cx"> 
</span><span class="lines">@@ -882,10 +882,10 @@
</span><span class="cx"> 
</span><span class="cx">     wordMeasurements.grow(wordMeasurements.size() + 1);
</span><span class="cx">     WordMeasurement&amp; wordMeasurement = wordMeasurements.last();
</span><del>-    wordMeasurement.renderer = renderText;
</del><ins>+    wordMeasurement.renderer = &amp;renderText;
</ins><span class="cx"> 
</span><span class="cx">     // IMPORTANT: current.m_pos is &gt; length here!
</span><del>-    float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(renderText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
</del><ins>+    float additionalTempWidth = m_ignoringSpaces ? 0 : textWidth(&amp;renderText, lastSpace, m_current.offset() - lastSpace, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout);
</ins><span class="cx">     wordMeasurement.startOffset = lastSpace;
</span><span class="cx">     wordMeasurement.endOffset = m_current.offset();
</span><span class="cx">     wordMeasurement.width = m_ignoringSpaces ? 0 : additionalTempWidth + wordSpacingForWordMeasurement;
</span><span class="lines">@@ -905,7 +905,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_width.fitsOnLine()) {
</span><span class="cx">         if (canHyphenate)
</span><del>-            tryHyphenating(renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.offset(), m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.nextBreakablePosition(), m_lineBreaker.m_hyphenated);
</del><ins>+            tryHyphenating(&amp;renderText, font, style.locale(), consecutiveHyphenatedLines, m_blockStyle.hyphenationLimitLines(), style.hyphenationLimitBefore(), style.hyphenationLimitAfter(), lastSpace, m_current.offset(), m_width.currentWidth() - additionalTempWidth, m_width.availableWidth(), isFixedPitch, m_collapseWhiteSpace, lastSpaceWordSpacing, m_lineBreak, m_current.nextBreakablePosition(), m_lineBreaker.m_hyphenated);
</ins><span class="cx"> 
</span><span class="cx">         if (!hyphenated &amp;&amp; m_lineBreak.previousInSameNode() == softHyphen &amp;&amp; style.hyphens() != HyphensNone) {
</span><span class="cx">             hyphenated = true;
</span><span class="lines">@@ -915,14 +915,10 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline bool textBeginsWithBreakablePosition(RenderObject* next)
</del><ins>+inline bool textBeginsWithBreakablePosition(RenderText&amp; nextText)
</ins><span class="cx"> {
</span><del>-    ASSERT(next-&gt;isText());
-    RenderText* nextText = toRenderText(next);
-    if (!nextText-&gt;textLength())
-        return false;
-    UChar c = nextText-&gt;characterAt(0);
-    return c == ' ' || c == '\t' || (c == '\n' &amp;&amp; !nextText-&gt;preservesNewline());
</del><ins>+    UChar c = nextText.characterAt(0);
+    return c == ' ' || c == '\t' || (c == '\n' &amp;&amp; !nextText.preservesNewline());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline bool BreakingContext::canBreakAtThisPosition()
</span><span class="lines">@@ -932,11 +928,11 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     // Avoid breaking on empty inlines.
</span><del>-    if (m_current.renderer()-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_current.renderer())))
</del><ins>+    if (is&lt;RenderInline&gt;(*m_current.renderer()) &amp;&amp; isEmptyInline(downcast&lt;RenderInline&gt;(*m_current.renderer())))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Avoid breaking before empty inlines.
</span><del>-    if (m_nextObject &amp;&amp; m_nextObject-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_nextObject)))
</del><ins>+    if (is&lt;RenderInline&gt;(m_nextObject) &amp;&amp; isEmptyInline(downcast&lt;RenderInline&gt;(*m_nextObject)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Return early if we autowrap and the current character is a space as we will always want to break at such a position.
</span><span class="lines">@@ -946,14 +942,15 @@
</span><span class="cx">     if (m_nextObject &amp;&amp; m_nextObject-&gt;isLineBreakOpportunity())
</span><span class="cx">         return m_autoWrap;
</span><span class="cx"> 
</span><del>-    bool nextIsAutoWrappingText = (m_nextObject &amp;&amp; m_nextObject-&gt;isText() &amp;&amp; (m_autoWrap || m_nextObject-&gt;style().autoWrap()));
</del><ins>+    bool nextIsAutoWrappingText = is&lt;RenderText&gt;(m_nextObject) &amp;&amp; (m_autoWrap || m_nextObject-&gt;style().autoWrap());
</ins><span class="cx">     if (!nextIsAutoWrappingText)
</span><span class="cx">         return m_autoWrap;
</span><del>-    bool currentIsTextOrEmptyInline = m_current.renderer()-&gt;isText() || (m_current.renderer()-&gt;isRenderInline() &amp;&amp; isEmptyInline(toRenderInline(*m_current.renderer())));
</del><ins>+    RenderText&amp; nextRenderText = downcast&lt;RenderText&gt;(*m_nextObject);
+    bool currentIsTextOrEmptyInline = is&lt;RenderText&gt;(*m_current.renderer()) || (is&lt;RenderInline&gt;(*m_current.renderer()) &amp;&amp; isEmptyInline(downcast&lt;RenderInline&gt;(*m_current.renderer())));
</ins><span class="cx">     if (!currentIsTextOrEmptyInline)
</span><span class="cx">         return m_autoWrap;
</span><span class="cx"> 
</span><del>-    bool canBreakHere = !m_currentCharacterIsSpace &amp;&amp; textBeginsWithBreakablePosition(m_nextObject);
</del><ins>+    bool canBreakHere = !m_currentCharacterIsSpace &amp;&amp; textBeginsWithBreakablePosition(nextRenderText);
</ins><span class="cx"> 
</span><span class="cx">     // See if attempting to fit below floats creates more available width on the line.
</span><span class="cx">     if (!m_width.fitsOnLine() &amp;&amp; !m_width.committedWidth())
</span><span class="lines">@@ -962,7 +959,7 @@
</span><span class="cx">     bool canPlaceOnLine = m_width.fitsOnLine() || !m_autoWrapWasEverTrueOnLine;
</span><span class="cx"> 
</span><span class="cx">     if (canPlaceOnLine &amp;&amp; canBreakHere)
</span><del>-        commitLineBreakAtCurrentWidth(m_nextObject);
</del><ins>+        commitLineBreakAtCurrentWidth(nextRenderText);
</ins><span class="cx"> 
</span><span class="cx">     return canBreakHere;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineLineBreakercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">                 return context.lineBreak();
</span><span class="cx">             }
</span><span class="cx">         } else if (context.currentObject()-&gt;isLineBreakOpportunity())
</span><del>-            context.commitLineBreakAtCurrentWidth(context.currentObject());
</del><ins>+            context.commitLineBreakAtCurrentWidth(*context.currentObject());
</ins><span class="cx">         else
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-10-07  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment
+        https://bugs.webkit.org/show_bug.cgi?id=137476
+
+        Reviewed by Darin Adler.
+
+        * WebView/WebRenderNode.mm:
+        (copyRenderNode):
+
</ins><span class="cx"> 2014-10-06  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebRenderNodemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebRenderNode.mm (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebRenderNode.mm        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebKit/mac/WebView/WebRenderNode.mm        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #import &lt;WebCore/FrameLoaderClient.h&gt;
</span><ins>+#import &lt;WebCore/RenderInline.h&gt;
</ins><span class="cx"> #import &lt;WebCore/RenderText.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderWidget.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderView.h&gt;
</span><span class="lines">@@ -94,10 +95,10 @@
</span><span class="cx"> 
</span><span class="cx">     NSString *name = [[NSString alloc] initWithUTF8String:node-&gt;renderName()];
</span><span class="cx">     
</span><del>-    RenderWidget* renderWidget = node-&gt;isWidget() ? toRenderWidget(node) : 0;
-    Widget* widget = renderWidget ? renderWidget-&gt;widget() : 0;
-    FrameView* frameView = widget &amp;&amp; widget-&gt;isFrameView() ? toFrameView(widget) : 0;
-    Frame* frame = frameView ? &amp;frameView-&gt;frame() : 0;
</del><ins>+    RenderWidget* renderWidget = node-&gt;isWidget() ? toRenderWidget(node) : nullptr;
+    Widget* widget = renderWidget ? renderWidget-&gt;widget() : nullptr;
+    FrameView* frameView = widget &amp;&amp; widget-&gt;isFrameView() ? toFrameView(widget) : nullptr;
+    Frame* frame = frameView ? &amp;frameView-&gt;frame() : nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: broken with transforms
</span><span class="cx">     FloatPoint absPos = node-&gt;localToAbsolute();
</span><span class="lines">@@ -105,24 +106,24 @@
</span><span class="cx">     int y = 0;
</span><span class="cx">     int width = 0;
</span><span class="cx">     int height = 0;
</span><del>-    if (node-&gt;isBox()) {
-        RenderBox* box = toRenderBox(node);
-        x = box-&gt;x();
-        y = box-&gt;y();
-        width = box-&gt;width();
-        height = box-&gt;height();
-    } else if (node-&gt;isText()) {
</del><ins>+    if (is&lt;RenderBox&gt;(*node)) {
+        RenderBox&amp; box = downcast&lt;RenderBox&gt;(*node);
+        x = box.x();
+        y = box.y();
+        width = box.width();
+        height = box.height();
+    } else if (is&lt;RenderText&gt;(*node)) {
</ins><span class="cx">         // FIXME: Preserve old behavior even though it's strange.
</span><del>-        RenderText* text = toRenderText(node);
-        IntPoint firstRunLocation = text-&gt;firstRunLocation();
</del><ins>+        RenderText&amp; text = downcast&lt;RenderText&gt;(*node);
+        IntPoint firstRunLocation = text.firstRunLocation();
</ins><span class="cx">         x = firstRunLocation.x();
</span><span class="cx">         y = firstRunLocation.y();
</span><del>-        IntRect box = text-&gt;linesBoundingBox();
</del><ins>+        IntRect box = text.linesBoundingBox();
</ins><span class="cx">         width = box.width();
</span><span class="cx">         height = box.height();
</span><del>-    } else if (node-&gt;isRenderInline()) {
-        RenderBoxModelObject* inlineFlow = toRenderBoxModelObject(node);
-        IntRect boundingBox = inlineFlow-&gt;borderBoundingBox();
</del><ins>+    } else if (is&lt;RenderInline&gt;(*node)) {
+        RenderInline&amp; inlineFlow = downcast&lt;RenderInline&gt;(*node);
+        IntRect boundingBox = inlineFlow.borderBoundingBox();
</ins><span class="cx">         x = boundingBox.x();
</span><span class="cx">         y = boundingBox.y();
</span><span class="cx">         width = boundingBox.width();
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2014-10-07  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment
+        https://bugs.webkit.org/show_bug.cgi?id=137476
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderText / RenderTextFragment.
+
+        * Shared/WebRenderObject.cpp:
+        (WebKit::WebRenderObject::WebRenderObject):
+
+2014-10-07  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         [WK2] Use is&lt;&gt;() / downcast&lt;&gt;() for DrawingAreaProxy subclasses
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137477
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebRenderObject.cpp (174402 => 174403)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-10-07 19:11:53 UTC (rev 174402)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-10-07 19:33:53 UTC (rev 174403)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoaderClient.h&gt;
</span><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><ins>+#include &lt;WebCore/RenderInline.h&gt;
</ins><span class="cx"> #include &lt;WebCore/RenderText.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderWidget.h&gt;
</span><span class="lines">@@ -87,13 +88,13 @@
</span><span class="cx">     // FIXME: broken with transforms
</span><span class="cx">     m_absolutePosition = flooredIntPoint(renderer-&gt;localToAbsolute());
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;isBox())
-        m_frameRect = snappedIntRect(toRenderBox(renderer)-&gt;frameRect());
-    else if (renderer-&gt;isText()) {
-        m_frameRect = toRenderText(renderer)-&gt;linesBoundingBox();
-        m_frameRect.setLocation(toRenderText(renderer)-&gt;firstRunLocation());
-    } else if (renderer-&gt;isRenderInline())
-        m_frameRect = toRenderBoxModelObject(renderer)-&gt;borderBoundingBox();
</del><ins>+    if (is&lt;RenderBox&gt;(*renderer))
+        m_frameRect = snappedIntRect(downcast&lt;RenderBox&gt;(*renderer).frameRect());
+    else if (is&lt;RenderText&gt;(*renderer)) {
+        m_frameRect = downcast&lt;RenderText&gt;(*renderer).linesBoundingBox();
+        m_frameRect.setLocation(downcast&lt;RenderText&gt;(*renderer).firstRunLocation());
+    } else if (is&lt;RenderInline&gt;(*renderer))
+        m_frameRect = downcast&lt;RenderInline&gt;(*renderer).borderBoundingBox();
</ins><span class="cx"> 
</span><span class="cx">     if (!shouldIncludeDescendants)
</span><span class="cx">         return;
</span></span></pre>
</div>
</div>

</body>
</html>