<!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<>() / downcast<>() for RenderText / RenderTextFragment
https://bugs.webkit.org/show_bug.cgi?id=137476
Reviewed by Darin Adler.
Source/WebCore:
Use is<>() / downcast<>() 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<>() / downcast<>() 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for RenderText / RenderTextFragment
+ https://bugs.webkit.org/show_bug.cgi?id=137476
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() 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 <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [Media] Expose AudioTracks in the "captions" 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->isText() && m_renderer->isAnonymous() && ancestorsOfType<RenderMathMLOperator>(*m_renderer).first())
- return toRenderText(*m_renderer).text();
</del><ins>+ if (is<RenderText>(*m_renderer) && m_renderer->isAnonymous() && ancestorsOfType<RenderMathMLOperator>(*m_renderer).first())
+ return downcast<RenderText>(*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->isText() || mode.childrenInclusion == AccessibilityTextUnderElementMode::TextUnderElementModeIncludeAllChildren) {
</del><ins>+ if (is<RenderText>(*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->isText()) {
- RenderText* renderTextObject = toRenderText(m_renderer);
- if (renderTextObject->isTextFragment()) {
-
</del><ins>+ if (is<RenderText>(*m_renderer)) {
+ RenderText& renderTextObject = downcast<RenderText>(*m_renderer);
+ if (is<RenderTextFragment>(renderTextObject)) {
+ RenderTextFragment& renderTextFragment = downcast<RenderTextFragment>(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& altText = toRenderTextFragment(renderTextObject)->altText();
</del><ins>+ const String& altText = renderTextFragment.altText();
</ins><span class="cx"> if (!altText.isEmpty())
</span><span class="cx"> return altText;
</span><del>- return String(static_cast<RenderTextFragment*>(m_renderer)->contentString());
</del><ins>+ return renderTextFragment.contentString();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return String(renderTextObject->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->isSVGRoot())
</span><span class="cx"> isSVGRoot = true;
</span><span class="cx">
</span><del>- if (obj->isText())
- quads = toRenderText(obj)->absoluteQuadsClippedToEllipsis();
</del><ins>+ if (is<RenderText>(*obj))
+ quads = downcast<RenderText>(*obj).absoluteQuadsClippedToEllipsis();
</ins><span class="cx"> else if (isWebArea() || isSVGRoot)
</span><span class="cx"> obj->absoluteQuads(quads);
</span><span class="cx"> else
</span><span class="lines">@@ -1211,12 +1211,12 @@
</span><span class="cx"> if (m_renderer->isBR())
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (m_renderer->isText()) {
</del><ins>+ if (is<RenderText>(*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 && (parent->isMenuItem() || parent->ariaRoleAttribute() == MenuButtonRole))
</span><span class="cx"> return true;
</span><del>- auto& renderText = toRenderText(*m_renderer);
</del><ins>+ auto& renderText = downcast<RenderText>(*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(&renderText)->altText());
</del><ins>+ if (is<RenderTextFragment>(renderText)) {
+ AccessibilityObjectInclusion altTextInclusion = objectInclusionFromAltText(downcast<RenderTextFragment>(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()->renderer();
</span><del>- while (renderer && !renderer->isText())
- renderer = toRenderElement(renderer)->firstChild();
</del><ins>+ while (renderer && !is<RenderText>(renderer))
+ renderer = downcast<RenderElement>(*renderer).firstChild();
</ins><span class="cx">
</span><del>- if (!renderer || !renderer->isText())
</del><ins>+ if (!is<RenderText>(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)->textWithoutConvertingBackslashToYenSymbol();
</del><ins>+ return downcast<RenderText>(*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->node();
</span><del>- RenderObject* renderer = node ? node->renderer() : 0;
- if (renderer && renderer->isText())
- textLength = toRenderText(*renderer).textLength();
</del><ins>+ RenderObject* renderer = node ? node->renderer() : nullptr;
+ if (is<RenderText>(renderer))
+ textLength = downcast<RenderText>(*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)->renderer();
- if (o && o->isText()) {
- RenderText *t = toRenderText(o);
- return t->style().computedLineHeight();;
- }
</del><ins>+ RenderObject* renderer = core(self)->renderer();
+ if (is<RenderText>(renderer))
+ return downcast<RenderText>(*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 <rdar://problem/6824650> for context.
</span><del>- RenderObject *renderer = core(self)->renderer();
- if (!renderer || !renderer->isRenderBlockFlow())
</del><ins>+ RenderObject* renderer = core(self)->renderer();
+ if (!is<RenderBlockFlow>(renderer))
</ins><span class="cx"> return nil;
</span><span class="cx">
</span><del>- RenderBlock *block = static_cast<RenderBlock *>(renderer);
</del><ins>+ RenderBlock* block = downcast<RenderBlockFlow>(renderer);
</ins><span class="cx">
</span><span class="cx"> FloatPoint absPoint(point);
</span><span class="cx"> FloatPoint localPoint = block->absoluteToLocal(absPoint);
</span><span class="lines">@@ -279,7 +277,7 @@
</span><span class="cx"> nextChild = nextChild->nextSiblingBox();
</span><span class="cx"> if (!nextChild) {
</span><span class="cx"> if (localPoint.y() >= top) {
</span><del>- block = static_cast<RenderBlock *>(child);
</del><ins>+ block = downcast<RenderBlock>(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->y();
</span><span class="cx">
</span><del>- if (localPoint.y() >= top && localPoint.y() < bottom && child->isRenderBlock()) {
- block = static_cast<RenderBlock *>(child);
</del><ins>+ if (localPoint.y() >= top && localPoint.y() < bottom && is<RenderBlock>(*child)) {
+ block = downcast<RenderBlock>(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->absoluteToLocal(absPoint);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RenderBlockFlow *blockFlow = toRenderBlockFlow(block);
</del><ins>+ RenderBlockFlow& blockFlow = downcast<RenderBlockFlow>(*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->firstRootBox(); cur && cur != blockFlow->lastRootBox(); cur = cur->nextRootBox()) {
- float currentBottom = cur->y() + cur->logicalHeight();
</del><ins>+ for (RootInlineBox* current = blockFlow.firstRootBox(); current && current != blockFlow.lastRootBox(); current = current->nextRootBox()) {
+ float currentBottom = current->y() + current->logicalHeight();
</ins><span class="cx"> if (localPoint.y() < currentBottom)
</span><span class="cx"> return nil;
</span><span class="cx">
</span><del>- RootInlineBox *next = cur->nextRootBox();
</del><ins>+ RootInlineBox* next = current->nextRootBox();
</ins><span class="cx"> float nextTop = next->y();
</span><span class="cx"> if (localPoint.y() < nextTop) {
</span><del>- InlineBox *inlineBox = cur->closestLeafChildForLogicalLeftPosition(localPoint.x());
- if (inlineBox && inlineBox->behavesLikeText() && inlineBox->renderer().isText()) {
- RenderText *t = toRenderText(&inlineBox->renderer());
- if (t->textNode()) {
- return kit(t->textNode());
- }
</del><ins>+ InlineBox* inlineBox = current->closestLeafChildForLogicalLeftPosition(localPoint.x());
+ if (inlineBox && inlineBox->behavesLikeText() && is<RenderText>(inlineBox->renderer())) {
+ RenderText& renderText = downcast<RenderText>(inlineBox->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->node() && p->node() == this && o->isText() && !toRenderText(o)->firstTextBox()) {
</del><ins>+ if (p->node() && p->node() == this && is<RenderText>(*o) && !downcast<RenderText>(*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->isText() || o->isReplaced()) {
</del><ins>+ } else if (is<RenderText>(*o) || o->isReplaced()) {
</ins><span class="cx"> point = FloatPoint();
</span><del>- if (o->isText() && toRenderText(o)->firstTextBox()) {
- point.move(toRenderText(o)->linesBoundingBox().x(), toRenderText(o)->firstTextBox()->root().lineTop());
- } else if (o->isBox()) {
- RenderBox* box = toRenderBox(o);
- point.moveBy(box->location());
- }
</del><ins>+ if (is<RenderText>(*o) && downcast<RenderText>(*o).firstTextBox())
+ point.move(downcast<RenderText>(*o).linesBoundingBox().x(), downcast<RenderText>(*o).firstTextBox()->root().lineTop());
+ else if (is<RenderBox>(*o))
+ point.moveBy(downcast<RenderBox>(*o).location());
</ins><span class="cx"> point = o->container()->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->isText() || o->isReplaced()) {
</del><ins>+ if (is<RenderText>(*o) || o->isReplaced()) {
</ins><span class="cx"> point = FloatPoint();
</span><del>- if (o->isText()) {
- RenderText* text = toRenderText(o);
- IntRect linesBox = text->linesBoundingBox();
</del><ins>+ if (is<RenderText>(*o)) {
+ IntRect linesBox = downcast<RenderText>(*o).linesBoundingBox();
</ins><span class="cx"> if (!linesBox.maxX() && !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->frameRect().maxXMaxYCorner());
- }
</del><ins>+ } else
+ point.moveBy(downcast<RenderBox>(*o).frameRect().maxXMaxYCorner());
</ins><span class="cx"> point = o->container()->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->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->isText())
- toRenderText(*renderer).ensureLineBoxes();
- else if (renderer->isRenderBlockFlow())
- toRenderBlockFlow(*renderer).ensureLineBoxes();
</del><ins>+ if (is<RenderText>(*renderer))
+ downcast<RenderText>(*renderer).ensureLineBoxes();
+ else if (is<RenderBlockFlow>(*renderer))
+ downcast<RenderBlockFlow>(*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& renderer)
</span><span class="cx"> {
</span><del>- if (renderer.isBox() && toRenderBox(renderer).inlineBoxWrapper())
</del><ins>+ if (is<RenderBox>(renderer) && downcast<RenderBox>(renderer).inlineBoxWrapper())
</ins><span class="cx"> return true;
</span><del>- if (renderer.isText() && toRenderText(renderer).firstTextBox())
</del><ins>+ if (is<RenderText>(renderer) && downcast<RenderText>(renderer).firstTextBox())
</ins><span class="cx"> return true;
</span><del>- if (renderer.isLineBreak() && toRenderLineBreak(renderer).inlineBoxWrapper())
</del><ins>+ if (is<RenderLineBreak>(renderer) && downcast<RenderLineBreak>(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->isText()) {
- auto& textRenderer = toRenderText(*renderer);
</del><ins>+ if (is<RenderText>(*renderer)) {
+ auto& textRenderer = downcast<RenderText>(*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->isText()) {
- auto& textRenderer = toRenderText(*renderer);
</del><ins>+ if (is<RenderText>(*renderer)) {
+ auto& textRenderer = downcast<RenderText>(*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 && o != stop; o = o->nextInPreOrder()) {
</span><span class="cx"> if (!o->nonPseudoNode())
</span><span class="cx"> continue;
</span><del>- if (o->isText()) {
- if (boundingBoxLogicalHeight(o, toRenderText(o)->linesBoundingBox()))
</del><ins>+ if (is<RenderText>(*o)) {
+ if (boundingBoxLogicalHeight(o, downcast<RenderText>(*o).linesBoundingBox()))
</ins><span class="cx"> return true;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (o->isLineBreak()) {
- if (boundingBoxLogicalHeight(o, toRenderLineBreak(o)->linesBoundingBox()))
</del><ins>+ if (is<RenderLineBreak>(*o)) {
+ if (boundingBoxLogicalHeight(o, downcast<RenderLineBreak>(*o).linesBoundingBox()))
</ins><span class="cx"> return true;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (o->isBox()) {
- if (toRenderBox(o)->pixelSnappedLogicalHeight())
</del><ins>+ if (is<RenderBox>(*o)) {
+ if (downcast<RenderBox>(*o).pixelSnappedLogicalHeight())
</ins><span class="cx"> return true;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (o->isRenderInline()) {
- const RenderInline& renderInline = toRenderInline(*o);
</del><ins>+ if (is<RenderInline>(*o)) {
+ const RenderInline& renderInline = downcast<RenderInline>(*o);
</ins><span class="cx"> if (isEmptyInline(renderInline) && 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 && m_anchorType != PositionIsAfterAnchor && !nodeIsUserSelectNone(deprecatedNode()->parentNode());
</span><span class="cx">
</span><del>- if (renderer->isText())
- return !nodeIsUserSelectNone(deprecatedNode()) && toRenderText(renderer)->containsCaretOffset(m_offset);
</del><ins>+ if (is<RenderText>(*renderer))
+ return !nodeIsUserSelectNone(deprecatedNode()) && downcast<RenderText>(*renderer).containsCaretOffset(m_offset);
</ins><span class="cx">
</span><span class="cx"> if (isRenderedTable(deprecatedNode()) || editingIgnoresContent(deprecatedNode()))
</span><span class="cx"> return (atFirstEditingPositionForNode() || atLastEditingPositionForNode()) && !nodeIsUserSelectNone(deprecatedNode()->parentNode());
</span><span class="lines">@@ -935,8 +935,8 @@
</span><span class="cx"> if (m_anchorNode->hasTagName(htmlTag))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (renderer->isRenderBlockFlow()) {
- RenderBlockFlow& block = toRenderBlockFlow(*renderer);
</del><ins>+ if (is<RenderBlockFlow>(*renderer)) {
+ RenderBlockFlow& block = downcast<RenderBlockFlow>(*renderer);
</ins><span class="cx"> if (block.logicalHeight() || m_anchorNode->hasTagName(bodyTag)) {
</span><span class="cx"> if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><span class="cx"> return atFirstEditingPositionForNode() && !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->isText() && !toRenderText(renderer)->containsCaretOffset(m_offset))
</del><ins>+ if (is<RenderText>(*renderer) && !downcast<RenderText>(*renderer).containsCaretOffset(m_offset))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (posRenderer->isText() && !toRenderText(posRenderer)->containsCaretOffset(pos.m_offset))
</del><ins>+ if (is<RenderText>(*posRenderer) && !downcast<RenderText>(*posRenderer).containsCaretOffset(pos.m_offset))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- int thisRenderedOffset = renderer->isText() ? toRenderText(renderer)->countRenderedCharacterOffsetsUntil(m_offset) : m_offset;
- int posRenderedOffset = posRenderer->isText() ? toRenderText(posRenderer)->countRenderedCharacterOffsetsUntil(pos.m_offset) : pos.m_offset;
</del><ins>+ int thisRenderedOffset = is<RenderText>(*renderer) ? downcast<RenderText>(*renderer).countRenderedCharacterOffsetsUntil(m_offset) : m_offset;
+ int posRenderedOffset = is<RenderText>(*posRenderer) ? downcast<RenderText>(*posRenderer).countRenderedCharacterOffsetsUntil(pos.m_offset) : pos.m_offset;
</ins><span class="cx">
</span><span class="cx"> if (renderer == posRenderer && thisRenderedOffset == posRenderedOffset)
</span><span class="cx"> return false;
</span><span class="lines">@@ -1109,16 +1109,16 @@
</span><span class="cx"> RenderBlock* container = renderer->containingBlock();
</span><span class="cx"> RenderObject* next = renderer;
</span><span class="cx"> while ((next = next->nextInPreOrder(container))) {
</span><del>- if (next->isRenderBlock())
- return 0;
</del><ins>+ if (is<RenderBlock>(*next))
+ return nullptr;
</ins><span class="cx"> if (next->isBR())
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> if (isNonTextLeafChild(next))
</span><del>- return 0;
- if (next->isText()) {
- InlineTextBox* match = 0;
</del><ins>+ return nullptr;
+ if (is<RenderText>(*next)) {
+ InlineTextBox* match = nullptr;
</ins><span class="cx"> int minOffset = INT_MAX;
</span><del>- for (InlineTextBox* box = toRenderText(next)->firstTextBox(); box; box = box->nextTextBox()) {
</del><ins>+ for (InlineTextBox* box = downcast<RenderText>(*next).firstTextBox(); box; box = box->nextTextBox()) {
</ins><span class="cx"> int caretMinOffset = box->caretMinOffset();
</span><span class="cx"> if (caretMinOffset < 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->isBR())
</span><span class="cx"> inlineBox = !caretOffset ? toRenderLineBreak(renderer)->inlineBoxWrapper() : nullptr;
</span><del>- else if (renderer->isText()) {
- auto textRenderer = toRenderText(renderer);
- textRenderer->ensureLineBoxes();
</del><ins>+ else if (is<RenderText>(*renderer)) {
+ auto& textRenderer = downcast<RenderText>(*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->firstTextBox(); box; box = box->nextTextBox()) {
</del><ins>+ for (box = textRenderer.firstTextBox(); box; box = box->nextTextBox()) {
</ins><span class="cx"> int caretMinOffset = box->caretMinOffset();
</span><span class="cx"> int caretMaxOffset = box->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 && candidate == textRenderer->lastTextBox() && affinity == DOWNSTREAM) {
- box = searchAheadForBetterMatch(textRenderer);
</del><ins>+ if (candidate && candidate == textRenderer.lastTextBox() && affinity == DOWNSTREAM) {
+ box = searchAheadForBetterMatch(&textRenderer);
</ins><span class="cx"> if (box)
</span><span class="cx"> caretOffset = box->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()) && renderer->isRenderBlockFlow() && hasRenderedNonAnonymousDescendantsWithHeight(toRenderBlock(*renderer))) {
</del><ins>+ inlineBox = nullptr;
+ if (canHaveChildrenForEditing(deprecatedNode()) && is<RenderBlockFlow>(*renderer) && hasRenderedNonAnonymousDescendantsWithHeight(downcast<RenderBlockFlow>(*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->isBox()) {
- inlineBox = toRenderBox(renderer)->inlineBoxWrapper();
</del><ins>+ if (is<RenderBox>(*renderer)) {
+ inlineBox = downcast<RenderBox>(*renderer).inlineBoxWrapper();
</ins><span class="cx"> if (!inlineBox || (caretOffset > inlineBox->caretMinOffset() && caretOffset < inlineBox->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 "config.h"
</span><span class="cx"> #include "PositionIterator.h"
</span><span class="cx">
</span><ins>+#include "HTMLBodyElement.h"
</ins><span class="cx"> #include "HTMLElement.h"
</span><ins>+#include "HTMLHtmlElement.h"
</ins><span class="cx"> #include "HTMLNames.h"
</span><del>-#include "RenderBlock.h"
</del><ins>+#include "RenderBlockFlow.h"
</ins><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "htmlediting.h"
</span><span class="cx">
</span><span class="lines">@@ -154,15 +156,15 @@
</span><span class="cx"> if (renderer->isBR())
</span><span class="cx"> return !m_offsetInAnchor && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode());
</span><span class="cx">
</span><del>- if (renderer->isText())
- return !Position::nodeIsUserSelectNone(m_anchorNode) && toRenderText(renderer)->containsCaretOffset(m_offsetInAnchor);
</del><ins>+ if (is<RenderText>(*renderer))
+ return !Position::nodeIsUserSelectNone(m_anchorNode) && downcast<RenderText>(*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()) && !Position::nodeIsUserSelectNone(m_anchorNode->parentNode());
</span><span class="cx">
</span><del>- if (!m_anchorNode->hasTagName(htmlTag) && renderer->isRenderBlockFlow()) {
- RenderBlock& block = toRenderBlock(*renderer);
- if (block.logicalHeight() || m_anchorNode->hasTagName(bodyTag)) {
</del><ins>+ if (!is<HTMLHtmlElement>(*m_anchorNode) && is<RenderBlockFlow>(*renderer)) {
+ RenderBlockFlow& block = downcast<RenderBlockFlow>(*renderer);
+ if (block.logicalHeight() || is<HTMLBodyElement>(*m_anchorNode)) {
</ins><span class="cx"> if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(block))
</span><span class="cx"> return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anchorNode);
</span><span class="cx"> return m_anchorNode->hasEditableStyle() && !Position::nodeIsUserSelectNone(m_anchorNode) && 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->renderer();
- if (!r)
</del><ins>+ RenderObject* renderer = node->renderer();
+ if (!renderer)
</ins><span class="cx"> continue;
</span><span class="cx"> bool isFixed = false;
</span><del>- if (r->isBR())
- r->absoluteRects(rects, flooredLayoutPoint(r->localToAbsolute()));
- else if (r->isText()) {
</del><ins>+ if (renderer->isBR())
+ renderer->absoluteRects(rects, flooredLayoutPoint(renderer->localToAbsolute()));
+ else if (is<RenderText>(*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<int>::max();
</span><del>- rects.appendVector(toRenderText(r)->absoluteRectsForRange(startOffset, endOffset, useSelectionHeight, &isFixed));
</del><ins>+ rects.appendVector(downcast<RenderText>(*renderer).absoluteRectsForRange(startOffset, endOffset, useSelectionHeight, &isFixed));
</ins><span class="cx"> } else
</span><span class="cx"> continue;
</span><span class="cx"> allFixed &= 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->renderer();
- if (!r)
</del><ins>+ RenderObject* renderer = node->renderer();
+ if (!renderer)
</ins><span class="cx"> continue;
</span><span class="cx"> bool isFixed = false;
</span><del>- if (r->isBR())
- r->absoluteQuads(quads, &isFixed);
- else if (r->isText()) {
</del><ins>+ if (renderer->isBR())
+ renderer->absoluteQuads(quads, &isFixed);
+ else if (is<RenderText>(*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<int>::max();
</span><del>- quads.appendVector(toRenderText(r)->absoluteQuadsForRange(startOffset, endOffset, useSelectionHeight, &isFixed));
</del><ins>+ quads.appendVector(downcast<RenderText>(*renderer).absoluteQuadsForRange(startOffset, endOffset, useSelectionHeight, &isFixed));
</ins><span class="cx"> } else
</span><span class="cx"> continue;
</span><span class="cx"> allFixed &= 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<Text>(*node)) {
</span><del>- if (RenderObject* renderer = downcast<Text>(*node).renderer()) {
- const RenderText& renderText = toRenderText(*renderer);
</del><ins>+ if (RenderText* renderText = downcast<Text>(*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->absoluteQuadsForRange(startOffset, endOffset);
+ ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText->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<Element>(*renderer->node())) {
</span><span class="cx"> Element& element = downcast<Element>(*renderer->node());
</span><span class="cx"> fprintf(stderr, "%s%s\n", selected ? "==> " : " ", element.localName().string().utf8().data());
</span><del>- } else if (renderer->isText()) {
- RenderText* textRenderer = toRenderText(renderer);
- if (!textRenderer->textLength() || !textRenderer->firstTextBox()) {
</del><ins>+ } else if (is<RenderText>(*renderer)) {
+ RenderText& textRenderer = downcast<RenderText>(*renderer);
+ if (!textRenderer.textLength() || !textRenderer.firstTextBox()) {
</ins><span class="cx"> fprintf(stderr, "%s#text (empty)\n", selected ? "==> " : " ");
</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->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->findNextInlineTextBox(offset, pos);
</del><ins>+ InlineTextBox* box = textRenderer.findNextInlineTextBox(offset, pos);
</ins><span class="cx"> text = text.substring(box->start(), box->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<RenderTextFragment>(renderer)) {
+ if (auto firstLetter = downcast<RenderTextFragment>(renderer).firstLetter()) {
</ins><span class="cx"> if (firstLetter->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 && renderer.isTextFragment() && !m_offset) {
- handleTextNodeFirstLetter(toRenderTextFragment(renderer));
</del><ins>+ if (!m_handledFirstLetter && is<RenderTextFragment>(renderer) && !m_offset) {
+ handleTextNodeFirstLetter(downcast<RenderTextFragment>(renderer));
</ins><span class="cx"> if (m_firstLetterText) {
</span><span class="cx"> String firstLetter = m_firstLetterText->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 && renderer.isTextFragment() && !m_offset;
</del><ins>+ bool shouldHandleFirstLetter = !m_handledFirstLetter && is<RenderTextFragment>(renderer) && !m_offset;
</ins><span class="cx"> if (shouldHandleFirstLetter)
</span><del>- handleTextNodeFirstLetter(toRenderTextFragment(renderer));
</del><ins>+ handleTextNodeFirstLetter(downcast<RenderTextFragment>(renderer));
</ins><span class="cx">
</span><span class="cx"> if (!renderer.firstTextBox() && rendererText.length() && !shouldHandleFirstLetter) {
</span><span class="cx"> if (renderer.style().visibility() != VISIBLE && !(m_behavior & TextIteratorIgnoresStyleVisibility))
</span><span class="lines">@@ -912,8 +912,8 @@
</span><span class="cx"> {
</span><span class="cx"> int offset = caretMaxOffset(&node);
</span><span class="cx"> if (auto* renderer = node.renderer()) {
</span><del>- if (renderer->isText())
- offset += collapsedSpaceLength(toRenderText(*renderer), offset);
</del><ins>+ if (is<RenderText>(*renderer))
+ offset += collapsedSpaceLength(downcast<RenderText>(*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& startOffset, int& offsetInNode)
</span><span class="cx"> {
</span><del>- RenderText* renderer = toRenderText(m_node->renderer());
</del><ins>+ RenderText& renderer = downcast<RenderText>(*m_node->renderer());
</ins><span class="cx"> startOffset = (m_node == m_startContainer) ? m_startOffset : 0;
</span><span class="cx">
</span><del>- if (!renderer->isTextFragment()) {
</del><ins>+ if (!is<RenderTextFragment>(renderer)) {
</ins><span class="cx"> offsetInNode = 0;
</span><del>- return renderer;
</del><ins>+ return &renderer;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- RenderTextFragment* fragment = toRenderTextFragment(renderer);
- int offsetAfterFirstLetter = fragment->start();
</del><ins>+ RenderTextFragment& fragment = downcast<RenderTextFragment>(renderer);
+ int offsetAfterFirstLetter = fragment.start();
</ins><span class="cx"> if (startOffset >= offsetAfterFirstLetter) {
</span><span class="cx"> ASSERT(!m_shouldHandleFirstLetter);
</span><span class="cx"> offsetInNode = offsetAfterFirstLetter;
</span><del>- return renderer;
</del><ins>+ return &renderer;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!m_shouldHandleFirstLetter && startOffset + offsetAfterFirstLetter < m_offset) {
</span><span class="cx"> m_shouldHandleFirstLetter = true;
</span><span class="cx"> offsetInNode = offsetAfterFirstLetter;
</span><del>- return renderer;
</del><ins>+ return &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->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->isBR() || isBlock(n))
</span><span class="cx"> break;
</span><span class="cx">
</span><del>- if (r->isText() && toRenderText(r)->hasRenderedText()) {
</del><ins>+ if (is<RenderText>(*r) && downcast<RenderText>(*r).hasRenderedText()) {
</ins><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(*n));
</span><span class="cx"> type = Position::PositionIsOffsetInAnchor;
</span><span class="cx"> if (style.preserveNewline()) {
</span><del>- StringImpl& text = *toRenderText(r)->text();
</del><ins>+ StringImpl& text = *downcast<RenderText>(*r).text();
</ins><span class="cx"> int i = text.length();
</span><span class="cx"> int o = offset;
</span><span class="cx"> if (n == startNode && o < 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->isText() && toRenderText(r)->hasRenderedText()) {
</del><ins>+ if (is<RenderText>(*r) && downcast<RenderText>(*r).hasRenderedText()) {
</ins><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(is<Text>(*n));
</span><span class="cx"> type = Position::PositionIsOffsetInAnchor;
</span><span class="cx"> if (style.preserveNewline()) {
</span><del>- StringImpl& text = *toRenderText(r)->text();
</del><ins>+ StringImpl& text = *downcast<RenderText>(*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 < 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& 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()->length();
</del><ins>+ if (is<RenderText>(renderer))
+ countSoFar += downcast<RenderText>(renderer).text()->length();
</ins><span class="cx">
</span><span class="cx"> for (RenderObject* child = renderer.firstChildSlow(); child; child = child->nextSibling()) {
</span><span class="cx"> if (countSoFar >= 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<unsigned>(stop) <= toRenderText(m_renderer).textLength());
</del><ins>+ ASSERT(!is<RenderText>(m_renderer) || static_cast<unsigned>(stop) <= downcast<RenderText>(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& text = toRenderText(*m_renderer);
</del><ins>+ RenderText& text = downcast<RenderText>(*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 && m_renderer->preservesNewline() && m_renderer->isText() && toRenderText(m_renderer)->textLength()
- && toRenderText(m_renderer)->characterAt(m_pos) == '\n';
</del><ins>+ return is<RenderText>(m_renderer) && m_renderer->preservesNewline() && downcast<RenderText>(*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 && m_renderer->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& renderer)
</span><span class="cx"> {
</span><del>- for (RenderObject* curr = renderer.firstChild(); curr; curr = curr->nextSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = renderer.firstChild(); current; current = current->nextSibling()) {
+ if (current->isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><del>- if (curr->isText()) {
- if (!toRenderText(curr)->isAllCollapsibleWhitespace())
</del><ins>+ if (is<RenderText>(*current)) {
+ if (!downcast<RenderText>(*current).isAllCollapsibleWhitespace())
</ins><span class="cx"> return false;
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><del>- if (!curr->isRenderInline() || !isEmptyInline(toRenderInline(*curr)))
</del><ins>+ if (!is<RenderInline>(*current) || !isEmptyInline(downcast<RenderInline>(*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->isText());
- ASSERT(m_pos <= toRenderText(m_renderer)->textLength());
- m_pos++;
</del><ins>+ ASSERT(m_pos <= downcast<RenderText>(*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->isText()) {
</del><ins>+ if (is<RenderText>(*m_renderer)) {
</ins><span class="cx"> fastIncrementInTextNode();
</span><del>- if (m_pos < toRenderText(m_renderer)->textLength())
</del><ins>+ if (m_pos < downcast<RenderText>(*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->isText())
</del><ins>+ if (!is<RenderText>(m_renderer))
</ins><span class="cx"> return 0;
</span><span class="cx">
</span><del>- return toRenderText(m_renderer)->characterAt(index);
</del><ins>+ return downcast<RenderText>(*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->isText())) {
- UChar codeUnit = toRenderText(*m_renderer).characterAt(m_pos);
</del><ins>+ if (LIKELY(is<RenderText>(*m_renderer))) {
+ UChar codeUnit = downcast<RenderText>(*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& renderer() const { return toRenderText(InlineBox::renderer()); }
</del><ins>+ RenderText& renderer() const { return downcast<RenderText>(InlineBox::renderer()); }
</ins><span class="cx"> const RenderStyle& 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(&view());
</span><span class="cx"> while (RenderObject* child = firstLetter->firstChild()) {
</span><del>- if (child->isText())
- toRenderText(child)->removeAndDestroyTextBoxes();
</del><ins>+ if (is<RenderText>(*child))
+ downcast<RenderText>(*child).removeAndDestroyTextBoxes();
</ins><span class="cx"> firstLetter->removeChild(*child);
</span><del>- newFirstLetter->addChild(child, 0);
</del><ins>+ newFirstLetter->addChild(child, nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RenderObject* nextSibling = firstLetter->nextSibling();
</span><del>- if (RenderTextFragment* remainingText = toRenderBoxModelObject(firstLetter)->firstLetterRemainingText()) {
</del><ins>+ if (RenderTextFragment* remainingText = downcast<RenderBoxModelObject>(*firstLetter).firstLetterRemainingText()) {
</ins><span class="cx"> ASSERT(remainingText->isAnonymous() || remainingText->textNode()->renderer() == remainingText);
</span><span class="cx"> // Replace the old renderer with the new one.
</span><span class="cx"> remainingText->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->isText())
</del><ins>+ if (!is<RenderText>(*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(&view());
</span><span class="cx">
</span><del>- createFirstLetterRenderer(firstLetterContainer, toRenderText(firstLetterObj));
</del><ins>+ createFirstLetterRenderer(firstLetterContainer, downcast<RenderText>(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())->deleteLineBoxesBeforeSimpleLineLayout();
</del><ins>+ downcast<RenderText>(*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->isText())
</del><ins>+ if (!is<RenderText>(*renderer))
</ins><span class="cx"> return false;
</span><del>- RenderText* renderText = toRenderText(renderer);
- return !renderText->linesBoundingBox().isEmpty() && !renderText->text()->containsOnlyWhitespace();
</del><ins>+ RenderText& renderText = downcast<RenderText>(*renderer);
+ return !renderText.linesBoundingBox().isEmpty() && !renderText.text()->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->traverseNext(this, isNonBlocksOrNonFixedHeightListItems)) {
</span><span class="cx"> if (isVisibleRenderText(descendent) && resizeTextPermitted(descendent)) {
</span><del>- RenderText* text = toRenderText(descendent);
- RenderStyle& oldStyle = text->style();
</del><ins>+ RenderText& text = downcast<RenderText>(*descendent);
+ RenderStyle& 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 > specifiedSize && candidateNewSize != fontDescription.computedSize() && text->textNode() && oldStyle.textSizeAdjust().isAuto())
- document().addAutoSizingNode(text->textNode(), candidateNewSize);
</del><ins>+ if (candidateNewSize > specifiedSize && candidateNewSize != fontDescription.computedSize() && text.textNode() && 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& inlineMax, float& inlineMin, RenderObject* trailingSpaceChild)
</span><span class="cx"> {
</span><del>- if (trailingSpaceChild && trailingSpaceChild->isText()) {
</del><ins>+ if (is<RenderText>(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& renderText = downcast<RenderText>(*trailingSpaceChild);
</ins><span class="cx"> const UChar space = ' ';
</span><del>- const Font& font = t->style().font(); // FIXME: This ignores first-line.
- float spaceWidth = font.width(RenderBlock::constructTextRun(t, font, &space, 1, t->style()));
</del><ins>+ const Font& font = renderText.style().font(); // FIXME: This ignores first-line.
+ float spaceWidth = font.width(RenderBlock::constructTextRun(&renderText, font, &space, 1, renderText.style()));
</ins><span class="cx"> inlineMax -= spaceWidth + font.wordSpacing();
</span><span class="cx"> if (inlineMin > 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->isFloating()) {
</span><span class="cx"> stripFrontSpaces = false;
</span><del>- trailingSpaceChild = 0;
</del><ins>+ trailingSpaceChild = nullptr;
</ins><span class="cx"> }
</span><del>- } else if (child->isText()) {
</del><ins>+ } else if (is<RenderText>(*child)) {
</ins><span class="cx"> // Case (3). Text.
</span><del>- RenderText* t = toRenderText(child);
</del><ins>+ RenderText& renderText = downcast<RenderText>(*child);
</ins><span class="cx">
</span><del>- if (t->style().hasTextCombine() && t->isCombineText())
- toRenderCombineText(*t).combineText();
</del><ins>+ if (renderText.style().hasTextCombine() && renderText.isCombineText())
+ downcast<RenderCombineText>(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->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)->createAndAppendRootInlineBox();
</del><ins>+ return downcast<RenderBlockFlow>(*renderer).createAndAppendRootInlineBox();
</ins><span class="cx">
</span><del>- if (obj->isText())
- return toRenderText(obj)->createInlineTextBox();
</del><ins>+ if (is<RenderText>(*renderer))
+ return downcast<RenderText>(*renderer).createInlineTextBox();
</ins><span class="cx">
</span><del>- if (obj->isBox()) {
</del><ins>+ if (is<RenderBox>(*renderer)) {
</ins><span class="cx"> // FIXME: This is terrible. This branch returns an *owned* pointer!
</span><del>- return toRenderBox(obj)->createInlineBox().release();
</del><ins>+ return downcast<RenderBox>(*renderer).createInlineBox().release();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (obj->isLineBreak()) {
</del><ins>+ if (is<RenderLineBreak>(*renderer)) {
</ins><span class="cx"> // FIXME: This is terrible. This branch returns an *owned* pointer!
</span><del>- auto inlineBox = toRenderLineBreak(obj)->createInlineBox().release();
</del><ins>+ auto inlineBox = downcast<RenderLineBreak>(*renderer).createInlineBox().release();
</ins><span class="cx"> // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode
</span><span class="cx"> // (Note the use of strict mode. In "almost strict" mode, we don't treat the box for <br> as text.)
</span><del>- inlineBox->setBehavesLikeText(isOnlyRun || obj->document().inNoQuirksMode() || obj->isLineBreakOpportunity());
</del><ins>+ inlineBox->setBehavesLikeText(isOnlyRun || renderer->document().inNoQuirksMode() || renderer->isLineBreakOpportunity());
</ins><span class="cx"> return inlineBox;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return toRenderInline(obj)->createAndAppendInlineFlowBox();
</del><ins>+ return downcast<RenderInline>(*renderer).createAndAppendInlineFlowBox();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline void dirtyLineBoxesForRenderer(RenderObject& renderer, bool fullLayout)
</span><span class="cx"> {
</span><del>- if (renderer.isText()) {
- RenderText& renderText = toRenderText(renderer);
</del><ins>+ if (is<RenderText>(renderer)) {
+ RenderText& renderText = downcast<RenderText>(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<RenderLineBreak>(renderer))
+ downcast<RenderLineBreak>(renderer).dirtyLineBoxes(fullLayout);
</ins><span class="cx"> else
</span><del>- toRenderInline(renderer).dirtyLineBoxes(fullLayout);
</del><ins>+ downcast<RenderInline>(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->stop();
</span><del>- const RenderObject& r = run->renderer();
- if (!r.isText())
</del><ins>+ const RenderObject& renderer = run->renderer();
+ if (!is<RenderText>(renderer))
</ins><span class="cx"> return false;
</span><del>- const RenderText& renderText = toRenderText(r);
</del><ins>+ const RenderText& renderText = downcast<RenderText>(renderer);
</ins><span class="cx"> unsigned length = renderText.textLength();
</span><span class="cx"> if (pos >= 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<unsigned, 16> 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->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->renderer().isText()) {
- RenderText& rt = toRenderText(r->renderer());
</del><ins>+ if (is<RenderText>(r->renderer())) {
+ RenderText& renderText = downcast<RenderText>(r->renderer());
</ins><span class="cx"> if (textAlign == JUSTIFY && r != trailingSpaceRun) {
</span><span class="cx"> if (!isAfterExpansion)
</span><span class="cx"> toInlineTextBox(r->box())->setCanHaveLeadingExpansion(true);
</span><del>- unsigned opportunitiesInRun = Font::expansionOpportunityCount(rt.stringView(r->m_start, r->m_stop), r->box()->direction(), isAfterExpansion);
</del><ins>+ unsigned opportunitiesInRun = Font::expansionOpportunityCount(renderText.stringView(r->m_start, r->m_stop), r->box()->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->m_start && needsWordSpacing && isSpaceOrNewline(rt.characterAt(r->m_start)))
- totalLogicalWidth += lineStyle(*rt.parent(), lineInfo).font().wordSpacing();
- needsWordSpacing = !isSpaceOrNewline(rt.characterAt(r->m_stop - 1)) && r->m_stop == length;
</del><ins>+ if (int length = renderText.textLength()) {
+ if (!r->m_start && needsWordSpacing && isSpaceOrNewline(renderText.characterAt(r->m_start)))
+ totalLogicalWidth += lineStyle(*renderText.parent(), lineInfo).font().wordSpacing();
+ needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(r->m_stop - 1)) && r->m_stop == length;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- setLogicalWidthForTextRun(lineBox, r, &rt, totalLogicalWidth, lineInfo, textBoxDataMap, verticalPositionCache, wordMeasurements);
</del><ins>+ setLogicalWidthForTextRun(lineBox, r, &renderText, totalLogicalWidth, lineInfo, textBoxDataMap, verticalPositionCache, wordMeasurements);
</ins><span class="cx"> } else {
</span><span class="cx"> isAfterExpansion = false;
</span><span class="cx"> if (!r->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->renderer().isText())
- toRenderText(r->renderer()).positionLineBox(toInlineTextBox(box));
- else if (r->renderer().isBox())
- toRenderBox(r->renderer()).positionLineBox(toInlineElementBox(box));
- else if (r->renderer().isLineBreak())
- toRenderLineBreak(r->renderer()).replaceInlineBoxWrapper(toInlineElementBox(box));
</del><ins>+ if (is<RenderText>(r->renderer()))
+ downcast<RenderText>(r->renderer()).positionLineBox(toInlineTextBox(box));
+ else if (is<RenderBox>(r->renderer()))
+ downcast<RenderBox>(r->renderer()).positionLineBox(toInlineElementBox(box));
+ else if (is<RenderLineBreak>(r->renderer()))
+ downcast<RenderLineBreak>(r->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()->renderer().style().breakOnlyAfterWhiteSpace()
</span><span class="cx"> || !bidiRuns.logicallyLastRun()->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& lastObject = trailingSpaceRun->renderer();
</span><del>- if (!lastObject.isText())
- return 0;
</del><ins>+ if (!is<RenderText>(lastObject))
+ return nullptr;
</ins><span class="cx">
</span><del>- const RenderText& lastText = toRenderText(lastObject);
</del><ins>+ const RenderText& lastText = downcast<RenderText>(lastObject);
</ins><span class="cx"> int firstSpace;
</span><span class="cx"> if (lastText.is8Bit())
</span><span class="cx"> firstSpace = findFirstTrailingSpace(lastText, lastText.characters8(), trailingSpaceRun->start(), trailingSpaceRun->stop());
</span><span class="lines">@@ -798,7 +798,7 @@
</span><span class="cx"> firstSpace = findFirstTrailingSpace(lastText, lastText.characters16(), trailingSpaceRun->start(), trailingSpaceRun->stop());
</span><span class="cx">
</span><span class="cx"> if (firstSpace == trailingSpaceRun->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->prevRootBox()) {
</span><span class="cx"> // We have a previous line.
</span><del>- if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || !prevRootBox->lineBreakObj() || (prevRootBox->lineBreakObj()->isText() && prevRootBox->lineBreakPos() >= toRenderText(prevRootBox->lineBreakObj())->textLength())))
</del><ins>+ if (!dirtiedByFloat && (!prevRootBox->endsWithBreak() || !prevRootBox->lineBreakObj() || (is<RenderText>(*prevRootBox->lineBreakObj()) && prevRootBox->lineBreakPos() >= downcast<RenderText>(*prevRootBox->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->isText() && toRenderText(child)->isTextFragment() && nextSibling && nextSibling->isText()) {
</del><ins>+ if (is<RenderTextFragment>(*child) && is<RenderText>(nextSibling)) {
</ins><span class="cx"> RenderObject* firstLetterObj = nullptr;
</span><del>- if (RenderBlock* block = toRenderTextFragment(child)->blockForAccompanyingFirstLetter()) {
</del><ins>+ if (RenderBlock* block = downcast<RenderTextFragment>(*child).blockForAccompanyingFirstLetter()) {
</ins><span class="cx"> RenderElement* firstLetterContainer = nullptr;
</span><span class="cx"> block->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& child : childrenOfType<RenderObject>(*this)) {
</span><del>- if (child.isText() && !toRenderText(child).isAllCollapsibleWhitespace())
</del><ins>+ if (is<RenderText>(child) && !downcast<RenderText>(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->isText())
- toRenderText(newChild)->styleDidChange(StyleDifferenceEqual, nullptr);
</del><ins>+ if (is<RenderText>(newChild))
+ downcast<RenderText>(*newChild).styleDidChange(StyleDifferenceEqual, nullptr);
</ins><span class="cx">
</span><span class="cx"> // SVG creates renderers for <g display="none">, as SVG requires children of hidden
</span><span class="cx"> // <g>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->nextSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->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->isBox()) {
- RenderBox* currBox = toRenderBox(curr);
- if (currBox->inlineBoxWrapper()) {
- const RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root();
</del><ins>+ if (is<RenderBox>(*current)) {
+ RenderBox& renderBox = downcast<RenderBox>(*current);
+ if (renderBox.inlineBoxWrapper()) {
+ const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root();
</ins><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->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->inlineBoxWrapper()->x() - currBox->marginLeft(), logicalTop, currBox->width() + currBox->horizontalMarginExtent(), logicalHeight));
</del><ins>+ context.addRect(FloatRect(renderBox.inlineBoxWrapper()->x() - renderBox.marginLeft(), logicalTop, renderBox.width() + renderBox.horizontalMarginExtent(), logicalHeight));
</ins><span class="cx"> else
</span><del>- context.addRect(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, currBox->height() + currBox->verticalMarginExtent()));
</del><ins>+ context.addRect(FloatRect(logicalTop, renderBox.inlineBoxWrapper()->y() - renderBox.marginTop(), logicalHeight, renderBox.height() + renderBox.verticalMarginExtent()));
</ins><span class="cx"> }
</span><del>- } else if (curr->isRenderInline()) {
</del><ins>+ } else if (is<RenderInline>(*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->alwaysCreateLineBoxes())
- currInline->generateCulledLineBoxRects(context, container);
</del><ins>+ RenderInline& renderInline = downcast<RenderInline>(*current);
+ if (!renderInline.alwaysCreateLineBoxes())
+ renderInline.generateCulledLineBoxRects(context, container);
</ins><span class="cx"> else {
</span><del>- for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
</del><ins>+ for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox()) {
</ins><span class="cx"> const RootInlineBox& rootBox = childLine->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->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->isText()) {
- RenderText* currText = toRenderText(curr);
- for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
</del><ins>+ } else if (is<RenderText>(*current)) {
+ RenderText& currText = downcast<RenderText>(*current);
+ for (InlineTextBox* childText = currText.firstTextBox(); childText; childText = childText->nextTextBox()) {
</ins><span class="cx"> const RootInlineBox& rootBox = childText->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->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->y(), logicalHeight, childText->logicalWidth()));
</span><span class="cx"> }
</span><del>- } else if (curr->isLineBreak()) {
- if (InlineBox* inlineBox = toRenderLineBreak(curr)->inlineBoxWrapper()) {
</del><ins>+ } else if (is<RenderLineBreak>(*current)) {
+ if (InlineBox* inlineBox = downcast<RenderLineBreak>(*current).inlineBoxWrapper()) {
</ins><span class="cx"> // FIXME: This could use a helper to share these with text path.
</span><span class="cx"> const RootInlineBox& rootBox = inlineBox->root();
</span><span class="cx"> const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->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->nextSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->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->isBox())
- return toRenderBox(curr)->inlineBoxWrapper();
- if (curr->isLineBreak()) {
- RenderLineBreak* renderBR = toRenderLineBreak(curr);
- if (renderBR->inlineBoxWrapper())
- return renderBR->inlineBoxWrapper();
- } else if (curr->isRenderInline()) {
- RenderInline* currInline = toRenderInline(curr);
- InlineBox* result = currInline->firstLineBoxIncludingCulling();
- if (result)
</del><ins>+ if (is<RenderBox>(*current))
+ return downcast<RenderBox>(*current).inlineBoxWrapper();
+ if (is<RenderLineBreak>(*current)) {
+ RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
+ if (renderBR.inlineBoxWrapper())
+ return renderBR.inlineBoxWrapper();
+ } else if (is<RenderInline>(*current)) {
+ RenderInline& renderInline = downcast<RenderInline>(*current);
+ if (InlineBox* result = renderInline.firstLineBoxIncludingCulling())
</ins><span class="cx"> return result;
</span><del>- } else if (curr->isText()) {
- RenderText* currText = toRenderText(curr);
- if (currText->firstTextBox())
- return currText->firstTextBox();
</del><ins>+ } else if (is<RenderText>(*current)) {
+ RenderText& renderText = downcast<RenderText>(*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->previousSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = lastChild(); current; current = current->previousSibling()) {
+ if (current->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->isBox())
- return toRenderBox(curr)->inlineBoxWrapper();
- if (curr->isLineBreak()) {
- RenderLineBreak* renderBR = toRenderLineBreak(curr);
- if (renderBR->inlineBoxWrapper())
- return renderBR->inlineBoxWrapper();
- } else if (curr->isRenderInline()) {
- RenderInline* currInline = toRenderInline(curr);
- InlineBox* result = currInline->lastLineBoxIncludingCulling();
- if (result)
</del><ins>+ if (is<RenderBox>(*current))
+ return downcast<RenderBox>(*current).inlineBoxWrapper();
+ if (is<RenderLineBreak>(*current)) {
+ RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
+ if (renderBR.inlineBoxWrapper())
+ return renderBR.inlineBoxWrapper();
+ } else if (is<RenderInline>(*current)) {
+ RenderInline& renderInline = downcast<RenderInline>(*current);
+ if (InlineBox* result = renderInline.lastLineBoxIncludingCulling())
</ins><span class="cx"> return result;
</span><del>- } else if (curr->isText()) {
- RenderText* currText = toRenderText(curr);
- if (currText->lastTextBox())
- return currText->lastTextBox();
</del><ins>+ } else if (is<RenderText>(*current)) {
+ RenderText& renderText = downcast<RenderText>(*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->nextSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->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->isBox()) {
- RenderBox* currBox = toRenderBox(curr);
- if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) {
- LayoutRect logicalRect = currBox->logicalVisualOverflowRectForPropagation(&style());
</del><ins>+ if (is<RenderBox>(*current)) {
+ RenderBox& renderBox = downcast<RenderBox>(*current);
+ if (!renderBox.hasSelfPaintingLayer() && renderBox.inlineBoxWrapper()) {
+ LayoutRect logicalRect = renderBox.logicalVisualOverflowRectForPropagation(&style());
</ins><span class="cx"> if (isHorizontal) {
</span><del>- logicalRect.moveBy(currBox->location());
</del><ins>+ logicalRect.moveBy(renderBox.location());
</ins><span class="cx"> result.uniteIfNonZero(logicalRect);
</span><span class="cx"> } else {
</span><del>- logicalRect.moveBy(currBox->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->isRenderInline()) {
</del><ins>+ } else if (is<RenderInline>(*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->alwaysCreateLineBoxes())
- result.uniteIfNonZero(currInline->culledInlineVisualOverflowBoundingBox());
- else if (!currInline->hasSelfPaintingLayer())
- result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox());
- } else if (curr->isText()) {
</del><ins>+ RenderInline& renderInline = downcast<RenderInline>(*current);
+ if (!renderInline.alwaysCreateLineBoxes())
+ result.uniteIfNonZero(renderInline.culledInlineVisualOverflowBoundingBox());
+ else if (!renderInline.hasSelfPaintingLayer())
+ result.uniteIfNonZero(renderInline.linesVisualOverflowBoundingBox());
+ } else if (is<RenderText>(*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->linesVisualOverflowBoundingBox());
</del><ins>+ RenderText& renderText = downcast<RenderText>(*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->nextSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
+ if (current->isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><del>- if (curr->isBox() && !curr->needsLayout()) {
- RenderBox* currBox = toRenderBox(curr);
- if (currBox->inlineBoxWrapper())
- currBox->inlineBoxWrapper()->root().markDirty();
- } else if (!curr->selfNeedsLayout()) {
- if (curr->isRenderInline()) {
- RenderInline* currInline = toRenderInline(curr);
- for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; childLine = childLine->nextLineBox())
</del><ins>+ if (is<RenderBox>(*current) && !current->needsLayout()) {
+ RenderBox& renderBox = downcast<RenderBox>(*current);
+ if (renderBox.inlineBoxWrapper())
+ renderBox.inlineBoxWrapper()->root().markDirty();
+ } else if (!current->selfNeedsLayout()) {
+ if (is<RenderInline>(*current)) {
+ RenderInline& renderInline = downcast<RenderInline>(*current);
+ for (InlineFlowBox* childLine = renderInline.firstLineBox(); childLine; childLine = childLine->nextLineBox())
</ins><span class="cx"> childLine->root().markDirty();
</span><del>- } else if (curr->isText()) {
- RenderText* currText = toRenderText(curr);
- for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox())
</del><ins>+ } else if (is<RenderText>(*current)) {
+ RenderText& renderText = downcast<RenderText>(*current);
+ for (InlineTextBox* childText = renderText.firstTextBox(); childText; childText = childText->nextTextBox())
</ins><span class="cx"> childText->root().markDirty();
</span><del>- } else if (curr->isLineBreak()) {
- RenderLineBreak* currBR = toRenderLineBreak(curr);
- if (currBR->inlineBoxWrapper())
- currBR->inlineBoxWrapper()->root().markDirty();
</del><ins>+ } else if (is<RenderLineBreak>(*current)) {
+ RenderLineBreak& renderBR = downcast<RenderLineBreak>(*current);
+ if (renderBR.inlineBoxWrapper())
+ renderBR.inlineBoxWrapper()->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&, 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<InlineFlowBox> 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 > maxSiblingCount)
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (child.isText()) {
</del><ins>+ if (is<RenderText>(child)) {
</ins><span class="cx"> bool isSelectable = renderer.style().userSelect() != SELECT_NONE;
</span><del>- if (isSelectable || !toRenderText(child).isAllCollapsibleWhitespace())
</del><ins>+ if (isSelectable || !downcast<RenderText>(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<RenderElement>(child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- const RenderElement& renderElementChild = toRenderElement(child);
</del><ins>+ const RenderElement& renderElementChild = downcast<RenderElement>(child);
</ins><span class="cx">
</span><span class="cx"> if (renderElementChild.isRenderLayerModelObject() && 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->previousSibling(); curr; curr = curr->previousSibling()) {
- if (curr->isFloatingOrOutOfFlowPositioned())
</del><ins>+ RootInlineBox* box = nullptr;
+ RenderObject* current;
+ for (current = child->previousSibling(); current; current = current->previousSibling()) {
+ if (current->isFloatingOrOutOfFlowPositioned())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (curr->isReplaced()) {
- if (auto wrapper = toRenderBox(curr)->inlineBoxWrapper())
</del><ins>+ if (current->isReplaced()) {
+ if (auto wrapper = downcast<RenderBox>(*current).inlineBoxWrapper())
</ins><span class="cx"> box = &wrapper->root();
</span><del>- } if (curr->isLineBreak()) {
- if (auto wrapper = toRenderLineBreak(curr)->inlineBoxWrapper())
</del><ins>+ } if (is<RenderLineBreak>(*current)) {
+ if (auto wrapper = downcast<RenderLineBreak>(*current).inlineBoxWrapper())
</ins><span class="cx"> box = &wrapper->root();
</span><del>- } else if (curr->isText()) {
- InlineTextBox* textBox = toRenderText(curr)->lastTextBox();
- if (textBox)
</del><ins>+ } else if (is<RenderText>(*current)) {
+ if (InlineTextBox* textBox = downcast<RenderText>(*current).lastTextBox())
</ins><span class="cx"> box = &textBox->root();
</span><del>- } else if (curr->isRenderInline()) {
- InlineBox* lastSiblingBox = toRenderInline(curr)->lastLineBoxIncludingCulling();
</del><ins>+ } else if (is<RenderInline>(*current)) {
+ InlineBox* lastSiblingBox = downcast<RenderInline>(*current).lastLineBoxIncludingCulling();
</ins><span class="cx"> if (lastSiblingBox)
</span><span class="cx"> box = &lastSiblingBox->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->lineBreakObj() == child->previousSibling();
</span><del>- if (adjacentBox && (adjacentBox->lineBreakObj() == child || child->isBR() || (curr && curr->isBR())
</del><ins>+ if (adjacentBox && (adjacentBox->lineBreakObj() == child || child->isBR() || (current && current->isBR())
</ins><span class="cx"> || insertedAfterLeadingSpace || isIsolated(container->style().unicodeBidi())))
</span><span class="cx"> adjacentBox->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->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->isRenderInline())
- boundingBox = toRenderInline(renderer)->linesBoundingBox();
- else if (renderer->isText())
- boundingBox = toRenderText(renderer)->linesBoundingBox();
- else if (renderer->isLineBreak())
- boundingBox = toRenderLineBreak(renderer)->linesBoundingBox();
</del><ins>+ if (is<RenderInline>(*renderer))
+ boundingBox = downcast<RenderInline>(*renderer).linesBoundingBox();
+ else if (is<RenderText>(*renderer))
+ boundingBox = downcast<RenderText>(*renderer).linesBoundingBox();
+ else if (is<RenderLineBreak>(*renderer))
+ boundingBox = downcast<RenderLineBreak>(*renderer).linesBoundingBox();
</ins><span class="cx"> else if (renderer->isBox()) {
</span><del>- boundingBox = toRenderBox(renderer)->frameRect();
- if (toRenderBox(renderer)->isRelPositioned())
- boundingBox.move(toRenderBox(renderer)->relativePositionLogicalOffset());
</del><ins>+ RenderBox& renderBox = downcast<RenderBox>(*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 < logicalTopForRegion && startsAboveRegion) {
</span><del>- if (renderer->isText()) {
</del><ins>+ if (is<RenderText>(*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->firstTextBox(); box; box = box->nextTextBox()) {
</del><ins>+ RenderText& textRenderer = downcast<RenderText>(*renderer);
+ for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box->nextTextBox()) {
</ins><span class="cx"> if (offsetTop + box->logicalBottom() < logicalTopForRegion)
</span><span class="cx"> continue;
</span><span class="cx"> range->setStart(Position(downcast<Text>(node), box->start()));
</span><span class="lines">@@ -742,11 +743,11 @@
</span><span class="cx"> // end position
</span><span class="cx"> if (logicalBottomForRegion < logicalBottomForRenderer && (endsBelowRegion || (!endsBelowRegion && !node->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->isText()) {
</del><ins>+ if (is<RenderText>(*renderer)) {
</ins><span class="cx"> // Text crosses region bottom
</span><del>- RenderText* textRenderer = toRenderText(renderer);
</del><ins>+ RenderText& textRenderer = downcast<RenderText>(*renderer);
</ins><span class="cx"> InlineTextBox* lastBox = nullptr;
</span><del>- for (InlineTextBox* box = textRenderer->firstTextBox(); box; box = box->nextTextBox()) {
</del><ins>+ for (InlineTextBox* box = textRenderer.firstTextBox(); box; box = box->nextTextBox()) {
</ins><span class="cx"> if ((offsetTop + box->logicalTop()) < 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& rubyTextStyle = firstLine ? rubyText->firstLineStyle() : rubyText->style();
</span><span class="cx"> int halfWidthOfFontSize = rubyTextStyle.fontSize() / 2;
</span><span class="cx"> if (startOverhang)
</span><del>- startOverhang = std::min<int>(startOverhang, std::min<int>(toRenderText(startRenderer)->minLogicalWidth(), halfWidthOfFontSize));
</del><ins>+ startOverhang = std::min<int>(startOverhang, std::min<int>(downcast<RenderText>(*startRenderer).minLogicalWidth(), halfWidthOfFontSize));
</ins><span class="cx"> if (endOverhang)
</span><del>- endOverhang = std::min<int>(endOverhang, std::min<int>(toRenderText(endRenderer)->minLogicalWidth(), halfWidthOfFontSize));
</del><ins>+ endOverhang = std::min<int>(endOverhang, std::min<int>(downcast<RenderText>(*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<RenderText>(renderer))
+ m_rect = downcast<RenderText>(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 "Range.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderCombineText.h"
</span><ins>+#include "RenderInline.h"
</ins><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "Settings.h"
</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& renderer)
</ins><span class="cx"> {
</span><del>- if (o->isRenderInline())
</del><ins>+ if (is<RenderInline>(renderer))
</ins><span class="cx"> return true;
</span><del>- if (!o->isText())
</del><ins>+ if (!is<RenderText>(renderer))
</ins><span class="cx"> return false;
</span><del>- StringImpl* text = toRenderText(o)->text();
</del><ins>+ StringImpl* text = downcast<RenderText>(renderer).text();
</ins><span class="cx"> if (!text)
</span><span class="cx"> return true;
</span><span class="cx"> return !text->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->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 && previousText->isText())
- if (StringImpl* previousString = toRenderText(previousText)->text())
</del><ins>+ if (is<RenderText>(previousText)) {
+ if (StringImpl* previousString = downcast<RenderText>(*previousText).text())
</ins><span class="cx"> prev = (*previousString)[previousString->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 < 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<RenderText>(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() && toRenderText(renderer).isTextFragment())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><del>-SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTextFragment, isText() && toRenderText(renderer).isTextFragment())
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderTextFragment)
+ static bool isType(const WebCore::RenderText& renderer) { return renderer.isTextFragment(); }
+ static bool isType(const WebCore::RenderObject& renderer) { return is<WebCore::RenderText>(renderer) && isType(downcast<WebCore::RenderText>(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->isTableCell() : false;
</span><span class="cx">
</span><span class="cx"> LayoutRect r;
</span><del>- if (o.isText()) {
</del><ins>+ if (is<RenderText>(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& text = toRenderText(o);
</del><ins>+ const RenderText& text = downcast<RenderText>(o);
</ins><span class="cx"> r = IntRect(text.firstRunLocation(), text.linesBoundingBox().size());
</span><span class="cx"> if (!text.firstTextBox() && !text.simpleLineLayout())
</span><span class="cx"> adjustForTableCells = false;
</span><span class="cx"> } else if (o.isBR()) {
</span><del>- const RenderLineBreak& br = toRenderLineBreak(o);
</del><ins>+ const RenderLineBreak& br = downcast<RenderLineBreak>(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& inlineFlow = toRenderInline(o);
</del><ins>+ } else if (is<RenderInline>(o)) {
+ const RenderInline& inlineFlow = downcast<RenderInline>(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<RenderTableCell>(o)) {
</ins><span class="cx"> // FIXME: Deliberately dump the "inner" 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& cell = *toRenderTableCell(&o);
</del><ins>+ const RenderTableCell& cell = downcast<RenderTableCell>(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<RenderBox>(o))
+ r = downcast<RenderBox>(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 << " [textStrokeWidth=" << o.style().textStrokeWidth() << "]";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!o.isBoxModelObject() || o.isLineBreak())
</del><ins>+ if (!is<RenderBoxModelObject>(o) || is<RenderLineBreak>(o))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- const RenderBoxModelObject& box = toRenderBoxModelObject(o);
</del><ins>+ const RenderBoxModelObject& box = downcast<RenderBoxModelObject>(o);
</ins><span class="cx"> if (box.borderTop() || box.borderRight() || box.borderBottom() || box.borderLeft()) {
</span><span class="cx"> ts << " [border:";
</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& c = *toRenderTableCell(&o);
</del><ins>+ if (is<RenderTableCell>(o)) {
+ const RenderTableCell& c = downcast<RenderTableCell>(o);
</ins><span class="cx"> ts << " [r=" << c.rowIndex() << " c=" << c.col() << " rs=" << c.rowSpan() << " cs=" << c.colSpan() << "]";
</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<RenderDetailsMarker>(o)) {
</ins><span class="cx"> ts << ": ";
</span><del>- switch (toRenderDetailsMarker(o).orientation()) {
</del><ins>+ switch (downcast<RenderDetailsMarker>(o).orientation()) {
</ins><span class="cx"> case RenderDetailsMarker::Left:
</span><span class="cx"> ts << "left";
</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<RenderListMarker>(o)) {
+ String text = downcast<RenderListMarker>(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 << ")";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (behavior & RenderAsTextShowOverflow && o.isBox()) {
- const RenderBox& box = toRenderBox(o);
</del><ins>+ if (behavior & RenderAsTextShowOverflow && is<RenderBox>(o)) {
+ const RenderBox& box = downcast<RenderBox>(o);
</ins><span class="cx"> if (box.hasRenderOverflow()) {
</span><span class="cx"> LayoutRect layoutOverflow = box.layoutOverflowRect();
</span><span class="cx"> ts << " (layout overflow " << layoutOverflow.x().toInt() << "," << layoutOverflow.y().toInt() << " " << layoutOverflow.width().toInt() << "x" << layoutOverflow.height().toInt() << ")";
</span><span class="lines">@@ -500,36 +500,36 @@
</span><span class="cx">
</span><span class="cx"> void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior)
</span><span class="cx"> {
</span><del>- if (o.isSVGShape()) {
- write(ts, *toRenderSVGShape(&o), indent);
</del><ins>+ if (is<RenderSVGShape>(o)) {
+ write(ts, downcast<RenderSVGShape>(o), indent);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><del>- if (o.isSVGGradientStop()) {
- writeSVGGradientStop(ts, *toRenderSVGGradientStop(&o), indent);
</del><ins>+ if (is<RenderSVGGradientStop>(o)) {
+ writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(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<RenderSVGResourceContainer>(o)) {
+ writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(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<RenderSVGContainer>(o)) {
+ writeSVGContainer(ts, downcast<RenderSVGContainer>(o), indent);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><del>- if (o.isSVGRoot()) {
- write(ts, *toRenderSVGRoot(&o), indent);
</del><ins>+ if (is<RenderSVGRoot>(o)) {
+ write(ts, downcast<RenderSVGRoot>(o), indent);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><del>- if (o.isSVGText()) {
- writeSVGText(ts, *toRenderSVGText(&o), indent);
</del><ins>+ if (is<RenderSVGText>(o)) {
+ writeSVGText(ts, downcast<RenderSVGText>(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<RenderSVGInlineText>(o)) {
+ writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), indent);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><del>- if (o.isSVGImage()) {
- writeSVGImage(ts, *toRenderSVGImage(&o), indent);
</del><ins>+ if (is<RenderSVGImage>(o)) {
+ writeSVGImage(ts, downcast<RenderSVGImage>(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 << "\n";
</span><span class="cx">
</span><del>- if (o.isText()) {
- auto& text = toRenderText(o);
</del><ins>+ if (is<RenderText>(o)) {
+ auto& text = downcast<RenderText>(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->nextSibling()) {
</del><ins>+ for (RenderObject* child = downcast<RenderElement>(o).firstChild(); child; child = child->nextSibling()) {
</ins><span class="cx"> if (child->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 <blockflow><inline>#text</inline></blockflow> 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()->isText())
</del><ins>+ if (!is<RenderText>(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& textRenderer = toRenderText(*flow.firstChild());
</del><ins>+ const RenderText& textRenderer = downcast<RenderText>(*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& textRenderer = toRenderText(*flow.firstChild());
</del><ins>+ RenderText& textRenderer = downcast<RenderText>(*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& textRenderer = toRenderText(*flow.firstChild());
</del><ins>+ RenderText& textRenderer = downcast<RenderText>(*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& textRenderer = toRenderText(*flow.firstChild());
</del><ins>+ RenderText& textRenderer = downcast<RenderText>(*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& flow, const Layout& layout)
</span><span class="cx"> : m_layout(layout)
</span><del>- , m_string(toRenderText(*flow.firstChild()).text())
</del><ins>+ , m_string(downcast<RenderText>(*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->renderer());
- renderText->setCandidateComputedTextSize(size);
</del><ins>+ downcast<RenderText>(*node->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->isText() && toRenderText(renderer)->text()->stripWhiteSpace()->length() > 3)
</del><ins>+ if (is<RenderText>(*renderer) && downcast<RenderText>(*renderer).text()->stripWhiteSpace()->length() > 3)
</ins><span class="cx"> return false;
</span><span class="cx"> if (!renderer->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 && descendant->isText()) {
- textWidth += toRenderText(descendant)->renderedTextLength() * descendant->style()->specifiedFontSize();
- } else if (isAutosizingContainer(descendant)) {
</del><ins>+ if (!skipLocalText && is<RenderText>(*descendant))
+ textWidth += downcast<RenderText>(*descendant).renderedTextLength() * descendant->style()->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& 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(&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->isText() && !toRenderText(child)->textLength());
</del><ins>+ return !child || (is<RenderText>(*child) && !downcast<RenderText>(*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 && next->isFloatingOrOutOfFlowPositioned())
</span><span class="cx"> next = bidiNextSkippingEmptyInlines(block, next);
</span><span class="cx">
</span><del>- if (next && next->isText() && toRenderText(next)->textLength() > 0) {
- RenderText* nextText = toRenderText(next);
- UChar nextChar = nextText->characterAt(0);
- if (nextText->style().isCollapsibleWhiteSpace(nextChar)) {
- lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0));
</del><ins>+ if (is<RenderText>(next) && downcast<RenderText>(*next).textLength() > 0) {
+ RenderText& nextText = downcast<RenderText>(*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& renderText = downcast<RenderText>(*m_current.renderer());
</ins><span class="cx">
</span><del>- bool isSVGText = renderText->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 && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces)
</span><del>- commitLineBreakAtCurrentWidth(m_current.renderer());
</del><ins>+ commitLineBreakAtCurrentWidth(renderText);
</ins><span class="cx">
</span><del>- if (renderText->style().hasTextCombine() && m_current.renderer()->isCombineText() && !toRenderCombineText(*m_current.renderer()).isCombined()) {
</del><ins>+ if (renderText.style().hasTextCombine() && m_current.renderer()->isCombineText() && !toRenderCombineText(*m_current.renderer()).isCombined()) {
</ins><span class="cx"> RenderCombineText& 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& style = lineStyle(*renderText->parent(), m_lineInfo);
</del><ins>+ const RenderStyle& style = lineStyle(*renderText.parent(), m_lineInfo);
</ins><span class="cx"> const Font& font = style.font();
</span><span class="cx"> bool isFixedPitch = font.isFixedPitch();
</span><span class="cx"> bool canHyphenate = style.hyphens() == HyphensAuto && 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 != &renderText) {
+ updateCounterIfNeeded(renderText);
+ m_renderTextInfo.m_text = &renderText;
</ins><span class="cx"> m_renderTextInfo.m_font = &font;
</span><del>- m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
- m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(renderText->text(), style.locale());
</del><ins>+ m_renderTextInfo.m_layout = font.createLayout(&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 && m_renderTextInfo.m_font != &font) {
</span><span class="cx"> m_renderTextInfo.m_font = &font;
</span><del>- m_renderTextInfo.m_layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
</del><ins>+ m_renderTextInfo.m_layout = font.createLayout(&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<const SimpleFontData*> fallbackFonts;
</span><del>- float wordTrailingSpaceWidth = (font.typesettingFeatures() & Kerning) && !textLayout ? font.width(RenderBlock::constructTextRun(renderText, font, &space, 1, style), &fallbackFonts) + wordSpacing : 0;
</del><ins>+ float wordTrailingSpaceWidth = (font.typesettingFeatures() & Kerning) && !textLayout ? font.width(RenderBlock::constructTextRun(&renderText, font, &space, 1, style), &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() < renderText->textLength(); m_current.fastIncrementInTextNode()) {
</del><ins>+ for (; m_current.offset() < 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, &m_block, &m_width);
</span><span class="cx">
</span><span class="cx"> if (c == softHyphen && m_autoWrap && !hyphenWidth && style.hyphens() != HyphensNone) {
</span><del>- hyphenWidth = measureHyphenWidth(renderText, font, &fallbackFonts);
</del><ins>+ hyphenWidth = measureHyphenWidth(&renderText, font, &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) && !midWordBreak && (!m_currentCharacterIsSpace || style.whiteSpace() != PRE_WRAP)) {
</span><span class="cx"> wrapW += charWidth;
</span><del>- bool midWordBreakIsBeforeSurrogatePair = U16_IS_LEAD(c) && m_current.offset() + 1 < renderText->textLength() && 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) && m_current.offset() + 1 < renderText.textLength() && 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);
</ins><span class="cx"> midWordBreak = m_width.committedWidth() + wrapW + charWidth > 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& wordMeasurement = wordMeasurements.last();
</span><span class="cx">
</span><del>- wordMeasurement.renderer = renderText;
</del><ins>+ wordMeasurement.renderer = &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 && 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(&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(&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() && !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() && m_currentCharacterIsWS && m_currentStyle->breakOnlyAfterWhiteSpace() && !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(&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 && !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(&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() && m_lineBreak.offset() && m_lineBreak.renderer()->isText() && toRenderText(m_lineBreak.renderer())->textLength() && toRenderText(m_lineBreak.renderer())->characterAt(m_lineBreak.offset() - 1) == softHyphen && style.hyphens() != HyphensNone)
</del><ins>+ if (m_lineBreak.offset() && downcast<RenderText>(m_lineBreak.renderer()) && downcast<RenderText>(*m_lineBreak.renderer()).textLength() && downcast<RenderText>(*m_lineBreak.renderer()).characterAt(m_lineBreak.offset() - 1) == softHyphen && style.hyphens() != HyphensNone)
</ins><span class="cx"> hyphenated = true;
</span><span class="cx"> if (m_lineBreak.offset() && m_lineBreak.offset() != (unsigned)wordMeasurement.endOffset && !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 && 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)->characterStartsNewTextChunk(m_current.offset()))
</del><ins>+ if (downcast<RenderSVGInlineText>(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 && m_startOfIgnoredSpaces.offset() && m_nextObject->isBR() && (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->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 && m_currentCharacterIsSpace && !m_ignoringSpaces)
</span><del>- m_trailingObjects.setTrailingWhitespace(toRenderText(m_current.renderer()));
</del><ins>+ m_trailingObjects.setTrailingWhitespace(downcast<RenderText>(m_current.renderer()));
</ins><span class="cx"> else if (!m_currentStyle->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& wordMeasurement = wordMeasurements.last();
</span><del>- wordMeasurement.renderer = renderText;
</del><ins>+ wordMeasurement.renderer = &renderText;
</ins><span class="cx">
</span><span class="cx"> // IMPORTANT: current.m_pos is > 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(&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(&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 && m_lineBreak.previousInSameNode() == softHyphen && 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& nextText)
</ins><span class="cx"> {
</span><del>- ASSERT(next->isText());
- RenderText* nextText = toRenderText(next);
- if (!nextText->textLength())
- return false;
- UChar c = nextText->characterAt(0);
- return c == ' ' || c == '\t' || (c == '\n' && !nextText->preservesNewline());
</del><ins>+ UChar c = nextText.characterAt(0);
+ return c == ' ' || c == '\t' || (c == '\n' && !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()->isRenderInline() && isEmptyInline(toRenderInline(*m_current.renderer())))
</del><ins>+ if (is<RenderInline>(*m_current.renderer()) && isEmptyInline(downcast<RenderInline>(*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 && m_nextObject->isRenderInline() && isEmptyInline(toRenderInline(*m_nextObject)))
</del><ins>+ if (is<RenderInline>(m_nextObject) && isEmptyInline(downcast<RenderInline>(*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 && m_nextObject->isLineBreakOpportunity())
</span><span class="cx"> return m_autoWrap;
</span><span class="cx">
</span><del>- bool nextIsAutoWrappingText = (m_nextObject && m_nextObject->isText() && (m_autoWrap || m_nextObject->style().autoWrap()));
</del><ins>+ bool nextIsAutoWrappingText = is<RenderText>(m_nextObject) && (m_autoWrap || m_nextObject->style().autoWrap());
</ins><span class="cx"> if (!nextIsAutoWrappingText)
</span><span class="cx"> return m_autoWrap;
</span><del>- bool currentIsTextOrEmptyInline = m_current.renderer()->isText() || (m_current.renderer()->isRenderInline() && isEmptyInline(toRenderInline(*m_current.renderer())));
</del><ins>+ RenderText& nextRenderText = downcast<RenderText>(*m_nextObject);
+ bool currentIsTextOrEmptyInline = is<RenderText>(*m_current.renderer()) || (is<RenderInline>(*m_current.renderer()) && isEmptyInline(downcast<RenderInline>(*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 && textBeginsWithBreakablePosition(m_nextObject);
</del><ins>+ bool canBreakHere = !m_currentCharacterIsSpace && 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() && !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 && 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()->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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() 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 <mitz@apple.com>
</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 <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/FrameLoader.h>
</span><span class="cx"> #import <WebCore/FrameLoaderClient.h>
</span><ins>+#import <WebCore/RenderInline.h>
</ins><span class="cx"> #import <WebCore/RenderText.h>
</span><span class="cx"> #import <WebCore/RenderWidget.h>
</span><span class="cx"> #import <WebCore/RenderView.h>
</span><span class="lines">@@ -94,10 +95,10 @@
</span><span class="cx">
</span><span class="cx"> NSString *name = [[NSString alloc] initWithUTF8String:node->renderName()];
</span><span class="cx">
</span><del>- RenderWidget* renderWidget = node->isWidget() ? toRenderWidget(node) : 0;
- Widget* widget = renderWidget ? renderWidget->widget() : 0;
- FrameView* frameView = widget && widget->isFrameView() ? toFrameView(widget) : 0;
- Frame* frame = frameView ? &frameView->frame() : 0;
</del><ins>+ RenderWidget* renderWidget = node->isWidget() ? toRenderWidget(node) : nullptr;
+ Widget* widget = renderWidget ? renderWidget->widget() : nullptr;
+ FrameView* frameView = widget && widget->isFrameView() ? toFrameView(widget) : nullptr;
+ Frame* frame = frameView ? &frameView->frame() : nullptr;
</ins><span class="cx">
</span><span class="cx"> // FIXME: broken with transforms
</span><span class="cx"> FloatPoint absPos = node->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->isBox()) {
- RenderBox* box = toRenderBox(node);
- x = box->x();
- y = box->y();
- width = box->width();
- height = box->height();
- } else if (node->isText()) {
</del><ins>+ if (is<RenderBox>(*node)) {
+ RenderBox& box = downcast<RenderBox>(*node);
+ x = box.x();
+ y = box.y();
+ width = box.width();
+ height = box.height();
+ } else if (is<RenderText>(*node)) {
</ins><span class="cx"> // FIXME: Preserve old behavior even though it's strange.
</span><del>- RenderText* text = toRenderText(node);
- IntPoint firstRunLocation = text->firstRunLocation();
</del><ins>+ RenderText& text = downcast<RenderText>(*node);
+ IntPoint firstRunLocation = text.firstRunLocation();
</ins><span class="cx"> x = firstRunLocation.x();
</span><span class="cx"> y = firstRunLocation.y();
</span><del>- IntRect box = text->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->isRenderInline()) {
- RenderBoxModelObject* inlineFlow = toRenderBoxModelObject(node);
- IntRect boundingBox = inlineFlow->borderBoundingBox();
</del><ins>+ } else if (is<RenderInline>(*node)) {
+ RenderInline& inlineFlow = downcast<RenderInline>(*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 <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Use is<>() / downcast<>() for RenderText / RenderTextFragment
+ https://bugs.webkit.org/show_bug.cgi?id=137476
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() for RenderText / RenderTextFragment.
+
+ * Shared/WebRenderObject.cpp:
+ (WebKit::WebRenderObject::WebRenderObject):
+
+2014-10-07 Christophe Dumez <cdumez@apple.com>
+
</ins><span class="cx"> [WK2] Use is<>() / downcast<>() 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 <WebCore/FrameLoader.h>
</span><span class="cx"> #include <WebCore/FrameLoaderClient.h>
</span><span class="cx"> #include <WebCore/MainFrame.h>
</span><ins>+#include <WebCore/RenderInline.h>
</ins><span class="cx"> #include <WebCore/RenderText.h>
</span><span class="cx"> #include <WebCore/RenderView.h>
</span><span class="cx"> #include <WebCore/RenderWidget.h>
</span><span class="lines">@@ -87,13 +88,13 @@
</span><span class="cx"> // FIXME: broken with transforms
</span><span class="cx"> m_absolutePosition = flooredIntPoint(renderer->localToAbsolute());
</span><span class="cx">
</span><del>- if (renderer->isBox())
- m_frameRect = snappedIntRect(toRenderBox(renderer)->frameRect());
- else if (renderer->isText()) {
- m_frameRect = toRenderText(renderer)->linesBoundingBox();
- m_frameRect.setLocation(toRenderText(renderer)->firstRunLocation());
- } else if (renderer->isRenderInline())
- m_frameRect = toRenderBoxModelObject(renderer)->borderBoundingBox();
</del><ins>+ if (is<RenderBox>(*renderer))
+ m_frameRect = snappedIntRect(downcast<RenderBox>(*renderer).frameRect());
+ else if (is<RenderText>(*renderer)) {
+ m_frameRect = downcast<RenderText>(*renderer).linesBoundingBox();
+ m_frameRect.setLocation(downcast<RenderText>(*renderer).firstRunLocation());
+ } else if (is<RenderInline>(*renderer))
+ m_frameRect = downcast<RenderInline>(*renderer).borderBoundingBox();
</ins><span class="cx">
</span><span class="cx"> if (!shouldIncludeDescendants)
</span><span class="cx"> return;
</span></span></pre>
</div>
</div>
</body>
</html>