<!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>[174480] 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/174480">174480</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-08 16:33:43 -0700 (Wed, 08 Oct 2014)</dd>
</dl>

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

Reviewed by Darin Adler.

Source/WebCore:

Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects and clean up the
surrounding code.

No new tests, no behavior change.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildConsideringContinuation):
(WebCore::lastChildConsideringContinuation):
(WebCore::AccessibilityRenderObject::firstChild):
(WebCore::startOfContinuations):
(WebCore::endOfContinuations):
(WebCore::childBeforeConsideringContinuations):
(WebCore::AccessibilityRenderObject::previousSibling):
(WebCore::AccessibilityRenderObject::nextSibling):
(WebCore::nextContinuation):
(WebCore::AccessibilityRenderObject::renderParentObject):
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::setValue):
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMNode containsOnlyInlineObjects]):
(-[DOMNode isSelectableBlock]):
(-[DOMHTMLElement structuralComplexityContribution]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
* editing/TextIterator.cpp:
(WebCore::TextIterator::shouldRepresentNodeOffsetZero):
* page/ios/FrameIOS.mm:
(WebCore::Frame::preferredHeight):
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::containingBlockForFixedPosition):
(WebCore::containingBlockForAbsolutePosition):
(WebCore::containingBlockForObjectInFlow):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleWillChange):
(WebCore::RenderBlock::continuationBefore):
(WebCore::RenderBlock::splitBlocks):
(WebCore::RenderBlock::addChildIgnoringContinuation):
(WebCore::canMergeAnonymousBlock):
(WebCore::canMergeContiguousAnonymousBlocks):
(WebCore::RenderBlock::collapseAnonymousBoxChild):
(WebCore::RenderBlock::removeChild):
(WebCore::RenderBlock::blockElementContinuation):
(WebCore::RenderBlock::blockSelectionGaps):
(WebCore::RenderBlock::blockBeforeWithinSelectionRoot):
(WebCore::isChildHitTestCandidate):
(WebCore::RenderBlock::firstLineBlock):
(WebCore::findFirstLetterBlock):
(WebCore::RenderBlock::childBecameNonInline):
(WebCore::RenderBlock::hasMarginBeforeQuirk):
(WebCore::RenderBlock::hasMarginAfterQuirk):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::positionNewFloatOnLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
(WebCore::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
* rendering/RenderBoxModelObject.cpp:
(WebCore::accumulateInFlowPositionOffsets):
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::propagateStyleToAnonymousChildren):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::inlineElementContinuation):
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):
(WebCore::nextContinuation):
(WebCore::RenderInline::splitFlow):
(WebCore::RenderInline::positionForPoint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderListItem.cpp:
(WebCore::getParentOfFirstLineBox):
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
* rendering/RenderObject.cpp:
(WebCore::includeNonFixedHeight):
(WebCore::RenderObject::checkBlockPositionedObjectsNeedLayout):
(WebCore::RenderObject::containingBlock):
(WebCore::RenderObject::handleDynamicFloatPositionChange):
(WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary):
(WebCore::RenderObject::getTextDecorationColors):
* rendering/RenderRuby.cpp:
(WebCore::rubyBeforeBlock):
(WebCore::rubyAfterBlock):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveInlineChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processSubtree):
(WebCore::TextAutosizer::processContainer):
(WebCore::TextAutosizer::measureDescendantTextWidth):
(WebCore::TextAutosizer::findDeepestBlockContainingAllText):
(WebCore::TextAutosizer::findFirstTextLeafNotInCluster):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layout):

Source/WebKit2:

Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects and clean up the
surrounding code.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):
(WebKit::WebPage::contractedRangeFromHandle):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageiosFrameIOSmm">trunk/Source/WebCore/page/ios/FrameIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingLogicalSelectionOffsetCachesh">trunk/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</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="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.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="#trunkSourceWebCorerenderingRenderFlowThreadcpp">trunk/Source/WebCore/rendering/RenderFlowThread.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFullScreencpp">trunk/Source/WebCore/rendering/RenderFullScreen.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemcpp">trunk/Source/WebCore/rendering/RenderListItem.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderNamedFlowFragmentcpp">trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubycpp">trunk/Source/WebCore/rendering/RenderRuby.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderRubyBasecpp">trunk/Source/WebCore/rendering/RenderRubyBase.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutosizercpp">trunk/Source/WebCore/rendering/TextAutosizer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/ChangeLog        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1,3 +1,129 @@
</span><ins>+2014-10-08  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects
+        https://bugs.webkit.org/show_bug.cgi?id=137512
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects and clean up the
+        surrounding code.
+
+        No new tests, no behavior change.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::firstChildConsideringContinuation):
+        (WebCore::lastChildConsideringContinuation):
+        (WebCore::AccessibilityRenderObject::firstChild):
+        (WebCore::startOfContinuations):
+        (WebCore::endOfContinuations):
+        (WebCore::childBeforeConsideringContinuations):
+        (WebCore::AccessibilityRenderObject::previousSibling):
+        (WebCore::AccessibilityRenderObject::nextSibling):
+        (WebCore::nextContinuation):
+        (WebCore::AccessibilityRenderObject::renderParentObject):
+        (WebCore::AccessibilityRenderObject::anchorElement):
+        (WebCore::AccessibilityRenderObject::setValue):
+        * bindings/objc/DOMUIKitExtensions.mm:
+        (-[DOMNode containsOnlyInlineObjects]):
+        (-[DOMNode isSelectableBlock]):
+        (-[DOMHTMLElement structuralComplexityContribution]):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForGridTrackList):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
+        * editing/TextIterator.cpp:
+        (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
+        * page/ios/FrameIOS.mm:
+        (WebCore::Frame::preferredHeight):
+        * rendering/LogicalSelectionOffsetCaches.h:
+        (WebCore::containingBlockForFixedPosition):
+        (WebCore::containingBlockForAbsolutePosition):
+        (WebCore::containingBlockForObjectInFlow):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::styleWillChange):
+        (WebCore::RenderBlock::continuationBefore):
+        (WebCore::RenderBlock::splitBlocks):
+        (WebCore::RenderBlock::addChildIgnoringContinuation):
+        (WebCore::canMergeAnonymousBlock):
+        (WebCore::canMergeContiguousAnonymousBlocks):
+        (WebCore::RenderBlock::collapseAnonymousBoxChild):
+        (WebCore::RenderBlock::removeChild):
+        (WebCore::RenderBlock::blockElementContinuation):
+        (WebCore::RenderBlock::blockSelectionGaps):
+        (WebCore::RenderBlock::blockBeforeWithinSelectionRoot):
+        (WebCore::isChildHitTestCandidate):
+        (WebCore::RenderBlock::firstLineBlock):
+        (WebCore::findFirstLetterBlock):
+        (WebCore::RenderBlock::childBecameNonInline):
+        (WebCore::RenderBlock::hasMarginBeforeQuirk):
+        (WebCore::RenderBlock::hasMarginAfterQuirk):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
+        (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
+        (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
+        (WebCore::RenderBlockFlow::positionNewFloats):
+        (WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::positionNewFloatOnLine):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        (WebCore::RenderBox::availableLogicalHeightUsing):
+        (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
+        (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
+        (WebCore::computeInlineStaticDistance):
+        (WebCore::RenderBox::computePositionedLogicalWidth):
+        (WebCore::RenderBox::computePositionedLogicalHeight):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::accumulateInFlowPositionOffsets):
+        (WebCore::RenderBoxModelObject::moveChildTo):
+        (WebCore::RenderBoxModelObject::moveChildrenTo):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::propagateStyleToAnonymousChildren):
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
+        * rendering/RenderFullScreen.cpp:
+        (WebCore::RenderFullScreen::unwrapRenderer):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::inlineElementContinuation):
+        (WebCore::updateStyleOfAnonymousBlockContinuations):
+        (WebCore::RenderInline::styleDidChange):
+        (WebCore::nextContinuation):
+        (WebCore::RenderInline::splitFlow):
+        (WebCore::RenderInline::positionForPoint):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateScrollbarsAfterLayout):
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderListItem.cpp:
+        (WebCore::getParentOfFirstLineBox):
+        (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
+        (WebCore::RenderListItem::positionListMarker):
+        * rendering/RenderNamedFlowFragment.cpp:
+        (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
+        * rendering/RenderObject.cpp:
+        (WebCore::includeNonFixedHeight):
+        (WebCore::RenderObject::checkBlockPositionedObjectsNeedLayout):
+        (WebCore::RenderObject::containingBlock):
+        (WebCore::RenderObject::handleDynamicFloatPositionChange):
+        (WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary):
+        (WebCore::RenderObject::getTextDecorationColors):
+        * rendering/RenderRuby.cpp:
+        (WebCore::rubyBeforeBlock):
+        (WebCore::rubyAfterBlock):
+        * rendering/RenderRubyBase.cpp:
+        (WebCore::RenderRubyBase::moveInlineChildren):
+        (WebCore::RenderRubyBase::moveBlockChildren):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::processSubtree):
+        (WebCore::TextAutosizer::processContainer):
+        (WebCore::TextAutosizer::measureDescendantTextWidth):
+        (WebCore::TextAutosizer::findDeepestBlockContainingAllText):
+        (WebCore::TextAutosizer::findFirstTextLeafNotInCluster):
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::layout):
+
</ins><span class="cx"> 2014-10-08  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed follow-up fix for r174460. Do not register for KVOs if the object does not respond to the requested property.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -186,37 +186,35 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline RenderObject* firstChildConsideringContinuation(RenderObject* renderer)
</del><ins>+static inline RenderObject* firstChildConsideringContinuation(RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    RenderObject* firstChild = renderer-&gt;firstChildSlow();
</del><ins>+    RenderObject* firstChild = renderer.firstChildSlow();
</ins><span class="cx"> 
</span><del>-    if (!firstChild &amp;&amp; isInlineWithContinuation(renderer))
-        firstChild = firstChildInContinuation(toRenderInline(*renderer));
</del><ins>+    if (!firstChild &amp;&amp; isInlineWithContinuation(&amp;renderer))
+        firstChild = firstChildInContinuation(downcast&lt;RenderInline&gt;(renderer));
</ins><span class="cx"> 
</span><span class="cx">     return firstChild;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-static inline RenderObject* lastChildConsideringContinuation(RenderObject* renderer)
</del><ins>+static inline RenderObject* lastChildConsideringContinuation(RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    RenderObject* lastChild = renderer-&gt;lastChildSlow();
-    RenderObject* prev;
-    RenderObject* cur = renderer;
</del><ins>+    if (!is&lt;RenderInline&gt;(renderer) &amp;&amp; !is&lt;RenderBlock&gt;(renderer))
+        return &amp;renderer;
</ins><span class="cx"> 
</span><del>-    if (!cur-&gt;isRenderInline() &amp;&amp; !cur-&gt;isRenderBlock())
-        return renderer;
</del><ins>+    RenderObject* lastChild = downcast&lt;RenderBoxModelObject&gt;(renderer).lastChild();
+    RenderBoxModelObject* previous;
+    for (auto* current = &amp;downcast&lt;RenderBoxModelObject&gt;(renderer); current; ) {
+        previous = current;
</ins><span class="cx"> 
</span><del>-    while (cur) {
-        prev = cur;
</del><ins>+        if (RenderObject* newLastChild = current-&gt;lastChild())
+            lastChild = newLastChild;
</ins><span class="cx"> 
</span><del>-        if (RenderObject* lc = cur-&gt;lastChildSlow())
-            lastChild = lc;
-
-        if (cur-&gt;isRenderInline()) {
-            cur = toRenderInline(cur)-&gt;inlineElementContinuation();
-            ASSERT_UNUSED(prev, cur || !toRenderInline(prev)-&gt;continuation());
</del><ins>+        if (is&lt;RenderInline&gt;(*current)) {
+            current = downcast&lt;RenderInline&gt;(*current).inlineElementContinuation();
+            ASSERT_UNUSED(previous, current || !downcast&lt;RenderInline&gt;(*previous).continuation());
</ins><span class="cx">         } else
</span><del>-            cur = toRenderBlock(cur)-&gt;inlineElementContinuation();
</del><ins>+            current = downcast&lt;RenderBlock&gt;(*current).inlineElementContinuation();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return lastChild;
</span><span class="lines">@@ -227,7 +225,7 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderObject* firstChild = firstChildConsideringContinuation(m_renderer);
</del><ins>+    RenderObject* firstChild = firstChildConsideringContinuation(*m_renderer);
</ins><span class="cx"> 
</span><span class="cx">     // If an object can't have children, then it is using this method to help
</span><span class="cx">     // calculate some internal property (like its description).
</span><span class="lines">@@ -244,7 +242,7 @@
</span><span class="cx">     if (!m_renderer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    RenderObject* lastChild = lastChildConsideringContinuation(m_renderer);
</del><ins>+    RenderObject* lastChild = lastChildConsideringContinuation(*m_renderer);
</ins><span class="cx"> 
</span><span class="cx">     if (!lastChild &amp;&amp; !canHaveChildren())
</span><span class="cx">         return AccessibilityNodeObject::lastChild();
</span><span class="lines">@@ -252,67 +250,61 @@
</span><span class="cx">     return axObjectCache()-&gt;getOrCreate(lastChild);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline RenderInline* startOfContinuations(RenderObject* r)
</del><ins>+static inline RenderInline* startOfContinuations(RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    if (r-&gt;isInlineElementContinuation())
-        return toRenderInline(r-&gt;node()-&gt;renderer());
</del><ins>+    if (renderer.isInlineElementContinuation())
+        return downcast&lt;RenderInline&gt;(renderer.node()-&gt;renderer());
</ins><span class="cx"> 
</span><span class="cx">     // Blocks with a previous continuation always have a next continuation
</span><del>-    if (r-&gt;isRenderBlock() &amp;&amp; toRenderBlock(r)-&gt;inlineElementContinuation())
-        return toRenderInline(toRenderBlock(r)-&gt;inlineElementContinuation()-&gt;element()-&gt;renderer());
</del><ins>+    if (is&lt;RenderBlock&gt;(renderer) &amp;&amp; downcast&lt;RenderBlock&gt;(renderer).inlineElementContinuation())
+        return downcast&lt;RenderInline&gt;(downcast&lt;RenderBlock&gt;(renderer).inlineElementContinuation()-&gt;element()-&gt;renderer());
</ins><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline RenderObject* endOfContinuations(RenderObject* renderer)
</del><ins>+static inline RenderObject* endOfContinuations(RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    RenderObject* prev = renderer;
-    RenderObject* cur = renderer;
</del><ins>+    if (!is&lt;RenderInline&gt;(renderer) &amp;&amp; !is&lt;RenderBlock&gt;(renderer))
+        return &amp;renderer;
</ins><span class="cx"> 
</span><del>-    if (!cur-&gt;isRenderInline() &amp;&amp; !cur-&gt;isRenderBlock())
-        return renderer;
-
-    while (cur) {
-        prev = cur;
-        if (cur-&gt;isRenderInline()) {
-            cur = toRenderInline(cur)-&gt;inlineElementContinuation();
-            ASSERT(cur || !toRenderInline(prev)-&gt;continuation());
</del><ins>+    auto* previous = &amp;downcast&lt;RenderBoxModelObject&gt;(renderer);
+    for (auto* current = previous; current; ) {
+        previous = current;
+        if (is&lt;RenderInline&gt;(*current)) {
+            current = downcast&lt;RenderInline&gt;(*current).inlineElementContinuation();
+            ASSERT(current || !downcast&lt;RenderInline&gt;(*previous).continuation());
</ins><span class="cx">         } else 
</span><del>-            cur = toRenderBlock(cur)-&gt;inlineElementContinuation();
</del><ins>+            current = downcast&lt;RenderBlock&gt;(*current).inlineElementContinuation();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return prev;
</del><ins>+    return previous;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-static inline RenderObject* childBeforeConsideringContinuations(RenderInline* r, RenderObject* child)
</del><ins>+static inline RenderObject* childBeforeConsideringContinuations(RenderInline* renderer, RenderObject* child)
</ins><span class="cx"> {
</span><del>-    RenderBoxModelObject* curContainer = r;
-    RenderObject* cur = nullptr;
-    RenderObject* prev = nullptr;
-
-    while (curContainer) {
-        if (curContainer-&gt;isRenderInline()) {
-            cur = curContainer-&gt;firstChild();
-            while (cur) {
-                if (cur == child)
-                    return prev;
-                prev = cur;
-                cur = cur-&gt;nextSibling();
</del><ins>+    RenderObject* previous = nullptr;
+    for (RenderBoxModelObject* currentContainer = renderer; currentContainer; ) {
+        if (is&lt;RenderInline&gt;(*currentContainer)) {
+            auto* current = currentContainer-&gt;firstChild();
+            while (current) {
+                if (current == child)
+                    return previous;
+                previous = current;
+                current = current-&gt;nextSibling();
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            curContainer = toRenderInline(curContainer)-&gt;continuation();
-        } else if (curContainer-&gt;isRenderBlock()) {
-            if (curContainer == child)
-                return prev;
</del><ins>+            currentContainer = downcast&lt;RenderInline&gt;(*currentContainer).continuation();
+        } else if (is&lt;RenderBlock&gt;(*currentContainer)) {
+            if (currentContainer == child)
+                return previous;
</ins><span class="cx"> 
</span><del>-            prev = curContainer;
-            curContainer = toRenderBlock(curContainer)-&gt;inlineElementContinuation();
</del><ins>+            previous = currentContainer;
+            currentContainer = downcast&lt;RenderBlock&gt;(*currentContainer).inlineElementContinuation();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-
</del><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -332,15 +324,15 @@
</span><span class="cx">     // Case 1: The node is a block and is an inline's continuation. In that case, the inline's
</span><span class="cx">     // last child is our previous sibling (or further back in the continuation chain)
</span><span class="cx">     RenderInline* startOfConts;
</span><del>-    if (m_renderer-&gt;isRenderBlock() &amp;&amp; (startOfConts = startOfContinuations(m_renderer)))
</del><ins>+    if (is&lt;RenderBox&gt;(*m_renderer) &amp;&amp; (startOfConts = startOfContinuations(*m_renderer)))
</ins><span class="cx">         previousSibling = childBeforeConsideringContinuations(startOfConts, m_renderer);
</span><span class="cx"> 
</span><span class="cx">     // Case 2: Anonymous block parent of the end of a continuation - skip all the way to before
</span><span class="cx">     // the parent of the start, since everything in between will be linked up via the continuation.
</span><span class="cx">     else if (m_renderer-&gt;isAnonymousBlock() &amp;&amp; firstChildIsInlineContinuation(m_renderer)) {
</span><del>-        RenderObject* firstParent = startOfContinuations(m_renderer-&gt;firstChildSlow())-&gt;parent();
</del><ins>+        auto* firstParent = startOfContinuations(*m_renderer-&gt;firstChildSlow())-&gt;parent();
</ins><span class="cx">         while (firstChildIsInlineContinuation(firstParent))
</span><del>-            firstParent = startOfContinuations(firstParent-&gt;firstChildSlow())-&gt;parent();
</del><ins>+            firstParent = startOfContinuations(*firstParent-&gt;firstChild())-&gt;parent();
</ins><span class="cx">         previousSibling = firstParent-&gt;previousSibling();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -350,7 +342,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Case 4: This node has no previous siblings, but its parent is an inline,
</span><span class="cx">     // and is another node's inline continutation. Follow the continuation chain.
</span><del>-    else if (m_renderer-&gt;parent()-&gt;isRenderInline() &amp;&amp; (startOfConts = startOfContinuations(m_renderer-&gt;parent())))
</del><ins>+    else if (is&lt;RenderInline&gt;(*m_renderer-&gt;parent()) &amp;&amp; (startOfConts = startOfContinuations(*m_renderer-&gt;parent())))
</ins><span class="cx">         previousSibling = childBeforeConsideringContinuations(startOfConts, m_renderer-&gt;parent()-&gt;firstChild());
</span><span class="cx"> 
</span><span class="cx">     if (!previousSibling)
</span><span class="lines">@@ -375,15 +367,15 @@
</span><span class="cx">     // Case 1: node is a block and has an inline continuation. Next sibling is the inline continuation's
</span><span class="cx">     // first child.
</span><span class="cx">     RenderInline* inlineContinuation;
</span><del>-    if (m_renderer-&gt;isRenderBlock() &amp;&amp; (inlineContinuation = toRenderBlock(m_renderer)-&gt;inlineElementContinuation()))
-        nextSibling = firstChildConsideringContinuation(inlineContinuation);
</del><ins>+    if (is&lt;RenderBlock&gt;(*m_renderer) &amp;&amp; (inlineContinuation = downcast&lt;RenderBlock&gt;(*m_renderer).inlineElementContinuation()))
+        nextSibling = firstChildConsideringContinuation(*inlineContinuation);
</ins><span class="cx"> 
</span><span class="cx">     // Case 2: Anonymous block parent of the start of a continuation - skip all the way to
</span><span class="cx">     // after the parent of the end, since everything in between will be linked up via the continuation.
</span><span class="cx">     else if (m_renderer-&gt;isAnonymousBlock() &amp;&amp; lastChildHasContinuation(m_renderer)) {
</span><del>-        RenderElement* lastParent = endOfContinuations(toRenderBlock(m_renderer)-&gt;lastChild())-&gt;parent();
</del><ins>+        RenderElement* lastParent = endOfContinuations(*downcast&lt;RenderBlock&gt;(*m_renderer).lastChild())-&gt;parent();
</ins><span class="cx">         while (lastChildHasContinuation(lastParent))
</span><del>-            lastParent = endOfContinuations(lastParent-&gt;lastChild())-&gt;parent();
</del><ins>+            lastParent = endOfContinuations(*lastParent-&gt;lastChild())-&gt;parent();
</ins><span class="cx">         nextSibling = lastParent-&gt;nextSibling();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -394,15 +386,15 @@
</span><span class="cx">     // Case 4: node is an inline with a continuation. Next sibling is the next sibling of the end 
</span><span class="cx">     // of the continuation chain.
</span><span class="cx">     else if (isInlineWithContinuation(m_renderer))
</span><del>-        nextSibling = endOfContinuations(m_renderer)-&gt;nextSibling();
</del><ins>+        nextSibling = endOfContinuations(*m_renderer)-&gt;nextSibling();
</ins><span class="cx"> 
</span><span class="cx">     // Case 5: node has no next sibling, and its parent is an inline with a continuation.
</span><span class="cx">     else if (isInlineWithContinuation(m_renderer-&gt;parent())) {
</span><del>-        auto continuation = toRenderInline(m_renderer-&gt;parent())-&gt;continuation();
</del><ins>+        auto&amp; continuation = *downcast&lt;RenderInline&gt;(*m_renderer-&gt;parent()).continuation();
</ins><span class="cx">         
</span><span class="cx">         // Case 5a: continuation is a block - in this case the block itself is the next sibling.
</span><del>-        if (continuation-&gt;isRenderBlock())
-            nextSibling = continuation;
</del><ins>+        if (is&lt;RenderBlock&gt;(continuation))
+            nextSibling = &amp;continuation;
</ins><span class="cx">         // Case 5b: continuation is an inline - in this case the inline's first child is the next sibling
</span><span class="cx">         else
</span><span class="cx">             nextSibling = firstChildConsideringContinuation(continuation);
</span><span class="lines">@@ -414,13 +406,12 @@
</span><span class="cx">     return axObjectCache()-&gt;getOrCreate(nextSibling);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
</del><ins>+static RenderBoxModelObject* nextContinuation(RenderObject&amp; renderer)
</ins><span class="cx"> {
</span><del>-    ASSERT(renderer);
-    if (renderer-&gt;isRenderInline() &amp;&amp; !renderer-&gt;isReplaced())
-        return toRenderInline(renderer)-&gt;continuation();
-    if (renderer-&gt;isRenderBlock())
-        return toRenderBlock(renderer)-&gt;inlineElementContinuation();
</del><ins>+    if (is&lt;RenderInline&gt;(renderer) &amp;&amp; !renderer.isReplaced())
+        return downcast&lt;RenderInline&gt;(renderer).continuation();
+    if (is&lt;RenderBlock&gt;(renderer))
+        return downcast&lt;RenderBlock&gt;(renderer).inlineElementContinuation();
</ins><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -435,12 +426,12 @@
</span><span class="cx">     // is the start of the continuation chain.
</span><span class="cx">     RenderInline* startOfConts = nullptr;
</span><span class="cx">     RenderObject* firstChild = nullptr;
</span><del>-    if (m_renderer-&gt;isRenderBlock() &amp;&amp; (startOfConts = startOfContinuations(m_renderer)))
</del><ins>+    if (is&lt;RenderBlock&gt;(*m_renderer) &amp;&amp; (startOfConts = startOfContinuations(*m_renderer)))
</ins><span class="cx">         parent = startOfConts;
</span><span class="cx"> 
</span><span class="cx">     // Case 2: node's parent is an inline which is some node's continuation; parent is 
</span><span class="cx">     // the earliest node in the continuation chain.
</span><del>-    else if (parent &amp;&amp; parent-&gt;isRenderInline() &amp;&amp; (startOfConts = startOfContinuations(parent)))
</del><ins>+    else if (is&lt;RenderInline&gt;(parent) &amp;&amp; (startOfConts = startOfContinuations(*parent)))
</ins><span class="cx">         parent = startOfConts;
</span><span class="cx">     
</span><span class="cx">     // Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation.
</span><span class="lines">@@ -448,7 +439,7 @@
</span><span class="cx">         // Get the node's renderer and follow that continuation chain until the first child is found
</span><span class="cx">         RenderObject* nodeRenderFirstChild = firstChild-&gt;node()-&gt;renderer();
</span><span class="cx">         while (nodeRenderFirstChild != firstChild) {
</span><del>-            for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(contsTest)) {
</del><ins>+            for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(*contsTest)) {
</ins><span class="cx">                 if (contsTest == firstChild) {
</span><span class="cx">                     parent = nodeRenderFirstChild-&gt;parent();
</span><span class="cx">                     break;
</span><span class="lines">@@ -566,25 +557,23 @@
</span><span class="cx">     if (!cache)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderObject* currRenderer;
</del><ins>+    RenderObject* currentRenderer;
</ins><span class="cx">     
</span><span class="cx">     // Search up the render tree for a RenderObject with a DOM node.  Defer to an earlier continuation, though.
</span><del>-    for (currRenderer = m_renderer; currRenderer &amp;&amp; !currRenderer-&gt;node(); currRenderer = currRenderer-&gt;parent()) {
-        if (currRenderer-&gt;isAnonymousBlock()) {
-            RenderObject* continuation = toRenderBlock(currRenderer)-&gt;continuation();
-            if (continuation)
</del><ins>+    for (currentRenderer = m_renderer; currentRenderer &amp;&amp; !currentRenderer-&gt;node(); currentRenderer = currentRenderer-&gt;parent()) {
+        if (currentRenderer-&gt;isAnonymousBlock()) {
+            if (RenderObject* continuation = downcast&lt;RenderBlock&gt;(*currentRenderer).continuation())
</ins><span class="cx">                 return cache-&gt;getOrCreate(continuation)-&gt;anchorElement();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // bail if none found
</span><del>-    if (!currRenderer)
-        return 0;
</del><ins>+    if (!currentRenderer)
+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     // search up the DOM tree for an anchor element
</span><span class="cx">     // NOTE: this assumes that any non-image with an anchor is an HTMLAnchorElement
</span><del>-    Node* node = currRenderer-&gt;node();
-    for ( ; node; node = node-&gt;parentNode()) {
</del><ins>+    for (Node* node = currentRenderer-&gt;node(); node; node = node-&gt;parentNode()) {
</ins><span class="cx">         if (is&lt;HTMLAnchorElement&gt;(*node) || (node-&gt;renderer() &amp;&amp; cache-&gt;getOrCreate(node-&gt;renderer())-&gt;isAnchor()))
</span><span class="cx">             return downcast&lt;Element&gt;(node);
</span><span class="cx">     }
</span><span class="lines">@@ -1677,14 +1666,14 @@
</span><span class="cx">         return;
</span><span class="cx">     Element&amp; element = downcast&lt;Element&gt;(*m_renderer-&gt;node());
</span><span class="cx"> 
</span><del>-    if (!m_renderer-&gt;isBoxModelObject())
</del><ins>+    if (!is&lt;RenderBoxModelObject&gt;(*m_renderer))
</ins><span class="cx">         return;
</span><del>-    RenderBoxModelObject* renderer = toRenderBoxModelObject(m_renderer);
</del><ins>+    RenderBoxModelObject&amp; renderer = downcast&lt;RenderBoxModelObject&gt;(*m_renderer);
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Do we want to do anything here for ARIA textboxes?
</span><del>-    if (renderer-&gt;isTextField() &amp;&amp; is&lt;HTMLInputElement&gt;(element))
</del><ins>+    if (renderer.isTextField() &amp;&amp; is&lt;HTMLInputElement&gt;(element))
</ins><span class="cx">         downcast&lt;HTMLInputElement&gt;(element).setValue(string);
</span><del>-    else if (renderer-&gt;isTextArea() &amp;&amp; is&lt;HTMLTextAreaElement&gt;(element))
</del><ins>+    else if (renderer.isTextArea() &amp;&amp; is&lt;HTMLTextAreaElement&gt;(element))
</ins><span class="cx">         downcast&lt;HTMLTextAreaElement&gt;(element).setValue(string);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -207,17 +207,17 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)containsOnlyInlineObjects
</span><span class="cx"> {
</span><del>-    RenderObject * renderer = core(self)-&gt;renderer();
-    return  (renderer &amp;&amp;
-             renderer-&gt;childrenInline() &amp;&amp;
-             (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() == nil) &amp;&amp;
-             !renderer-&gt;isTable());
</del><ins>+    RenderObject* renderer = core(self)-&gt;renderer();
+    return renderer
+        &amp;&amp; renderer-&gt;childrenInline()
+        &amp;&amp; (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; !downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation())
+        &amp;&amp; !renderer-&gt;isTable();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isSelectableBlock
</span><span class="cx"> {
</span><del>-    RenderObject * renderer = core(self)-&gt;renderer();
-    return (renderer &amp;&amp; (renderer-&gt;isRenderBlockFlow() || (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() != nil)));
</del><ins>+    RenderObject* renderer = core(self)-&gt;renderer();
+    return renderer &amp;&amp; (is&lt;RenderBlockFlow&gt;(*renderer) || (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation() != nil));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMRange *)rangeOfContainingParagraph
</span><span class="lines">@@ -344,12 +344,12 @@
</span><span class="cx">             result = INT_MAX;
</span><span class="cx">         } else if (renderer-&gt;isEmpty()) {
</span><span class="cx">             result = 0;
</span><del>-        } else if (renderer-&gt;isRenderBlockFlow() || (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() != 0)) {
</del><ins>+        } else if (is&lt;RenderBlockFlow&gt;(*renderer) || (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation())) {
</ins><span class="cx">             BOOL noCost = NO;
</span><del>-            if (renderer-&gt;isBox()) {
-                RenderBox &amp;asBox = renderer-&gt;enclosingBox();
-                RenderObject *parent = asBox.parent();
-                RenderBox *parentRenderBox = (parent &amp;&amp; parent-&gt;isBox()) ? toRenderBox(parent) : 0;
</del><ins>+            if (is&lt;RenderBox&gt;(*renderer)) {
+                RenderBox&amp; asBox = renderer-&gt;enclosingBox();
+                RenderObject* parent = asBox.parent();
+                RenderBox* parentRenderBox = is&lt;RenderBox&gt;(parent) ? downcast&lt;RenderBox&gt;(parent) : nullptr;
</ins><span class="cx">                 if (parentRenderBox &amp;&amp; asBox.width() == parentRenderBox-&gt;width()) {
</span><span class="cx">                     noCost = YES;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1007,7 +1007,7 @@
</span><span class="cx"> {
</span><span class="cx">     const Vector&lt;GridTrackSize&gt;&amp; trackSizes = direction == ForColumns ? style-&gt;gridColumns() : style-&gt;gridRows();
</span><span class="cx">     const OrderedNamedGridLinesMap&amp; orderedNamedGridLines = direction == ForColumns ? style-&gt;orderedNamedGridColumnLines() : style-&gt;orderedNamedGridRowLines();
</span><del>-    bool isRenderGrid = renderer &amp;&amp; renderer-&gt;isRenderGrid();
</del><ins>+    bool isRenderGrid = is&lt;RenderGrid&gt;(renderer);
</ins><span class="cx"> 
</span><span class="cx">     // Handle the 'none' case.
</span><span class="cx">     bool trackListIsEmpty = trackSizes.isEmpty();
</span><span class="lines">@@ -1015,7 +1015,7 @@
</span><span class="cx">         // For grids we should consider every listed track, whether implicitly or explicitly created. If we don't have
</span><span class="cx">         // any explicit track and there are no children then there are no implicit tracks. We cannot simply check the
</span><span class="cx">         // number of rows/columns in our internal grid representation because it's always at least 1x1 (see r143331).
</span><del>-        trackListIsEmpty = !toRenderBlock(renderer)-&gt;firstChild();
</del><ins>+        trackListIsEmpty = !downcast&lt;RenderBlock&gt;(*renderer).firstChild();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (trackListIsEmpty) {
</span><span class="lines">@@ -1025,7 +1025,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto list = CSSValueList::createSpaceSeparated();
</span><span class="cx">     if (isRenderGrid) {
</span><del>-        const Vector&lt;LayoutUnit&gt;&amp; trackPositions = direction == ForColumns ? toRenderGrid(renderer)-&gt;columnPositions() : toRenderGrid(renderer)-&gt;rowPositions();
</del><ins>+        const Vector&lt;LayoutUnit&gt;&amp; trackPositions = direction == ForColumns ? downcast&lt;RenderGrid&gt;(*renderer).columnPositions() : downcast&lt;RenderGrid&gt;(*renderer).rowPositions();
</ins><span class="cx">         // There are at least #tracks + 1 grid lines (trackPositions). Apart from that, the grid container can generate implicit grid tracks,
</span><span class="cx">         // so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid.
</span><span class="cx">         ASSERT(trackPositions.size() - 1 &gt;= trackSizes.size());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -55,10 +55,10 @@
</span><span class="cx"> #include &quot;RemoveCSSPropertyCommand.h&quot;
</span><span class="cx"> #include &quot;RemoveNodeCommand.h&quot;
</span><span class="cx"> #include &quot;RemoveNodePreservingChildrenCommand.h&quot;
</span><ins>+#include &quot;RenderBlockFlow.h&quot;
+#include &quot;RenderText.h&quot;
</ins><span class="cx"> #include &quot;ReplaceNodeWithSpanCommand.h&quot;
</span><span class="cx"> #include &quot;ReplaceSelectionCommand.h&quot;
</span><del>-#include &quot;RenderBlock.h&quot;
-#include &quot;RenderText.h&quot;
</del><span class="cx"> #include &quot;ScopedEventQueue.h&quot;
</span><span class="cx"> #include &quot;SetNodeAttributeCommand.h&quot;
</span><span class="cx"> #include &quot;SplitElementCommand.h&quot;
</span><span class="lines">@@ -929,21 +929,21 @@
</span><span class="cx"> PassRefPtr&lt;Node&gt; CompositeEditCommand::addBlockPlaceholderIfNeeded(Element* container)
</span><span class="cx"> {
</span><span class="cx">     if (!container)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     RenderObject* renderer = container-&gt;renderer();
</span><del>-    if (!renderer || !renderer-&gt;isRenderBlockFlow())
-        return 0;
</del><ins>+    if (!is&lt;RenderBlockFlow&gt;(renderer))
+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     // append the placeholder to make sure it follows
</span><span class="cx">     // any unrendered blocks
</span><del>-    RenderBlock* block = toRenderBlock(renderer);
-    if (block-&gt;height() == 0 || (block-&gt;isListItem() &amp;&amp; block-&gt;isEmpty()))
</del><ins>+    RenderBlockFlow&amp; blockFlow = downcast&lt;RenderBlockFlow&gt;(*renderer);
+    if (!blockFlow.height() || (blockFlow.isListItem() &amp;&amp; blockFlow.isEmpty()))
</ins><span class="cx">         return appendBlockPlaceholder(container);
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Assumes that the position is at a placeholder and does the removal without much checking.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -963,7 +963,7 @@
</span><span class="cx">     // Additionally, if the range we are iterating over contains huge sections of unrendered content, 
</span><span class="cx">     // we would create VisiblePositions on every call to this function without this check.
</span><span class="cx">     if (!m_node-&gt;renderer() || m_node-&gt;renderer()-&gt;style().visibility() != VISIBLE
</span><del>-        || (m_node-&gt;renderer()-&gt;isRenderBlockFlow() &amp;&amp; !toRenderBlock(m_node-&gt;renderer())-&gt;height() &amp;&amp; !m_node-&gt;hasTagName(bodyTag)))
</del><ins>+        || (is&lt;RenderBlockFlow&gt;(*m_node-&gt;renderer()) &amp;&amp; !downcast&lt;RenderBlockFlow&gt;(*m_node-&gt;renderer()).height() &amp;&amp; !is&lt;HTMLBodyElement&gt;(*m_node)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // The startPos.isNotNull() check is needed because the start could be before the body,
</span></span></pre></div>
<a id="trunkSourceWebCorepageiosFrameIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ios/FrameIOS.mm (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ios/FrameIOS.mm        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/page/ios/FrameIOS.mm        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -552,11 +552,11 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     RenderObject* renderer = body-&gt;renderer();
</span><del>-    if (!renderer || !renderer-&gt;isRenderBlock())
</del><ins>+    if (!is&lt;RenderBlock&gt;(renderer))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    RenderBlock* block = toRenderBlock(renderer);
-    return block-&gt;height() + block-&gt;marginTop() + block-&gt;marginBottom();
</del><ins>+    RenderBlock&amp; block = downcast&lt;RenderBlock&gt;(*renderer);
+    return block.height() + block.marginTop() + block.marginBottom();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int Frame::innerLineHeight(DOMNode* domNode) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingLogicalSelectionOffsetCachesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/LogicalSelectionOffsetCaches.h        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     while (object &amp;&amp; !object-&gt;canContainFixedPositionObjects())
</span><span class="cx">         object = object-&gt;parent();
</span><span class="cx">     ASSERT(!object || !object-&gt;isAnonymousBlock());
</span><del>-    return toRenderBlock(object);
</del><ins>+    return downcast&lt;RenderBlock&gt;(object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline RenderBlock* containingBlockForAbsolutePosition(RenderElement* parent)
</span><span class="lines">@@ -57,13 +57,13 @@
</span><span class="cx">     // not the inline itself, to avoid having a positioned objects list in all RenderInlines
</span><span class="cx">     // and use RenderBlock* as RenderElement::containingBlock's return type.
</span><span class="cx">     // Use RenderBlock::container() to obtain the inline.
</span><del>-    if (object &amp;&amp; !object-&gt;isRenderBlock())
</del><ins>+    if (object &amp;&amp; !is&lt;RenderBlock&gt;(*object))
</ins><span class="cx">         object = object-&gt;containingBlock();
</span><span class="cx"> 
</span><span class="cx">     while (object &amp;&amp; object-&gt;isAnonymousBlock())
</span><span class="cx">         object = object-&gt;containingBlock();
</span><span class="cx"> 
</span><del>-    return toRenderBlock(object);
</del><ins>+    return downcast&lt;RenderBlock&gt;(object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline RenderBlock* containingBlockForObjectInFlow(RenderElement* parent)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     RenderElement* object = parent;
</span><span class="cx">     while (object &amp;&amp; isNonRenderBlockInline(*object))
</span><span class="cx">         object = object-&gt;parent();
</span><del>-    return toRenderBlock(object);
</del><ins>+    return downcast&lt;RenderBlock&gt;(object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class LogicalSelectionOffsetCaches {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -272,17 +272,17 @@
</span><span class="cx">         else if (oldStyle-&gt;position() == StaticPosition) {
</span><span class="cx">             // Remove our absolutely positioned descendants from their current containing block.
</span><span class="cx">             // They will be inserted into our positioned objects list during layout.
</span><del>-            auto cb = parent();
-            while (cb &amp;&amp; (cb-&gt;style().position() == StaticPosition || (cb-&gt;isInline() &amp;&amp; !cb-&gt;isReplaced())) &amp;&amp; !cb-&gt;isRenderView()) {
-                if (cb-&gt;style().position() == RelativePosition &amp;&amp; cb-&gt;isInline() &amp;&amp; !cb-&gt;isReplaced()) {
-                    cb = cb-&gt;containingBlock();
</del><ins>+            auto containingBlock = parent();
+            while (containingBlock &amp;&amp; (containingBlock-&gt;style().position() == StaticPosition || (containingBlock-&gt;isInline() &amp;&amp; !containingBlock-&gt;isReplaced())) &amp;&amp; !containingBlock-&gt;isRenderView()) {
+                if (containingBlock-&gt;style().position() == RelativePosition &amp;&amp; containingBlock-&gt;isInline() &amp;&amp; !containingBlock-&gt;isReplaced()) {
+                    containingBlock = containingBlock-&gt;containingBlock();
</ins><span class="cx">                     break;
</span><span class="cx">                 }
</span><del>-                cb = cb-&gt;parent();
</del><ins>+                containingBlock = containingBlock-&gt;parent();
</ins><span class="cx">             }
</span><span class="cx">             
</span><del>-            if (cb-&gt;isRenderBlock())
-                toRenderBlock(cb)-&gt;removePositionedObjects(this, NewContainingBlock);
</del><ins>+            if (is&lt;RenderBlock&gt;(*containingBlock))
+                downcast&lt;RenderBlock&gt;(*containingBlock).removePositionedObjects(this, NewContainingBlock);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -332,19 +332,17 @@
</span><span class="cx">     if (beforeChild &amp;&amp; beforeChild-&gt;parent() == this)
</span><span class="cx">         return this;
</span><span class="cx"> 
</span><del>-    RenderBlock* curr = toRenderBlock(continuation());
</del><span class="cx">     RenderBlock* nextToLast = this;
</span><span class="cx">     RenderBlock* last = this;
</span><del>-    while (curr) {
-        if (beforeChild &amp;&amp; beforeChild-&gt;parent() == curr) {
-            if (curr-&gt;firstChild() == beforeChild)
</del><ins>+    for (auto* current = downcast&lt;RenderBlock&gt;(continuation()); current; current = downcast&lt;RenderBlock&gt;(current-&gt;continuation())) {
+        if (beforeChild &amp;&amp; beforeChild-&gt;parent() == current) {
+            if (current-&gt;firstChild() == beforeChild)
</ins><span class="cx">                 return last;
</span><del>-            return curr;
</del><ins>+            return current;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         nextToLast = last;
</span><del>-        last = curr;
-        curr = toRenderBlock(curr-&gt;continuation());
</del><ins>+        last = current;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!beforeChild &amp;&amp; !last-&gt;firstChild())
</span><span class="lines">@@ -413,77 +411,6 @@
</span><span class="cx">     return cloneBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlock::splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock,
-                              RenderBlock* middleBlock,
-                              RenderObject* beforeChild, RenderBoxModelObject* oldCont)
-{
-    // Create a clone of this inline.
-    RenderPtr&lt;RenderBlock&gt; cloneBlock = clone();
-    if (!isAnonymousBlock())
-        cloneBlock-&gt;setContinuation(oldCont);
-
-    if (!beforeChild &amp;&amp; isAfterContent(lastChild()))
-        beforeChild = lastChild();
-
-    // If we are moving inline children from |this| to cloneBlock, then we need
-    // to clear our line box tree.
-    if (beforeChild &amp;&amp; childrenInline())
-        deleteLines();
-
-    // Now take all of the children from beforeChild to the end and remove
-    // them from |this| and place them in the clone.
-    moveChildrenTo(cloneBlock.get(), beforeChild, 0, true);
-    
-    // Hook |clone| up as the continuation of the middle block.
-    if (!cloneBlock-&gt;isAnonymousBlock())
-        middleBlock-&gt;setContinuation(cloneBlock.get());
-
-    // We have been reparented and are now under the fromBlock.  We need
-    // to walk up our block parent chain until we hit the containing anonymous columns block.
-    // Once we hit the anonymous columns block we're done.
-    RenderBoxModelObject* curr = toRenderBoxModelObject(parent());
-    RenderBoxModelObject* currChild = this;
-    RenderObject* currChildNextSibling = currChild-&gt;nextSibling();
-
-    while (curr &amp;&amp; curr-&gt;isDescendantOf(fromBlock) &amp;&amp; curr != fromBlock) {
-        RenderBlock* blockCurr = toRenderBlock(curr);
-        
-        // Create a new clone.
-        RenderPtr&lt;RenderBlock&gt; cloneChild = WTF::move(cloneBlock);
-        cloneBlock = blockCurr-&gt;clone();
-
-        // Insert our child clone as the first child.
-        cloneBlock-&gt;addChildIgnoringContinuation(cloneChild.leakPtr(), 0);
-
-        // Hook the clone up as a continuation of |curr|.  Note we do encounter
-        // anonymous blocks possibly as we walk up the block chain.  When we split an
-        // anonymous block, there's no need to do any continuation hookup, since we haven't
-        // actually split a real element.
-        if (!blockCurr-&gt;isAnonymousBlock()) {
-            oldCont = blockCurr-&gt;continuation();
-            blockCurr-&gt;setContinuation(cloneBlock.get());
-            cloneBlock-&gt;setContinuation(oldCont);
-        }
-
-        // Now we need to take all of the children starting from the first child
-        // *after* currChild and append them all to the clone.
-        blockCurr-&gt;moveChildrenTo(cloneBlock.get(), currChildNextSibling, 0, true);
-
-        // Keep walking up the chain.
-        currChild = curr;
-        currChildNextSibling = currChild-&gt;nextSibling();
-        curr = toRenderBoxModelObject(curr-&gt;parent());
-    }
-
-    // Now we are at the columns block level. We need to put the clone into the toBlock.
-    toBlock-&gt;insertChildInternal(cloneBlock.leakPtr(), nullptr, NotifyChildren);
-
-    // Now take all the children after currChild and remove them from the fromBlock
-    // and put them in the toBlock.
-    if (currChildNextSibling &amp;&amp; currChildNextSibling-&gt;parent() == fromBlock)
-        fromBlock-&gt;moveChildrenTo(toBlock, currChildNextSibling, 0, true);
-}
-
</del><span class="cx"> void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
</span><span class="cx"> {
</span><span class="cx">     if (continuation() &amp;&amp; !isAnonymousBlock())
</span><span class="lines">@@ -559,7 +486,7 @@
</span><span class="cx">         RenderObject* afterChild = beforeChild ? beforeChild-&gt;previousSibling() : lastChild();
</span><span class="cx"> 
</span><span class="cx">         if (afterChild &amp;&amp; afterChild-&gt;isAnonymousBlock()) {
</span><del>-            toRenderBlock(afterChild)-&gt;addChild(newChild);
</del><ins>+            downcast&lt;RenderBlock&gt;(*afterChild).addChild(newChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -576,8 +503,8 @@
</span><span class="cx"> 
</span><span class="cx">     RenderBox::addChild(newChild, beforeChild);
</span><span class="cx">  
</span><del>-    if (madeBoxesNonInline &amp;&amp; parent() &amp;&amp; isAnonymousBlock() &amp;&amp; parent()-&gt;isRenderBlock())
-        toRenderBlock(parent())-&gt;removeLeftoverAnonymousBlock(this);
</del><ins>+    if (madeBoxesNonInline &amp;&amp; is&lt;RenderBlock&gt;(parent()) &amp;&amp; isAnonymousBlock())
+        downcast&lt;RenderBlock&gt;(*parent()).removeLeftoverAnonymousBlock(this);
</ins><span class="cx">     // this object may be dead here
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -722,11 +649,11 @@
</span><span class="cx">     child-&gt;destroy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool canMergeAnonymousBlock(RenderBlock* anonymousBlock)
</del><ins>+static bool canMergeAnonymousBlock(RenderBlock&amp; anonymousBlock)
</ins><span class="cx"> {
</span><del>-    if (anonymousBlock-&gt;beingDestroyed() || anonymousBlock-&gt;continuation())
</del><ins>+    if (anonymousBlock.beingDestroyed() || anonymousBlock.continuation())
</ins><span class="cx">         return false;
</span><del>-    if (anonymousBlock-&gt;isRubyRun() || anonymousBlock-&gt;isRubyBase())
</del><ins>+    if (anonymousBlock.isRubyRun() || anonymousBlock.isRubyBase())
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -739,24 +666,24 @@
</span><span class="cx">     if (previous) {
</span><span class="cx">         if (!previous-&gt;isAnonymousBlock())
</span><span class="cx">             return false;
</span><del>-        RenderBlock* previousAnonymousBlock = toRenderBlock(previous);
</del><ins>+        RenderBlock&amp; previousAnonymousBlock = downcast&lt;RenderBlock&gt;(*previous);
</ins><span class="cx">         if (!canMergeAnonymousBlock(previousAnonymousBlock))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     if (next) {
</span><span class="cx">         if (!next-&gt;isAnonymousBlock())
</span><span class="cx">             return false;
</span><del>-        RenderBlock* nextAnonymousBlock = toRenderBlock(next);
</del><ins>+        RenderBlock&amp; nextAnonymousBlock = downcast&lt;RenderBlock&gt;(*next);
</ins><span class="cx">         if (!canMergeAnonymousBlock(nextAnonymousBlock))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child)
</del><ins>+void RenderBlock::collapseAnonymousBoxChild(RenderBlock&amp; parent, RenderBlock* child)
</ins><span class="cx"> {
</span><del>-    parent-&gt;setNeedsLayoutAndPrefWidthsRecalc();
-    parent-&gt;setChildrenInline(child-&gt;childrenInline());
</del><ins>+    parent.setNeedsLayoutAndPrefWidthsRecalc();
+    parent.setChildrenInline(child-&gt;childrenInline());
</ins><span class="cx">     RenderObject* nextSibling = child-&gt;nextSibling();
</span><span class="cx"> 
</span><span class="cx">     RenderFlowThread* childFlowThread = child-&gt;flowThreadContainingBlock();
</span><span class="lines">@@ -764,8 +691,8 @@
</span><span class="cx">     if (childFlowThread &amp;&amp; childFlowThread-&gt;isRenderNamedFlowThread())
</span><span class="cx">         toRenderNamedFlowThread(childFlowThread)-&gt;removeFlowChildInfo(child);
</span><span class="cx"> 
</span><del>-    parent-&gt;removeChildInternal(*child, child-&gt;hasLayer() ? NotifyChildren : DontNotifyChildren);
-    child-&gt;moveAllChildrenTo(parent, nextSibling, child-&gt;hasLayer());
</del><ins>+    parent.removeChildInternal(*child, child-&gt;hasLayer() ? NotifyChildren : DontNotifyChildren);
+    child-&gt;moveAllChildrenTo(&amp;parent, nextSibling, child-&gt;hasLayer());
</ins><span class="cx">     // Delete the now-empty block's lines and nuke it.
</span><span class="cx">     child-&gt;deleteLines();
</span><span class="cx">     child-&gt;destroy();
</span><span class="lines">@@ -786,44 +713,44 @@
</span><span class="cx">     bool canMergeAnonymousBlocks = canMergeContiguousAnonymousBlocks(oldChild, prev, next);
</span><span class="cx">     if (canMergeAnonymousBlocks &amp;&amp; prev &amp;&amp; next) {
</span><span class="cx">         prev-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><del>-        RenderBlock* nextBlock = toRenderBlock(next);
-        RenderBlock* prevBlock = toRenderBlock(prev);
</del><ins>+        RenderBlock&amp; nextBlock = downcast&lt;RenderBlock&gt;(*next);
+        RenderBlock&amp; prevBlock = downcast&lt;RenderBlock&gt;(*prev);
</ins><span class="cx">        
</span><span class="cx">         if (prev-&gt;childrenInline() != next-&gt;childrenInline()) {
</span><del>-            RenderBlock* inlineChildrenBlock = prev-&gt;childrenInline() ? prevBlock : nextBlock;
-            RenderBlock* blockChildrenBlock = prev-&gt;childrenInline() ? nextBlock : prevBlock;
</del><ins>+            RenderBlock&amp; inlineChildrenBlock = prev-&gt;childrenInline() ? prevBlock : nextBlock;
+            RenderBlock&amp; blockChildrenBlock = prev-&gt;childrenInline() ? nextBlock : prevBlock;
</ins><span class="cx">             
</span><span class="cx">             // Place the inline children block inside of the block children block instead of deleting it.
</span><span class="cx">             // In order to reuse it, we have to reset it to just be a generic anonymous block.  Make sure
</span><span class="cx">             // to clear out inherited column properties by just making a new style, and to also clear the
</span><span class="cx">             // column span flag if it is set.
</span><del>-            ASSERT(!inlineChildrenBlock-&gt;continuation());
</del><ins>+            ASSERT(!inlineChildrenBlock.continuation());
</ins><span class="cx">             // Cache this value as it might get changed in setStyle() call.
</span><del>-            bool inlineChildrenBlockHasLayer = inlineChildrenBlock-&gt;hasLayer();
-            inlineChildrenBlock-&gt;setStyle(RenderStyle::createAnonymousStyleWithDisplay(&amp;style(), BLOCK));
-            removeChildInternal(*inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
</del><ins>+            bool inlineChildrenBlockHasLayer = inlineChildrenBlock.hasLayer();
+            inlineChildrenBlock.setStyle(RenderStyle::createAnonymousStyleWithDisplay(&amp;style(), BLOCK));
+            removeChildInternal(inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
</ins><span class="cx">             
</span><span class="cx">             // Now just put the inlineChildrenBlock inside the blockChildrenBlock.
</span><del>-            RenderObject* beforeChild = prev == inlineChildrenBlock ? blockChildrenBlock-&gt;firstChild() : nullptr;
-            blockChildrenBlock-&gt;insertChildInternal(inlineChildrenBlock, beforeChild,
-                (inlineChildrenBlockHasLayer || blockChildrenBlock-&gt;hasLayer()) ? NotifyChildren : DontNotifyChildren);
</del><ins>+            RenderObject* beforeChild = prev == &amp;inlineChildrenBlock ? blockChildrenBlock.firstChild() : nullptr;
+            blockChildrenBlock.insertChildInternal(&amp;inlineChildrenBlock, beforeChild,
+                (inlineChildrenBlockHasLayer || blockChildrenBlock.hasLayer()) ? NotifyChildren : DontNotifyChildren);
</ins><span class="cx">             next-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">             
</span><span class="cx">             // inlineChildrenBlock got reparented to blockChildrenBlock, so it is no longer a child
</span><span class="cx">             // of &quot;this&quot;. we null out prev or next so that is not used later in the function.
</span><del>-            if (inlineChildrenBlock == prevBlock)
-                prev = 0;
</del><ins>+            if (&amp;inlineChildrenBlock == &amp;prevBlock)
+                prev = nullptr;
</ins><span class="cx">             else
</span><del>-                next = 0;
</del><ins>+                next = nullptr;
</ins><span class="cx">         } else {
</span><span class="cx">             // Take all the children out of the |next| block and put them in
</span><span class="cx">             // the |prev| block.
</span><del>-            nextBlock-&gt;moveAllChildrenIncludingFloatsTo(prevBlock, nextBlock-&gt;hasLayer() || prevBlock-&gt;hasLayer());
</del><ins>+            nextBlock.moveAllChildrenIncludingFloatsTo(&amp;prevBlock, nextBlock.hasLayer() || prevBlock.hasLayer());
</ins><span class="cx">             
</span><span class="cx">             // Delete the now-empty block's lines and nuke it.
</span><del>-            nextBlock-&gt;deleteLines();
-            nextBlock-&gt;destroy();
-            next = 0;
</del><ins>+            nextBlock.deleteLines();
+            nextBlock.destroy();
+            next = nullptr;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -836,17 +763,17 @@
</span><span class="cx">         // The removal has knocked us down to containing only a single anonymous
</span><span class="cx">         // box.  We can go ahead and pull the content right back up into our
</span><span class="cx">         // box.
</span><del>-        collapseAnonymousBoxChild(this, toRenderBlock(child));
</del><ins>+        collapseAnonymousBoxChild(*this, downcast&lt;RenderBlock&gt;(child));
</ins><span class="cx">         nextSibling = nullptr;
</span><span class="cx">     } else if (((prev &amp;&amp; prev-&gt;isAnonymousBlock()) || (next &amp;&amp; next-&gt;isAnonymousBlock())) &amp;&amp; canCollapseAnonymousBlockChild()) {
</span><span class="cx">         // It's possible that the removal has knocked us down to a single anonymous
</span><span class="cx">         // block with pseudo-style element siblings (e.g. first-letter). If these
</span><span class="cx">         // are floating, then we need to pull the content up also.
</span><del>-        RenderBlock* anonBlock = toRenderBlock((prev &amp;&amp; prev-&gt;isAnonymousBlock()) ? prev : next);
</del><ins>+        RenderBlock* anonBlock = downcast&lt;RenderBlock&gt;((prev &amp;&amp; prev-&gt;isAnonymousBlock()) ? prev : next);
</ins><span class="cx">         if ((anonBlock-&gt;previousSibling() || anonBlock-&gt;nextSibling())
</span><span class="cx">             &amp;&amp; (!anonBlock-&gt;previousSibling() || (anonBlock-&gt;previousSibling()-&gt;style().styleType() != NOPSEUDO &amp;&amp; anonBlock-&gt;previousSibling()-&gt;isFloating() &amp;&amp; !anonBlock-&gt;previousSibling()-&gt;previousSibling()))
</span><span class="cx">             &amp;&amp; (!anonBlock-&gt;nextSibling() || (anonBlock-&gt;nextSibling()-&gt;style().styleType() != NOPSEUDO &amp;&amp; anonBlock-&gt;nextSibling()-&gt;isFloating() &amp;&amp; !anonBlock-&gt;nextSibling()-&gt;nextSibling()))) {
</span><del>-            collapseAnonymousBoxChild(this, anonBlock);
</del><ins>+            collapseAnonymousBoxChild(*this, anonBlock);
</ins><span class="cx">             nextSibling = nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -864,23 +791,23 @@
</span><span class="cx">             auto containingBlockIgnoringAnonymous = containingBlock();
</span><span class="cx">             while (containingBlockIgnoringAnonymous &amp;&amp; containingBlockIgnoringAnonymous-&gt;isAnonymousBlock())
</span><span class="cx">                 containingBlockIgnoringAnonymous = containingBlockIgnoringAnonymous-&gt;containingBlock();
</span><del>-            for (RenderObject* curr = this; curr; curr = curr-&gt;previousInPreOrder(containingBlockIgnoringAnonymous)) {
-                if (curr-&gt;virtualContinuation() != this)
</del><ins>+            for (RenderObject* current = this; current; current = current-&gt;previousInPreOrder(containingBlockIgnoringAnonymous)) {
+                if (current-&gt;virtualContinuation() != this)
</ins><span class="cx">                     continue;
</span><span class="cx"> 
</span><span class="cx">                 // Found our previous continuation. We just need to point it to
</span><span class="cx">                 // |this|'s next continuation.
</span><span class="cx">                 RenderBoxModelObject* nextContinuation = continuation();
</span><del>-                if (curr-&gt;isRenderInline())
-                    toRenderInline(curr)-&gt;setContinuation(nextContinuation);
-                else if (curr-&gt;isRenderBlock())
-                    toRenderBlock(curr)-&gt;setContinuation(nextContinuation);
</del><ins>+                if (is&lt;RenderInline&gt;(*current))
+                    downcast&lt;RenderInline&gt;(*current).setContinuation(nextContinuation);
+                else if (is&lt;RenderBlock&gt;(*current))
+                    downcast&lt;RenderBlock&gt;(*current).setContinuation(nextContinuation);
</ins><span class="cx">                 else
</span><span class="cx">                     ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><del>-            setContinuation(0);
</del><ins>+            setContinuation(nullptr);
</ins><span class="cx">             destroy();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1741,11 +1668,11 @@
</span><span class="cx"> {
</span><span class="cx">     RenderBoxModelObject* currentContinuation = continuation();
</span><span class="cx">     if (!currentContinuation || currentContinuation-&gt;isInline())
</span><del>-        return 0;
-    RenderBlock* nextContinuation = toRenderBlock(currentContinuation);
-    if (nextContinuation-&gt;isAnonymousBlock())
-        return nextContinuation-&gt;blockElementContinuation();
-    return nextContinuation;
</del><ins>+        return nullptr;
+    RenderBlock&amp; nextContinuation = downcast&lt;RenderBlock&gt;(*currentContinuation);
+    if (nextContinuation.isAnonymousBlock())
+        return nextContinuation.blockElementContinuation();
+    return &amp;nextContinuation;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> static ContinuationOutlineTableMap* continuationOutlineTable()
</span><span class="lines">@@ -2042,7 +1969,7 @@
</span><span class="cx">             lastLogicalRight = logicalRightSelectionOffset(rootBlock, curr-&gt;logicalBottom(), cache);
</span><span class="cx">         } else if (childState != SelectionNone) {
</span><span class="cx">             // We must be a block that has some selected object inside it.  Go ahead and recur.
</span><del>-            result.unite(toRenderBlock(curr)-&gt;selectionGaps(rootBlock, rootBlockPhysicalPosition, LayoutSize(offsetFromRootBlock.width() + curr-&gt;x(), offsetFromRootBlock.height() + curr-&gt;y()), 
</del><ins>+            result.unite(downcast&lt;RenderBlock&gt;(*curr).selectionGaps(rootBlock, rootBlockPhysicalPosition, LayoutSize(offsetFromRootBlock.width() + curr-&gt;x(), offsetFromRootBlock.height() + curr-&gt;y()),
</ins><span class="cx">                 lastLogicalTop, lastLogicalLeft, lastLogicalRight, childCache, paintInfo));
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2162,29 +2089,29 @@
</span><span class="cx"> RenderBlock* RenderBlock::blockBeforeWithinSelectionRoot(LayoutSize&amp; offset) const
</span><span class="cx"> {
</span><span class="cx">     if (isSelectionRoot())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     const RenderElement* object = this;
</span><span class="cx">     RenderObject* sibling;
</span><span class="cx">     do {
</span><span class="cx">         sibling = object-&gt;previousSibling();
</span><del>-        while (sibling &amp;&amp; (!sibling-&gt;isRenderBlock() || toRenderBlock(sibling)-&gt;isSelectionRoot()))
</del><ins>+        while (sibling &amp;&amp; (!is&lt;RenderBlock&gt;(*sibling) || downcast&lt;RenderBlock&gt;(*sibling).isSelectionRoot()))
</ins><span class="cx">             sibling = sibling-&gt;previousSibling();
</span><span class="cx"> 
</span><del>-        offset -= LayoutSize(toRenderBlock(object)-&gt;logicalLeft(), toRenderBlock(object)-&gt;logicalTop());
</del><ins>+        offset -= LayoutSize(downcast&lt;RenderBlock&gt;(*object).logicalLeft(), downcast&lt;RenderBlock&gt;(*object).logicalTop());
</ins><span class="cx">         object = object-&gt;parent();
</span><del>-    } while (!sibling &amp;&amp; object &amp;&amp; object-&gt;isRenderBlock() &amp;&amp; !toRenderBlock(object)-&gt;isSelectionRoot());
</del><ins>+    } while (!sibling &amp;&amp; is&lt;RenderBlock&gt;(object) &amp;&amp; !downcast&lt;RenderBlock&gt;(*object).isSelectionRoot());
</ins><span class="cx"> 
</span><span class="cx">     if (!sibling)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    RenderBlock* beforeBlock = toRenderBlock(sibling);
</del><ins>+    RenderBlock* beforeBlock = downcast&lt;RenderBlock&gt;(sibling);
</ins><span class="cx"> 
</span><span class="cx">     offset += LayoutSize(beforeBlock-&gt;logicalLeft(), beforeBlock-&gt;logicalTop());
</span><span class="cx"> 
</span><span class="cx">     RenderObject* child = beforeBlock-&gt;lastChild();
</span><del>-    while (child &amp;&amp; child-&gt;isRenderBlock()) {
-        beforeBlock = toRenderBlock(child);
</del><ins>+    while (is&lt;RenderBlock&gt;(child)) {
+        beforeBlock = downcast&lt;RenderBlock&gt;(child);
</ins><span class="cx">         offset += LayoutSize(beforeBlock-&gt;logicalLeft(), beforeBlock-&gt;logicalTop());
</span><span class="cx">         child = beforeBlock-&gt;lastChild();
</span><span class="cx">     }
</span><span class="lines">@@ -2682,7 +2609,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!region)
</span><span class="cx">         return true;
</span><del>-    const RenderBlock&amp; block = box.isRenderBlock() ? toRenderBlock(box) : *box.containingBlock();
</del><ins>+    const RenderBlock&amp; block = is&lt;RenderBlock&gt;(box) ? downcast&lt;RenderBlock&gt;(box) : *box.containingBlock();
</ins><span class="cx">     return block.regionAtBlockOffset(point.y()) == region;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3042,11 +2969,11 @@
</span><span class="cx">         if (firstLineBlock-&gt;isReplaced() || firstLineBlock-&gt;isFloating()
</span><span class="cx">             || !parentBlock || parentBlock-&gt;firstChild() != firstLineBlock || !isRenderBlockFlowOrRenderButton(*parentBlock))
</span><span class="cx">             break;
</span><del>-        firstLineBlock = toRenderBlock(parentBlock);
</del><ins>+        firstLineBlock = downcast&lt;RenderBlock&gt;(parentBlock);
</ins><span class="cx">     } 
</span><span class="cx">     
</span><span class="cx">     if (!hasPseudo)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     return firstLineBlock;
</span><span class="cx"> }
</span><span class="lines">@@ -3125,11 +3052,11 @@
</span><span class="cx">         RenderElement* parentBlock = firstLetterBlock-&gt;parent();
</span><span class="cx">         if (firstLetterBlock-&gt;isReplaced() || !parentBlock || parentBlock-&gt;firstChild() != firstLetterBlock
</span><span class="cx">             || !isRenderBlockFlowOrRenderButton(*parentBlock))
</span><del>-            return 0;
-        firstLetterBlock = toRenderBlock(parentBlock);
</del><ins>+            return nullptr;
+        firstLetterBlock = downcast&lt;RenderBlock&gt;(parentBlock);
</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"> void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* currentChild)
</span><span class="lines">@@ -3421,8 +3348,8 @@
</span><span class="cx"> void RenderBlock::childBecameNonInline(RenderObject*)
</span><span class="cx"> {
</span><span class="cx">     makeChildrenNonInline();
</span><del>-    if (isAnonymousBlock() &amp;&amp; parent() &amp;&amp; parent()-&gt;isRenderBlock())
-        toRenderBlock(parent())-&gt;removeLeftoverAnonymousBlock(this);
</del><ins>+    if (isAnonymousBlock() &amp;&amp; is&lt;RenderBlock&gt;(parent()))
+        downcast&lt;RenderBlock&gt;(*parent()).removeLeftoverAnonymousBlock(this);
</ins><span class="cx">     // |this| may be dead here
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3671,12 +3598,12 @@
</span><span class="cx">     // If the child has the same directionality as we do, then we can just return its
</span><span class="cx">     // margin quirk.
</span><span class="cx">     if (!child.isWritingModeRoot())
</span><del>-        return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
</del><ins>+        return is&lt;RenderBlock&gt;(child) ? downcast&lt;RenderBlock&gt;(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
</ins><span class="cx">     
</span><span class="cx">     // The child has a different directionality. If the child is parallel, then it's just
</span><span class="cx">     // flipped relative to us. We can use the opposite edge.
</span><span class="cx">     if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
</span><del>-        return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
</del><ins>+        return is&lt;RenderBlock&gt;(child) ? downcast&lt;RenderBlock&gt;(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
</ins><span class="cx">     
</span><span class="cx">     // The child is perpendicular to us and box sides are never quirky in html.css, and we don't really care about
</span><span class="cx">     // whether or not authors specified quirky ems, since they're an implementation detail.
</span><span class="lines">@@ -3688,12 +3615,12 @@
</span><span class="cx">     // If the child has the same directionality as we do, then we can just return its
</span><span class="cx">     // margin quirk.
</span><span class="cx">     if (!child.isWritingModeRoot())
</span><del>-        return child.isRenderBlock() ? toRenderBlock(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
</del><ins>+        return is&lt;RenderBlock&gt;(child) ? downcast&lt;RenderBlock&gt;(child).hasMarginAfterQuirk() : child.style().hasMarginAfterQuirk();
</ins><span class="cx">     
</span><span class="cx">     // The child has a different directionality. If the child is parallel, then it's just
</span><span class="cx">     // flipped relative to us. We can use the opposite edge.
</span><span class="cx">     if (child.isHorizontalWritingMode() == isHorizontalWritingMode())
</span><del>-        return child.isRenderBlock() ? toRenderBlock(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
</del><ins>+        return is&lt;RenderBlock&gt;(child) ? downcast&lt;RenderBlock&gt;(child).hasMarginBeforeQuirk() : child.style().hasMarginBeforeQuirk();
</ins><span class="cx">     
</span><span class="cx">     // The child is perpendicular to us and box sides are never quirky in html.css, and we don't really care about
</span><span class="cx">     // whether or not authors specified quirky ems, since they're an implementation detail.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> 
</span><span class="cx">     static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK);
</span><span class="cx">     RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); }
</span><del>-    static void collapseAnonymousBoxChild(RenderBlock* parent, RenderBlock* child);
</del><ins>+    static void collapseAnonymousBoxChild(RenderBlock&amp; parent, RenderBlock* child);
</ins><span class="cx"> 
</span><span class="cx">     virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const override;
</span><span class="cx"> 
</span><span class="lines">@@ -486,10 +486,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool expandsToEncloseOverhangingFloats() const;
</span><span class="cx"> 
</span><del>-    void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
-                     RenderObject* beforeChild, RenderBoxModelObject* oldCont);
-    void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
-                   RenderObject* newChild, RenderBoxModelObject* oldCont);
</del><span class="cx">     RenderPtr&lt;RenderBlock&gt; clone() const;
</span><span class="cx">     RenderBlock* continuationBefore(RenderObject* beforeChild);
</span><span class="cx"> 
</span><span class="lines">@@ -530,8 +526,6 @@
</span><span class="cx">     static bool s_canPropagateFloatIntoSibling;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock())
-
</del><span class="cx"> LayoutUnit blockDirectionOffset(RenderBlock&amp; rootBlock, const LayoutSize&amp; offsetFromRootBlock);
</span><span class="cx"> LayoutUnit inlineDirectionOffset(RenderBlock&amp; rootBlock, const LayoutSize&amp; offsetFromRootBlock);
</span><span class="cx"> VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock&amp;, RenderBox&amp;, const LayoutPoint&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1219,10 +1219,10 @@
</span><span class="cx">     // Make sure to update the block margins now for the grandchild box so that we're looking at current values.
</span><span class="cx">     if (grandchildBox-&gt;needsLayout()) {
</span><span class="cx">         grandchildBox-&gt;computeAndSetBlockDirectionMargins(this);
</span><del>-        if (grandchildBox-&gt;isRenderBlock()) {
-            RenderBlock* grandchildBlock = toRenderBlock(grandchildBox);
-            grandchildBlock-&gt;setHasMarginBeforeQuirk(grandchildBox-&gt;style().hasMarginBeforeQuirk());
-            grandchildBlock-&gt;setHasMarginAfterQuirk(grandchildBox-&gt;style().hasMarginAfterQuirk());
</del><ins>+        if (is&lt;RenderBlock&gt;(*grandchildBox)) {
+            RenderBlock&amp; grandchildBlock = downcast&lt;RenderBlock&gt;(*grandchildBox);
+            grandchildBlock.setHasMarginBeforeQuirk(grandchildBox-&gt;style().hasMarginBeforeQuirk());
+            grandchildBlock.setHasMarginAfterQuirk(grandchildBox-&gt;style().hasMarginAfterQuirk());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1274,8 +1274,8 @@
</span><span class="cx">         // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
</span><span class="cx">         logicalTopEstimate = adjustForUnsplittableChild(child, logicalTopEstimate);
</span><span class="cx">         
</span><del>-        if (!child.selfNeedsLayout() &amp;&amp; child.isRenderBlock())
-            logicalTopEstimate += toRenderBlock(child).paginationStrut();
</del><ins>+        if (!child.selfNeedsLayout() &amp;&amp; is&lt;RenderBlock&gt;(child))
+            logicalTopEstimate += downcast&lt;RenderBlock&gt;(child).paginationStrut();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return logicalTopEstimate;
</span><span class="lines">@@ -1522,7 +1522,7 @@
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, LayoutUnit estimateWithoutPagination, RenderBox&amp; child, bool atBeforeSideOfBlock)
</span><span class="cx"> {
</span><del>-    RenderBlock* childRenderBlock = child.isRenderBlock() ? toRenderBlock(&amp;child) : nullptr;
</del><ins>+    RenderBlock* childRenderBlock = is&lt;RenderBlock&gt;(child) ? &amp;downcast&lt;RenderBlock&gt;(child) : nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (estimateWithoutPagination != logicalTopAfterClear) {
</span><span class="cx">         // Our guess prior to pagination movement was wrong. Before we attempt to paginate, let's try again at the new
</span><span class="lines">@@ -2457,7 +2457,7 @@
</span><span class="cx">             // See if we have a pagination strut that is making us move down further.
</span><span class="cx">             // Note that an unsplittable child can't also have a pagination strut, so this is
</span><span class="cx">             // exclusive with the case above.
</span><del>-            RenderBlock* childBlock = childBox.isRenderBlock() ? toRenderBlock(&amp;childBox) : nullptr;
</del><ins>+            RenderBlock* childBlock = is&lt;RenderBlock&gt;(childBox) ? &amp;downcast&lt;RenderBlock&gt;(childBox) : nullptr;
</ins><span class="cx">             if (childBlock &amp;&amp; childBlock-&gt;paginationStrut()) {
</span><span class="cx">                 newLogicalTop += childBlock-&gt;paginationStrut();
</span><span class="cx">                 childBlock-&gt;setPaginationStrut(0);
</span><span class="lines">@@ -2729,16 +2729,16 @@
</span><span class="cx">     auto end = floatingObjectSet.end();
</span><span class="cx"> 
</span><span class="cx">     for (RenderObject* next = nextSibling(); next; next = next-&gt;nextSibling()) {
</span><del>-        if (!next-&gt;isRenderBlockFlow() || next-&gt;isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)-&gt;avoidsFloats())
</del><ins>+        if (!is&lt;RenderBlockFlow&gt;(*next) || next-&gt;isFloatingOrOutOfFlowPositioned() || downcast&lt;RenderBlockFlow&gt;(*next).avoidsFloats())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        RenderBlockFlow* nextBlock = toRenderBlockFlow(next);
</del><ins>+        RenderBlockFlow&amp; nextBlock = downcast&lt;RenderBlockFlow&gt;(*next);
</ins><span class="cx">         for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><span class="cx">             RenderBox&amp; floatingBox = (*it)-&gt;renderer();
</span><span class="cx">             if (floatToRemove &amp;&amp; &amp;floatingBox != floatToRemove)
</span><span class="cx">                 continue;
</span><del>-            if (nextBlock-&gt;containsFloat(floatingBox))
-                nextBlock-&gt;markAllDescendantsWithFloatsForLayout(&amp;floatingBox);
</del><ins>+            if (nextBlock.containsFloat(floatingBox))
+                nextBlock.markAllDescendantsWithFloatsForLayout(&amp;floatingBox);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1894,8 +1894,8 @@
</span><span class="cx"> 
</span><span class="cx">             if (updateRegionRangeForBoxChild(floatingObject-&gt;renderer()))
</span><span class="cx">                 floatBox.setNeedsLayout(MarkOnlyThis);
</span><del>-            else if (floatBox.isRenderBlock())
-                toRenderBlock(floatBox).setChildNeedsLayout(MarkOnlyThis);
</del><ins>+            else if (is&lt;RenderBlock&gt;(floatBox))
+                downcast&lt;RenderBlock&gt;(floatBox).setChildNeedsLayout(MarkOnlyThis);
</ins><span class="cx">             floatBox.layoutIfNeeded();
</span><span class="cx"> 
</span><span class="cx">             // Save the old logical top before calling removePlacedObject which will set
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -2947,20 +2947,20 @@
</span><span class="cx">         case Calculated:
</span><span class="cx">         {
</span><span class="cx">             auto cb = isOutOfFlowPositioned() ? container() : containingBlock();
</span><del>-            while (cb-&gt;isAnonymous() &amp;&amp; !cb-&gt;isRenderView()) {
</del><ins>+            while (cb-&gt;isAnonymous() &amp;&amp; !is&lt;RenderView&gt;(*cb)) {
</ins><span class="cx">                 cb = cb-&gt;containingBlock();
</span><del>-                toRenderBlock(cb)-&gt;addPercentHeightDescendant(const_cast&lt;RenderBox&amp;&gt;(*this));
</del><ins>+                downcast&lt;RenderBlock&gt;(*cb).addPercentHeightDescendant(const_cast&lt;RenderBox&amp;&gt;(*this));
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             // FIXME: This calculation is not patched for block-flow yet.
</span><span class="cx">             // https://bugs.webkit.org/show_bug.cgi?id=46500
</span><span class="cx">             if (cb-&gt;isOutOfFlowPositioned() &amp;&amp; cb-&gt;style().height().isAuto() &amp;&amp; !(cb-&gt;style().top().isAuto() || cb-&gt;style().bottom().isAuto())) {
</span><span class="cx">                 ASSERT_WITH_SECURITY_IMPLICATION(cb-&gt;isRenderBlock());
</span><del>-                RenderBlock* block = toRenderBlock(cb);
</del><ins>+                RenderBlock&amp; block = downcast&lt;RenderBlock&gt;(*cb);
</ins><span class="cx">                 LogicalExtentComputedValues computedValues;
</span><del>-                block-&gt;computeLogicalHeight(block-&gt;logicalHeight(), 0, computedValues);
-                LayoutUnit newContentHeight = computedValues.m_extent - block-&gt;borderAndPaddingLogicalHeight() - block-&gt;scrollbarLogicalHeight();
-                LayoutUnit newHeight = block-&gt;adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
</del><ins>+                block.computeLogicalHeight(block.logicalHeight(), 0, computedValues);
+                LayoutUnit newContentHeight = computedValues.m_extent - block.borderAndPaddingLogicalHeight() - block.scrollbarLogicalHeight();
+                LayoutUnit newHeight = block.adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
</ins><span class="cx">                 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logicalHeight, newHeight));
</span><span class="cx">             }
</span><span class="cx">             
</span><span class="lines">@@ -2984,7 +2984,7 @@
</span><span class="cx">                         availableHeight = std::max(availableHeight, intrinsicLogicalHeight());
</span><span class="cx">                         return valueForLength(logicalHeight, availableHeight - borderAndPaddingLogicalHeight());
</span><span class="cx">                     }
</span><del>-                    toRenderBlock(cb)-&gt;addPercentHeightDescendant(const_cast&lt;RenderBox&amp;&gt;(*this));
</del><ins>+                    downcast&lt;RenderBlock&gt;(*cb).addPercentHeightDescendant(const_cast&lt;RenderBox&amp;&gt;(*this));
</ins><span class="cx">                     cb = cb-&gt;containingBlock();
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -3023,11 +3023,11 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=46500
</span><del>-    if (isRenderBlock() &amp;&amp; isOutOfFlowPositioned() &amp;&amp; style().height().isAuto() &amp;&amp; !(style().top().isAuto() || style().bottom().isAuto())) {
-        RenderBlock* block = const_cast&lt;RenderBlock*&gt;(toRenderBlock(this));
</del><ins>+    if (is&lt;RenderBlock&gt;(*this) &amp;&amp; isOutOfFlowPositioned() &amp;&amp; style().height().isAuto() &amp;&amp; !(style().top().isAuto() || style().bottom().isAuto())) {
+        RenderBlock&amp; block = const_cast&lt;RenderBlock&amp;&gt;(downcast&lt;RenderBlock&gt;(*this));
</ins><span class="cx">         LogicalExtentComputedValues computedValues;
</span><del>-        block-&gt;computeLogicalHeight(block-&gt;logicalHeight(), 0, computedValues);
-        LayoutUnit newContentHeight = computedValues.m_extent - block-&gt;borderAndPaddingLogicalHeight() - block-&gt;scrollbarLogicalHeight();
</del><ins>+        block.computeLogicalHeight(block.logicalHeight(), 0, computedValues);
+        LayoutUnit newContentHeight = computedValues.m_extent - block.borderAndPaddingLogicalHeight() - block.scrollbarLogicalHeight();
</ins><span class="cx">         return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3072,39 +3072,39 @@
</span><span class="cx">     if (checkForPerpendicularWritingMode &amp;&amp; containingBlock-&gt;isHorizontalWritingMode() != isHorizontalWritingMode())
</span><span class="cx">         return containingBlockLogicalHeightForPositioned(containingBlock, false);
</span><span class="cx"> 
</span><del>-    if (containingBlock-&gt;isBox()) {
</del><ins>+    if (is&lt;RenderBox&gt;(*containingBlock)) {
</ins><span class="cx">         bool isFixedPosition = style().position() == FixedPosition;
</span><span class="cx"> 
</span><span class="cx">         RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><span class="cx">         if (!flowThread) {
</span><del>-            if (isFixedPosition &amp;&amp; containingBlock-&gt;isRenderView())
-                return toRenderView(containingBlock)-&gt;clientLogicalWidthForFixedPosition();
</del><ins>+            if (isFixedPosition &amp;&amp; is&lt;RenderView&gt;(*containingBlock))
+                return downcast&lt;RenderView&gt;(*containingBlock).clientLogicalWidthForFixedPosition();
</ins><span class="cx"> 
</span><del>-            return toRenderBox(containingBlock)-&gt;clientLogicalWidth();
</del><ins>+            return downcast&lt;RenderBox&gt;(*containingBlock).clientLogicalWidth();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (isFixedPosition &amp;&amp; containingBlock-&gt;isRenderNamedFlowThread())
</del><ins>+        if (isFixedPosition &amp;&amp; is&lt;RenderNamedFlowThread&gt;(*containingBlock))
</ins><span class="cx">             return containingBlock-&gt;view().clientLogicalWidth();
</span><span class="cx"> 
</span><del>-        if (!containingBlock-&gt;isRenderBlock())
-            return toRenderBox(*containingBlock).clientLogicalWidth();
</del><ins>+        if (!is&lt;RenderBlock&gt;(*containingBlock))
+            return downcast&lt;RenderBox&gt;(*containingBlock).clientLogicalWidth();
</ins><span class="cx"> 
</span><del>-        const RenderBlock* cb = toRenderBlock(containingBlock);
-        RenderBoxRegionInfo* boxInfo = 0;
</del><ins>+        const RenderBlock&amp; cb = downcast&lt;RenderBlock&gt;(*containingBlock);
+        RenderBoxRegionInfo* boxInfo = nullptr;
</ins><span class="cx">         if (!region) {
</span><span class="cx">             if (containingBlock-&gt;isRenderFlowThread() &amp;&amp; !checkForPerpendicularWritingMode)
</span><span class="cx">                 return toRenderFlowThread(containingBlock)-&gt;contentLogicalWidthOfFirstRegion();
</span><span class="cx">             if (isWritingModeRoot()) {
</span><del>-                LayoutUnit cbPageOffset = cb-&gt;offsetFromLogicalTopOfFirstPage();
-                RenderRegion* cbRegion = cb-&gt;regionAtBlockOffset(cbPageOffset);
</del><ins>+                LayoutUnit cbPageOffset = cb.offsetFromLogicalTopOfFirstPage();
+                RenderRegion* cbRegion = cb.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx">                 if (cbRegion)
</span><del>-                    boxInfo = cb-&gt;renderBoxRegionInfo(cbRegion);
</del><ins>+                    boxInfo = cb.renderBoxRegionInfo(cbRegion);
</ins><span class="cx">             }
</span><span class="cx">         } else if (region &amp;&amp; flowThread-&gt;isHorizontalWritingMode() == containingBlock-&gt;isHorizontalWritingMode()) {
</span><del>-            RenderRegion* containingBlockRegion = cb-&gt;clampToStartAndEndRegions(region);
-            boxInfo = cb-&gt;renderBoxRegionInfo(containingBlockRegion);
</del><ins>+            RenderRegion* containingBlockRegion = cb.clampToStartAndEndRegions(region);
+            boxInfo = cb.renderBoxRegionInfo(containingBlockRegion);
</ins><span class="cx">         }
</span><del>-        return (boxInfo) ? std::max&lt;LayoutUnit&gt;(0, cb-&gt;clientLogicalWidth() - (cb-&gt;logicalWidth() - boxInfo-&gt;logicalWidth())) : cb-&gt;clientLogicalWidth();
</del><ins>+        return (boxInfo) ? std::max&lt;LayoutUnit&gt;(0, cb.clientLogicalWidth() - (cb.logicalWidth() - boxInfo-&gt;logicalWidth())) : cb.clientLogicalWidth();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(containingBlock-&gt;isRenderInline() &amp;&amp; containingBlock-&gt;isInFlowPositioned());
</span><span class="lines">@@ -3133,37 +3133,37 @@
</span><span class="cx"> LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode) const
</span><span class="cx"> {
</span><span class="cx">     if (checkForPerpendicularWritingMode &amp;&amp; containingBlock-&gt;isHorizontalWritingMode() != isHorizontalWritingMode())
</span><del>-        return containingBlockLogicalWidthForPositioned(containingBlock, 0, false);
</del><ins>+        return containingBlockLogicalWidthForPositioned(containingBlock, nullptr, false);
</ins><span class="cx"> 
</span><span class="cx">     if (containingBlock-&gt;isBox()) {
</span><span class="cx">         bool isFixedPosition = style().position() == FixedPosition;
</span><span class="cx"> 
</span><del>-        if (isFixedPosition &amp;&amp; containingBlock-&gt;isRenderView())
-            return toRenderView(containingBlock)-&gt;clientLogicalHeightForFixedPosition();
</del><ins>+        if (isFixedPosition &amp;&amp; is&lt;RenderView&gt;(*containingBlock))
+            return downcast&lt;RenderView&gt;(*containingBlock).clientLogicalHeightForFixedPosition();
</ins><span class="cx"> 
</span><del>-        const RenderBlock* cb = containingBlock-&gt;isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock-&gt;containingBlock();
</del><ins>+        const RenderBlock* cb = is&lt;RenderBlock&gt;(*containingBlock) ? downcast&lt;RenderBlock&gt;(containingBlock) : containingBlock-&gt;containingBlock();
</ins><span class="cx">         LayoutUnit result = cb-&gt;clientLogicalHeight();
</span><span class="cx">         RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><del>-        if (flowThread &amp;&amp; containingBlock-&gt;isRenderFlowThread() &amp;&amp; flowThread-&gt;isHorizontalWritingMode() == containingBlock-&gt;isHorizontalWritingMode()) {
-            if (containingBlock-&gt;isRenderNamedFlowThread() &amp;&amp; isFixedPosition)
</del><ins>+        if (flowThread &amp;&amp; is&lt;RenderFlowThread&gt;(*containingBlock) &amp;&amp; flowThread-&gt;isHorizontalWritingMode() == containingBlock-&gt;isHorizontalWritingMode()) {
+            if (is&lt;RenderNamedFlowThread&gt;(*containingBlock) &amp;&amp; isFixedPosition)
</ins><span class="cx">                 return containingBlock-&gt;view().clientLogicalHeight();
</span><del>-            return toRenderFlowThread(containingBlock)-&gt;contentLogicalHeightOfFirstRegion();
</del><ins>+            return downcast&lt;RenderFlowThread&gt;(*containingBlock).contentLogicalHeightOfFirstRegion();
</ins><span class="cx">         }
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx">         
</span><del>-    ASSERT(containingBlock-&gt;isRenderInline() &amp;&amp; containingBlock-&gt;isInFlowPositioned());
</del><ins>+    ASSERT(is&lt;RenderInline&gt;(*containingBlock) &amp;&amp; containingBlock-&gt;isInFlowPositioned());
</ins><span class="cx"> 
</span><del>-    const RenderInline* flow = toRenderInline(containingBlock);
-    InlineFlowBox* first = flow-&gt;firstLineBox();
-    InlineFlowBox* last = flow-&gt;lastLineBox();
</del><ins>+    const RenderInline&amp; flow = downcast&lt;RenderInline&gt;(*containingBlock);
+    InlineFlowBox* first = flow.firstLineBox();
+    InlineFlowBox* last = flow.lastLineBox();
</ins><span class="cx"> 
</span><span class="cx">     // If the containing block is empty, return a height of 0.
</span><span class="cx">     if (!first || !last)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit heightResult;
</span><del>-    LayoutRect boundingBox = flow-&gt;linesBoundingBox();
</del><ins>+    LayoutRect boundingBox = flow.linesBoundingBox();
</ins><span class="cx">     if (containingBlock-&gt;isHorizontalWritingMode())
</span><span class="cx">         heightResult = boundingBox.height();
</span><span class="cx">     else
</span><span class="lines">@@ -3180,13 +3180,13 @@
</span><span class="cx">     // FIXME: The static distance computation has not been patched for mixed writing modes yet.
</span><span class="cx">     if (child-&gt;parent()-&gt;style().direction() == LTR) {
</span><span class="cx">         LayoutUnit staticPosition = child-&gt;layer()-&gt;staticInlinePosition() - containerBlock-&gt;borderLogicalLeft();
</span><del>-        for (auto curr = child-&gt;parent(); curr &amp;&amp; curr != containerBlock; curr = curr-&gt;container()) {
-            if (curr-&gt;isBox()) {
-                staticPosition += toRenderBox(curr)-&gt;logicalLeft();
-                if (region &amp;&amp; toRenderBox(curr)-&gt;isRenderBlock()) {
-                    const RenderBlock* cb = toRenderBlock(curr);
-                    region = cb-&gt;clampToStartAndEndRegions(region);
-                    RenderBoxRegionInfo* boxInfo = cb-&gt;renderBoxRegionInfo(region);
</del><ins>+        for (auto current = child-&gt;parent(); current &amp;&amp; current != containerBlock; current = current-&gt;container()) {
+            if (is&lt;RenderBox&gt;(*current)) {
+                staticPosition += downcast&lt;RenderBox&gt;(*current).logicalLeft();
+                if (region &amp;&amp; is&lt;RenderBlock&gt;(*current)) {
+                    const RenderBlock&amp; currentBlock = downcast&lt;RenderBlock&gt;(*current);
+                    region = currentBlock.clampToStartAndEndRegions(region);
+                    RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region);
</ins><span class="cx">                     if (boxInfo)
</span><span class="cx">                         staticPosition += boxInfo-&gt;logicalLeft();
</span><span class="cx">                 }
</span><span class="lines">@@ -3196,25 +3196,25 @@
</span><span class="cx">     } else {
</span><span class="cx">         RenderBox&amp; enclosingBox = child-&gt;parent()-&gt;enclosingBox();
</span><span class="cx">         LayoutUnit staticPosition = child-&gt;layer()-&gt;staticInlinePosition() + containerLogicalWidth + containerBlock-&gt;borderLogicalLeft();
</span><del>-        for (RenderElement* curr = &amp;enclosingBox; curr; curr = curr-&gt;container()) {
-            if (curr-&gt;isBox()) {
-                if (curr != containerBlock)
-                    staticPosition -= toRenderBox(curr)-&gt;logicalLeft();
-                if (curr == &amp;enclosingBox)
</del><ins>+        for (RenderElement* current = &amp;enclosingBox; current; current = current-&gt;container()) {
+            if (is&lt;RenderBox&gt;(*current)) {
+                if (current != containerBlock)
+                    staticPosition -= downcast&lt;RenderBox&gt;(*current).logicalLeft();
+                if (current == &amp;enclosingBox)
</ins><span class="cx">                     staticPosition -= enclosingBox.logicalWidth();
</span><del>-                if (region &amp;&amp; curr-&gt;isRenderBlock()) {
-                    const RenderBlock* cb = toRenderBlock(curr);
-                    region = cb-&gt;clampToStartAndEndRegions(region);
-                    RenderBoxRegionInfo* boxInfo = cb-&gt;renderBoxRegionInfo(region);
</del><ins>+                if (region &amp;&amp; is&lt;RenderBlock&gt;(*current)) {
+                    const RenderBlock&amp; currentBlock = downcast&lt;RenderBlock&gt;(*current);
+                    region = currentBlock.clampToStartAndEndRegions(region);
+                    RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region);
</ins><span class="cx">                     if (boxInfo) {
</span><del>-                        if (curr != containerBlock)
-                            staticPosition -= cb-&gt;logicalWidth() - (boxInfo-&gt;logicalLeft() + boxInfo-&gt;logicalWidth());
-                        if (curr == &amp;enclosingBox)
</del><ins>+                        if (current != containerBlock)
+                            staticPosition -= currentBlock.logicalWidth() - (boxInfo-&gt;logicalLeft() + boxInfo-&gt;logicalWidth());
+                        if (current == &amp;enclosingBox)
</ins><span class="cx">                             staticPosition += enclosingBox.logicalWidth() - boxInfo-&gt;logicalWidth();
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            if (curr == containerBlock)
</del><ins>+            if (current == containerBlock)
</ins><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">         logicalRight.setValue(Fixed, staticPosition);
</span><span class="lines">@@ -3338,14 +3338,14 @@
</span><span class="cx">     // Adjust logicalLeft if we need to for the flipped version of our writing mode in regions.
</span><span class="cx">     // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
</span><span class="cx">     RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><del>-    if (flowThread &amp;&amp; !region &amp;&amp; isWritingModeRoot() &amp;&amp; isHorizontalWritingMode() == containerBlock-&gt;isHorizontalWritingMode() &amp;&amp; containerBlock-&gt;isRenderBlock()) {
</del><ins>+    if (flowThread &amp;&amp; !region &amp;&amp; isWritingModeRoot() &amp;&amp; isHorizontalWritingMode() == containerBlock-&gt;isHorizontalWritingMode() &amp;&amp; is&lt;RenderBlock&gt;(*containerBlock)) {
</ins><span class="cx">         ASSERT(containerBlock-&gt;canHaveBoxInfoInRegion());
</span><span class="cx">         LayoutUnit logicalLeftPos = computedValues.m_position;
</span><del>-        const RenderBlock* cb = toRenderBlock(containerBlock);
-        LayoutUnit cbPageOffset = cb-&gt;offsetFromLogicalTopOfFirstPage();
-        RenderRegion* cbRegion = cb-&gt;regionAtBlockOffset(cbPageOffset);
</del><ins>+        const RenderBlock&amp; renderBlock = downcast&lt;RenderBlock&gt;(*containerBlock);
+        LayoutUnit cbPageOffset = renderBlock.offsetFromLogicalTopOfFirstPage();
+        RenderRegion* cbRegion = renderBlock.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx">         if (cbRegion) {
</span><del>-            RenderBoxRegionInfo* boxInfo = cb-&gt;renderBoxRegionInfo(cbRegion);
</del><ins>+            RenderBoxRegionInfo* boxInfo = renderBlock.renderBoxRegionInfo(cbRegion);
</ins><span class="cx">             if (boxInfo) {
</span><span class="cx">                 logicalLeftPos += boxInfo-&gt;logicalLeft();
</span><span class="cx">                 computedValues.m_position = logicalLeftPos;
</span><span class="lines">@@ -3655,14 +3655,14 @@
</span><span class="cx">     // Adjust logicalTop if we need to for perpendicular writing modes in regions.
</span><span class="cx">     // FIXME: Add support for other types of objects as containerBlock, not only RenderBlock.
</span><span class="cx">     RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><del>-    if (flowThread &amp;&amp; isHorizontalWritingMode() != containerBlock-&gt;isHorizontalWritingMode() &amp;&amp; containerBlock-&gt;isRenderBlock()) {
</del><ins>+    if (flowThread &amp;&amp; isHorizontalWritingMode() != containerBlock-&gt;isHorizontalWritingMode() &amp;&amp; is&lt;RenderBlock&gt;(*containerBlock)) {
</ins><span class="cx">         ASSERT(containerBlock-&gt;canHaveBoxInfoInRegion());
</span><span class="cx">         LayoutUnit logicalTopPos = computedValues.m_position;
</span><del>-        const RenderBlock* cb = toRenderBlock(containerBlock);
-        LayoutUnit cbPageOffset = cb-&gt;offsetFromLogicalTopOfFirstPage() - logicalLeft();
-        RenderRegion* cbRegion = cb-&gt;regionAtBlockOffset(cbPageOffset);
</del><ins>+        const RenderBlock&amp; renderBox = downcast&lt;RenderBlock&gt;(*containerBlock);
+        LayoutUnit cbPageOffset = renderBox.offsetFromLogicalTopOfFirstPage() - logicalLeft();
+        RenderRegion* cbRegion = renderBox.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx">         if (cbRegion) {
</span><del>-            RenderBoxRegionInfo* boxInfo = cb-&gt;renderBoxRegionInfo(cbRegion);
</del><ins>+            RenderBoxRegionInfo* boxInfo = renderBox.renderBoxRegionInfo(cbRegion);
</ins><span class="cx">             if (boxInfo) {
</span><span class="cx">                 logicalTopPos += boxInfo-&gt;logicalLeft();
</span><span class="cx">                 computedValues.m_position = logicalTopPos;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -213,11 +213,11 @@
</span><span class="cx">     if (!child-&gt;isAnonymousBlock() || !child-&gt;isInFlowPositioned())
</span><span class="cx">         return LayoutSize();
</span><span class="cx">     LayoutSize offset;
</span><del>-    RenderElement* p = toRenderBlock(child)-&gt;inlineElementContinuation();
-    while (p &amp;&amp; p-&gt;isRenderInline()) {
</del><ins>+    RenderElement* p = downcast&lt;RenderBlock&gt;(*child).inlineElementContinuation();
+    while (is&lt;RenderInline&gt;(p)) {
</ins><span class="cx">         if (p-&gt;isInFlowPositioned()) {
</span><del>-            RenderInline* renderInline = toRenderInline(p);
-            offset += renderInline-&gt;offsetForInFlowPosition();
</del><ins>+            RenderInline&amp; renderInline = downcast&lt;RenderInline&gt;(*p);
+            offset += renderInline.offsetForInFlowPosition();
</ins><span class="cx">         }
</span><span class="cx">         p = p-&gt;parent();
</span><span class="cx">     }
</span><span class="lines">@@ -2674,7 +2674,7 @@
</span><span class="cx"> {
</span><span class="cx">     // We assume that callers have cleared their positioned objects list for child moves (!fullRemoveInsert) so the
</span><span class="cx">     // positioned renderer maps don't become stale. It would be too slow to do the map lookup on each call.
</span><del>-    ASSERT(!fullRemoveInsert || !isRenderBlock() || !toRenderBlock(this)-&gt;hasPositionedObjects());
</del><ins>+    ASSERT(!fullRemoveInsert || !is&lt;RenderBlock&gt;(*this) || !downcast&lt;RenderBlock&gt;(*this).hasPositionedObjects());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(this == child-&gt;parent());
</span><span class="cx">     ASSERT(!beforeChild || toBoxModelObject == beforeChild-&gt;parent());
</span><span class="lines">@@ -2695,10 +2695,10 @@
</span><span class="cx">     // This condition is rarely hit since this function is usually called on
</span><span class="cx">     // anonymous blocks which can no longer carry positioned objects (see r120761)
</span><span class="cx">     // or when fullRemoveInsert is false.
</span><del>-    if (fullRemoveInsert &amp;&amp; isRenderBlock()) {
-        toRenderBlock(this)-&gt;removePositionedObjects(0);
-        if (isRenderBlockFlow())
-            toRenderBlockFlow(this)-&gt;removeFloatingObjects(); 
</del><ins>+    if (fullRemoveInsert &amp;&amp; is&lt;RenderBlock&gt;(*this)) {
+        downcast&lt;RenderBlock&gt;(*this).removePositionedObjects(nullptr);
+        if (is&lt;RenderBlockFlow&gt;(*this))
+            downcast&lt;RenderBlockFlow&gt;(*this).removeFloatingObjects();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!beforeChild || toBoxModelObject == beforeChild-&gt;parent());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -762,7 +762,7 @@
</span><span class="cx">         if (!elementChild.isAnonymous() || elementChild.style().styleType() != NOPSEUDO)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (propagationType == PropagateToBlockChildrenOnly &amp;&amp; !elementChild.isRenderBlock())
</del><ins>+        if (propagationType == PropagateToBlockChildrenOnly &amp;&amp; !is&lt;RenderBlock&gt;(elementChild))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FULLSCREEN_API)
</span><span class="lines">@@ -771,7 +771,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         // RenderFlowThreads are updated through the RenderView::styleDidChange function.
</span><del>-        if (elementChild.isRenderFlowThread())
</del><ins>+        if (is&lt;RenderFlowThread&gt;(elementChild))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&amp;style(), elementChild.style().display());
</span><span class="lines">@@ -784,7 +784,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Preserve the position style of anonymous block continuations as they can have relative or sticky position when
</span><span class="cx">         // they contain block descendants of relative or sticky positioned inlines.
</span><del>-        if (elementChild.isInFlowPositioned() &amp;&amp; toRenderBlock(elementChild).isAnonymousBlockContinuation())
</del><ins>+        if (elementChild.isInFlowPositioned() &amp;&amp; downcast&lt;RenderBlock&gt;(elementChild).isAnonymousBlockContinuation())
</ins><span class="cx">             newStyle.get().setPosition(elementChild.style().position());
</span><span class="cx"> 
</span><span class="cx">         elementChild.setStyle(WTF::move(newStyle));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFlowThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -473,16 +473,16 @@
</span><span class="cx">             
</span><span class="cx">             // Get the logical top coordinate of the current object.
</span><span class="cx">             LayoutUnit top = 0;
</span><del>-            if (boxModelObject.isRenderBlock())
-                top = toRenderBlock(boxModelObject).offsetFromLogicalTopOfFirstPage();
</del><ins>+            if (is&lt;RenderBlock&gt;(boxModelObject))
+                top = downcast&lt;RenderBlock&gt;(boxModelObject).offsetFromLogicalTopOfFirstPage();
</ins><span class="cx">             else {
</span><span class="cx">                 if (boxModelObject.containingBlock())
</span><span class="cx">                     top = boxModelObject.containingBlock()-&gt;offsetFromLogicalTopOfFirstPage();
</span><span class="cx">                 
</span><del>-                if (boxModelObject.isBox())
-                    top += toRenderBox(boxModelObject).topLeftLocation().y();
-                else if (boxModelObject.isRenderInline())
-                    top -= toRenderInline(boxModelObject).borderTop();
</del><ins>+                if (is&lt;RenderBox&gt;(boxModelObject))
+                    top += downcast&lt;RenderBox&gt;(boxModelObject).topLeftLocation().y();
+                else if (is&lt;RenderInline&gt;(boxModelObject))
+                    top -= downcast&lt;RenderInline&gt;(boxModelObject).borderTop();
</ins><span class="cx">             }
</span><span class="cx">             
</span><span class="cx">             // Get the logical top of the region this object starts in
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFullScreencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFullScreen.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFullScreen.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderFullScreen.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -149,14 +149,14 @@
</span><span class="cx">         if (child != lastChild())
</span><span class="cx">             requiresRenderTreeRebuild = true;
</span><span class="cx">         else if (child &amp;&amp; child-&gt;isAnonymousBlock()) {
</span><del>-            auto&amp; anonymousBlock = toRenderBlock(*child);
</del><ins>+            auto&amp; anonymousBlock = downcast&lt;RenderBlock&gt;(*child);
</ins><span class="cx">             if (anonymousBlock.firstChild() != anonymousBlock.lastChild())
</span><span class="cx">                 requiresRenderTreeRebuild = true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         while ((child = firstChild())) {
</span><span class="cx">             if (child-&gt;isAnonymousBlock() &amp;&amp; !requiresRenderTreeRebuild) {
</span><del>-                if (auto* nonAnonymousChild = toRenderBlock(*child).firstChild())
</del><ins>+                if (auto* nonAnonymousChild = downcast&lt;RenderBlock&gt;(*child).firstChild())
</ins><span class="cx">                     child = nonAnonymousChild;
</span><span class="cx">                 else {
</span><span class="cx">                     child-&gt;removeFromParent();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -121,10 +121,10 @@
</span><span class="cx">     if (!continuation)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (continuation-&gt;isRenderInline())
-        return toRenderInline(continuation);
</del><ins>+    if (is&lt;RenderInline&gt;(*continuation))
+        return downcast&lt;RenderInline&gt;(continuation);
</ins><span class="cx"> 
</span><del>-    return continuation-&gt;isRenderBlock() ? toRenderBlock(continuation)-&gt;inlineElementContinuation() : nullptr;
</del><ins>+    return is&lt;RenderBlock&gt;(*continuation) ? downcast&lt;RenderBlock&gt;(*continuation).inlineElementContinuation() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderInline::updateFromStyle()
</span><span class="lines">@@ -152,21 +152,21 @@
</span><span class="cx">         if (box-&gt;style().position() == newStyle-&gt;position())
</span><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        if (!box-&gt;isRenderBlock())
</del><ins>+        if (!is&lt;RenderBlock&gt;(*box))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        RenderBlock* block = toRenderBlock(box);
-        if (!block-&gt;isAnonymousBlockContinuation())
</del><ins>+        RenderBlock&amp; block = downcast&lt;RenderBlock&gt;(*box);
+        if (!block.isAnonymousBlockContinuation())
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><span class="cx">         // If we are no longer in-flow positioned but our descendant block(s) still have an in-flow positioned ancestor then
</span><span class="cx">         // their containing anonymous block should keep its in-flow positioning. 
</span><del>-        RenderInline* cont = block-&gt;inlineElementContinuation();
-        if (oldStyle-&gt;hasInFlowPosition() &amp;&amp; inFlowPositionedInlineAncestor(cont))
</del><ins>+        RenderInline* continuation = block.inlineElementContinuation();
+        if (oldStyle-&gt;hasInFlowPosition() &amp;&amp; inFlowPositionedInlineAncestor(continuation))
</ins><span class="cx">             continue;
</span><del>-        auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(&amp;block-&gt;style(), BLOCK);
</del><ins>+        auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(&amp;block.style(), BLOCK);
</ins><span class="cx">         blockStyle.get().setPosition(newStyle-&gt;position());
</span><del>-        block-&gt;setStyle(WTF::move(blockStyle));
</del><ins>+        block.setStyle(WTF::move(blockStyle));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx">         // If any descendant blocks exist then they will be in the next anonymous block and its siblings.
</span><span class="cx">         RenderObject* block = containingBlock()-&gt;nextSibling();
</span><span class="cx">         ASSERT(block &amp;&amp; block-&gt;isAnonymousBlock());
</span><del>-        updateStyleOfAnonymousBlockContinuations(toRenderBlock(block), &amp;newStyle, oldStyle);
</del><ins>+        updateStyleOfAnonymousBlockContinuations(downcast&lt;RenderBlock&gt;(block), &amp;newStyle, oldStyle);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!alwaysCreateLineBoxes()) {
</span><span class="lines">@@ -277,9 +277,9 @@
</span><span class="cx"> 
</span><span class="cx"> static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
</span><span class="cx"> {
</span><del>-    if (renderer-&gt;isInline() &amp;&amp; !renderer-&gt;isReplaced())
-        return toRenderInline(renderer)-&gt;continuation();
-    return toRenderBlock(renderer)-&gt;inlineElementContinuation();
</del><ins>+    if (is&lt;RenderInline&gt;(*renderer) &amp;&amp; !renderer-&gt;isReplaced())
+        return downcast&lt;RenderInline&gt;(*renderer).continuation();
+    return downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderBoxModelObject* RenderInline::continuationBefore(RenderObject* beforeChild)
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx"> void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
</span><span class="cx">                              RenderObject* newChild, RenderBoxModelObject* oldCont)
</span><span class="cx"> {
</span><del>-    RenderBlock* pre = 0;
</del><ins>+    RenderBlock* pre = nullptr;
</ins><span class="cx">     RenderBlock* block = containingBlock();
</span><span class="cx">     
</span><span class="cx">     // Delete our line boxes before we do the inline split into continuations.
</span><span class="lines">@@ -453,12 +453,12 @@
</span><span class="cx">     if (block-&gt;isAnonymousBlock() &amp;&amp; (!block-&gt;parent() || !block-&gt;parent()-&gt;createsAnonymousWrapper())) {
</span><span class="cx">         // We can reuse this block and make it the preBlock of the next continuation.
</span><span class="cx">         pre = block;
</span><del>-        pre-&gt;removePositionedObjects(0);
</del><ins>+        pre-&gt;removePositionedObjects(nullptr);
</ins><span class="cx">         // FIXME-BLOCKFLOW: The enclosing method should likely be switched over
</span><span class="cx">         // to only work on RenderBlockFlow, in which case this conversion can be
</span><span class="cx">         // removed.
</span><del>-        if (pre-&gt;isRenderBlockFlow())
-            toRenderBlockFlow(pre)-&gt;removeFloatingObjects();
</del><ins>+        if (is&lt;RenderBlockFlow&gt;(*pre))
+            downcast&lt;RenderBlockFlow&gt;(*pre).removeFloatingObjects();
</ins><span class="cx">         block = block-&gt;containingBlock();
</span><span class="cx">     } else {
</span><span class="cx">         // No anonymous block available for use.  Make one.
</span><span class="lines">@@ -466,13 +466,13 @@
</span><span class="cx">         madeNewBeforeBlock = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderBlock* post = toRenderBlock(pre-&gt;createAnonymousBoxWithSameTypeAs(block));
</del><ins>+    RenderBlock&amp; post = downcast&lt;RenderBlock&gt;(*pre-&gt;createAnonymousBoxWithSameTypeAs(block));
</ins><span class="cx"> 
</span><span class="cx">     RenderObject* boxFirst = madeNewBeforeBlock ? block-&gt;firstChild() : pre-&gt;nextSibling();
</span><span class="cx">     if (madeNewBeforeBlock)
</span><span class="cx">         block-&gt;insertChildInternal(pre, boxFirst, NotifyChildren);
</span><span class="cx">     block-&gt;insertChildInternal(newBlockBox, boxFirst, NotifyChildren);
</span><del>-    block-&gt;insertChildInternal(post, boxFirst, NotifyChildren);
</del><ins>+    block-&gt;insertChildInternal(&amp;post, boxFirst, NotifyChildren);
</ins><span class="cx">     block-&gt;setChildrenInline(false);
</span><span class="cx">     
</span><span class="cx">     if (madeNewBeforeBlock) {
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    splitInlines(pre, post, newBlockBox, beforeChild, oldCont);
</del><ins>+    splitInlines(pre, &amp;post, newBlockBox, beforeChild, oldCont);
</ins><span class="cx"> 
</span><span class="cx">     // We already know the newBlockBox isn't going to contain inline kids, so avoid wasting
</span><span class="cx">     // time in makeChildrenNonInline by just setting this explicitly up front.
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx">     // make new line boxes instead of leaving the old line boxes around.
</span><span class="cx">     pre-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx">     block-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</span><del>-    post-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</del><ins>+    post.setNeedsLayoutAndPrefWidthsRecalc();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderInline::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild)
</span><span class="lines">@@ -853,21 +853,21 @@
</span><span class="cx"> VisiblePosition RenderInline::positionForPoint(const LayoutPoint&amp; point, const RenderRegion* region)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Does not deal with relative or sticky positioned inlines (should it?)
</span><del>-    RenderBlock* cb = containingBlock();
</del><ins>+    RenderBlock&amp; containingBlock = *this-&gt;containingBlock();
</ins><span class="cx">     if (firstLineBox()) {
</span><span class="cx">         // This inline actually has a line box.  We must have clicked in the border/padding of one of these boxes.  We
</span><span class="cx">         // should try to find a result by asking our containing block.
</span><del>-        return cb-&gt;positionForPoint(point, region);
</del><ins>+        return containingBlock.positionForPoint(point, region);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Translate the coords from the pre-anonymous block to the post-anonymous block.
</span><del>-    LayoutPoint parentBlockPoint = cb-&gt;location() + point;  
-    RenderBoxModelObject* c = continuation();
-    while (c) {
-        RenderBox* contBlock = c-&gt;isInline() ? c-&gt;containingBlock() : toRenderBlock(c);
-        if (c-&gt;isInline() || c-&gt;firstChild())
-            return c-&gt;positionForPoint(parentBlockPoint - contBlock-&gt;locationOffset(), region);
-        c = toRenderBlock(c)-&gt;inlineElementContinuation();
</del><ins>+    LayoutPoint parentBlockPoint = containingBlock.location() + point;
+    RenderBoxModelObject* continuation = this-&gt;continuation();
+    while (continuation) {
+        RenderBlock* currentBlock = continuation-&gt;isInline() ? continuation-&gt;containingBlock() : downcast&lt;RenderBlock&gt;(continuation);
+        if (continuation-&gt;isInline() || continuation-&gt;firstChild())
+            return continuation-&gt;positionForPoint(parentBlockPoint - currentBlock-&gt;locationOffset(), region);
+        continuation = downcast&lt;RenderBlock&gt;(*continuation).inlineElementContinuation();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return RenderBoxModelObject::positionForPoint(point, region);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -3298,8 +3298,8 @@
</span><span class="cx">                 // Our proprietary overflow: overlay value doesn't trigger a layout.
</span><span class="cx">                 m_inOverflowRelayout = true;
</span><span class="cx">                 renderer().setNeedsLayout(MarkOnlyThis);
</span><del>-                if (renderer().isRenderBlock()) {
-                    RenderBlock&amp; block = toRenderBlock(renderer());
</del><ins>+                if (is&lt;RenderBlock&gt;(renderer())) {
+                    RenderBlock&amp; block = downcast&lt;RenderBlock&gt;(renderer());
</ins><span class="cx">                     block.scrollbarsChanged(autoHorizontalScrollBarChanged, autoVerticalScrollBarChanged);
</span><span class="cx">                     block.layoutBlock(true);
</span><span class="cx">                 } else
</span><span class="lines">@@ -5417,7 +5417,7 @@
</span><span class="cx">             else
</span><span class="cx">                 layerBoundsWithVisualOverflow.moveBy(LayoutPoint(flowThread-&gt;width(), 0));
</span><span class="cx">         } else {
</span><del>-            RenderBlock* rendererContainingBlock = boxModelObject.enclosingBox().isRenderBlock() ? toRenderBlock(&amp;boxModelObject.enclosingBox()) : 0;
</del><ins>+            RenderBlock* rendererContainingBlock = is&lt;RenderBlock&gt;(boxModelObject.enclosingBox()) ? &amp;downcast&lt;RenderBlock&gt;(boxModelObject.enclosingBox()) : nullptr;
</ins><span class="cx">             if (rendererContainingBlock)
</span><span class="cx">                 rendererContainingBlock-&gt;flipForWritingMode(layerBoundsWithVisualOverflow);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -27,8 +27,10 @@
</span><span class="cx"> #include &quot;ElementTraversal.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLOListElement.h&quot;
</span><ins>+#include &quot;HTMLUListElement.h&quot;
</ins><span class="cx"> #include &quot;InlineElementBox.h&quot;
</span><span class="cx"> #include &quot;PseudoElement.h&quot;
</span><ins>+#include &quot;RenderInline.h&quot;
</ins><span class="cx"> #include &quot;RenderListMarker.h&quot;
</span><span class="cx"> #include &quot;RenderMultiColumnFlowThread.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="lines">@@ -227,25 +229,24 @@
</span><span class="cx">         if (currChild == marker)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (currChild-&gt;isInline() &amp;&amp; (!currChild-&gt;isRenderInline() || curr-&gt;generatesLineBoxesForInlineChild(currChild)))
</del><ins>+        if (currChild-&gt;isInline() &amp;&amp; (!is&lt;RenderInline&gt;(*currChild) || curr-&gt;generatesLineBoxesForInlineChild(currChild)))
</ins><span class="cx">             return curr;
</span><span class="cx"> 
</span><span class="cx">         if (currChild-&gt;isFloating() || currChild-&gt;isOutOfFlowPositioned())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (currChild-&gt;isTable() || !currChild-&gt;isRenderBlock() || (currChild-&gt;isBox() &amp;&amp; toRenderBox(currChild)-&gt;isWritingModeRoot()))
</del><ins>+        if (currChild-&gt;isTable() || !is&lt;RenderBlock&gt;(*currChild) || (is&lt;RenderBox&gt;(*currChild) &amp;&amp; downcast&lt;RenderBox&gt;(*currChild).isWritingModeRoot()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         if (curr-&gt;isListItem() &amp;&amp; inQuirksMode &amp;&amp; currChild-&gt;node() &amp;&amp;
</span><del>-            (currChild-&gt;node()-&gt;hasTagName(ulTag)|| currChild-&gt;node()-&gt;hasTagName(olTag)))
</del><ins>+            (is&lt;HTMLUListElement&gt;(*currChild-&gt;node()) || is&lt;HTMLOListElement&gt;(*currChild-&gt;node())))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><del>-        RenderBlock* lineBox = getParentOfFirstLineBox(toRenderBlock(currChild), marker);
-        if (lineBox)
</del><ins>+        if (RenderBlock* lineBox = getParentOfFirstLineBox(downcast&lt;RenderBlock&gt;(currChild), marker))
</ins><span class="cx">             return lineBox;
</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"> void RenderListItem::updateValue()
</span><span class="lines">@@ -294,7 +295,7 @@
</span><span class="cx">         newParent-&gt;addChild(m_marker.get(), firstNonMarkerChild(newParent));
</span><span class="cx">         m_marker-&gt;updateMarginsAndContent();
</span><span class="cx">         // If current parent is an anonymous block that has lost all its children, destroy it.
</span><del>-        if (currentParent &amp;&amp; currentParent-&gt;isAnonymousBlock() &amp;&amp; !currentParent-&gt;firstChild() &amp;&amp; !toRenderBlock(currentParent)-&gt;continuation())
</del><ins>+        if (currentParent &amp;&amp; currentParent-&gt;isAnonymousBlock() &amp;&amp; !currentParent-&gt;firstChild() &amp;&amp; !downcast&lt;RenderBlock&gt;(*currentParent).continuation())
</ins><span class="cx">             currentParent-&gt;destroy();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -406,11 +407,11 @@
</span><span class="cx">                 o = o-&gt;parentBox();
</span><span class="cx">                 if (o-&gt;hasOverflowClip())
</span><span class="cx">                     propagateVisualOverflow = false;
</span><del>-                if (o-&gt;isRenderBlock()) {
</del><ins>+                if (is&lt;RenderBlock&gt;(*o)) {
</ins><span class="cx">                     if (propagateVisualOverflow)
</span><del>-                        toRenderBlock(o)-&gt;addVisualOverflow(markerRect);
</del><ins>+                        downcast&lt;RenderBlock&gt;(*o).addVisualOverflow(markerRect);
</ins><span class="cx">                     if (propagateLayoutOverflow)
</span><del>-                        toRenderBlock(o)-&gt;addLayoutOverflow(markerRect);
</del><ins>+                        downcast&lt;RenderBlock&gt;(*o).addLayoutOverflow(markerRect);
</ins><span class="cx">                 }
</span><span class="cx">                 if (o-&gt;hasOverflowClip())
</span><span class="cx">                     propagateLayoutOverflow = false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowFragmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">     ASSERT(parent());
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle&amp; styleToUse = parent()-&gt;style();
</span><del>-    return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : toRenderBlock(parent())-&gt;computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
</del><ins>+    return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast&lt;RenderBlock&gt;(*parent()).computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutRect RenderNamedFlowFragment::flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -399,15 +399,15 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RenderObject::BlockContentHeightType includeNonFixedHeight(const RenderObject* render)
</del><ins>+static RenderObject::BlockContentHeightType includeNonFixedHeight(const RenderObject* renderer)
</ins><span class="cx"> {
</span><del>-    const RenderStyle&amp; style = render-&gt;style();
</del><ins>+    const RenderStyle&amp; style = renderer-&gt;style();
</ins><span class="cx">     if (style.height().type() == Fixed) {
</span><del>-        if (render-&gt;isRenderBlock()) {
-            const RenderBlock* block = toRenderBlock(render);
</del><ins>+        if (is&lt;RenderBlock&gt;(*renderer)) {
</ins><span class="cx">             // For fixed height styles, if the overflow size of the element spills out of the specified
</span><span class="cx">             // height, assume we can apply text auto-sizing.
</span><del>-            if (style.overflowY() == OVISIBLE &amp;&amp; style.height().value() &lt; block-&gt;layoutOverflowRect().maxY())
</del><ins>+            if (style.overflowY() == OVISIBLE
+                &amp;&amp; style.height().value() &lt; downcast&lt;RenderBlock&gt;(renderer).layoutOverflowRect().maxY())
</ins><span class="cx">                 return RenderObject::OverflowHeight;
</span><span class="cx">         }
</span><span class="cx">         return RenderObject::FixedHeight;
</span><span class="lines">@@ -672,8 +672,8 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!needsLayout());
</span><span class="cx"> 
</span><del>-    if (isRenderBlock())
-        toRenderBlock(this)-&gt;checkPositionedObjectsNeedLayout();
</del><ins>+    if (is&lt;RenderBlock&gt;(*this))
+        downcast&lt;RenderBlock&gt;(*this).checkPositionedObjectsNeedLayout();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -720,22 +720,22 @@
</span><span class="cx"> 
</span><span class="cx"> RenderBlock* RenderObject::containingBlock() const
</span><span class="cx"> {
</span><del>-    auto o = parent();
-    if (!o &amp;&amp; isRenderScrollbarPart())
-        o = toRenderScrollbarPart(this)-&gt;rendererOwningScrollbar();
</del><ins>+    auto parent = this-&gt;parent();
+    if (!parent &amp;&amp; is&lt;RenderScrollbarPart&gt;(*this))
+        parent = downcast&lt;RenderScrollbarPart&gt;(*this).rendererOwningScrollbar();
</ins><span class="cx"> 
</span><span class="cx">     const RenderStyle&amp; style = this-&gt;style();
</span><del>-    if (!isText() &amp;&amp; style.position() == FixedPosition)
-        o = containingBlockForFixedPosition(o);
-    else if (!isText() &amp;&amp; style.position() == AbsolutePosition)
-        o = containingBlockForAbsolutePosition(o);
</del><ins>+    if (!is&lt;RenderText&gt;(*this) &amp;&amp; style.position() == FixedPosition)
+        parent = containingBlockForFixedPosition(parent);
+    else if (!is&lt;RenderText&gt;(*this) &amp;&amp; style.position() == AbsolutePosition)
+        parent = containingBlockForAbsolutePosition(parent);
</ins><span class="cx">     else
</span><del>-        o = containingBlockForObjectInFlow(o);
</del><ins>+        parent = containingBlockForObjectInFlow(parent);
</ins><span class="cx"> 
</span><del>-    if (!o || !o-&gt;isRenderBlock())
-        return 0; // This can still happen in case of an orphaned tree
</del><ins>+    if (!is&lt;RenderBlock&gt;(parent))
+        return nullptr; // This can still happen in case of an orphaned tree
</ins><span class="cx"> 
</span><del>-    return toRenderBlock(o);
</del><ins>+    return downcast&lt;RenderBlock&gt;(parent);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, float x1, float y1, float x2, float y2,
</span><span class="lines">@@ -1679,10 +1679,10 @@
</span><span class="cx">     setInline(style().isDisplayInlineType());
</span><span class="cx">     if (isInline() != parent()-&gt;childrenInline()) {
</span><span class="cx">         if (!isInline())
</span><del>-            toRenderBoxModelObject(parent())-&gt;childBecameNonInline(this);
</del><ins>+            downcast&lt;RenderBoxModelObject&gt;(*parent()).childBecameNonInline(this);
</ins><span class="cx">         else {
</span><span class="cx">             // An anonymous block must be made to wrap this inline.
</span><del>-            RenderBlock* block = toRenderBlock(parent())-&gt;createAnonymousBlock();
</del><ins>+            RenderBlock* block = downcast&lt;RenderBlock&gt;(*parent()).createAnonymousBlock();
</ins><span class="cx">             parent()-&gt;insertChildInternal(block, this, RenderElement::NotifyChildren);
</span><span class="cx">             parent()-&gt;removeChildInternal(*this, RenderElement::NotifyChildren);
</span><span class="cx">             block-&gt;insertChildInternal(this, nullptr, RenderElement::NotifyChildren);
</span><span class="lines">@@ -1692,8 +1692,8 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderObject::removeAnonymousWrappersForInlinesIfNecessary()
</span><span class="cx"> {
</span><del>-    RenderBlock* parentBlock = toRenderBlock(parent());
-    if (!parentBlock-&gt;canCollapseAnonymousBlockChild())
</del><ins>+    RenderBlock&amp; parentBlock = downcast&lt;RenderBlock&gt;(*parent());
+    if (!parentBlock.canCollapseAnonymousBlockChild())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // We have changed to floated or out-of-flow positioning so maybe all our parent's
</span><span class="lines">@@ -1701,19 +1701,18 @@
</span><span class="cx">     // otherwise we can proceed to stripping solitary anonymous wrappers from the inlines.
</span><span class="cx">     // FIXME: We should also handle split inlines here - we exclude them at the moment by returning
</span><span class="cx">     // if we find a continuation.
</span><del>-    RenderObject* curr = parent()-&gt;firstChild();
-    while (curr &amp;&amp; ((curr-&gt;isAnonymousBlock() &amp;&amp; !toRenderBlock(curr)-&gt;isAnonymousBlockContinuation()) || curr-&gt;style().isFloating() || curr-&gt;style().hasOutOfFlowPosition()))
-        curr = curr-&gt;nextSibling();
</del><ins>+    RenderObject* current = parent()-&gt;firstChild();
+    while (current &amp;&amp; ((current-&gt;isAnonymousBlock() &amp;&amp; !downcast&lt;RenderBlock&gt;(*current).isAnonymousBlockContinuation()) || current-&gt;style().isFloating() || current-&gt;style().hasOutOfFlowPosition()))
+        current = current-&gt;nextSibling();
</ins><span class="cx"> 
</span><del>-    if (curr)
</del><ins>+    if (current)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    curr = parent()-&gt;firstChild();
-    while (curr) {
-        RenderObject* next = curr-&gt;nextSibling();
-        if (curr-&gt;isAnonymousBlock())
-            parentBlock-&gt;collapseAnonymousBoxChild(parentBlock, toRenderBlock(curr));
-        curr = next;
</del><ins>+    RenderObject* next;
+    for (current = parent()-&gt;firstChild(); current; current = next) {
+        next = current-&gt;nextSibling();
+        if (current-&gt;isAnonymousBlock())
+            parentBlock.collapseAnonymousBoxChild(parentBlock, downcast&lt;RenderBlock&gt;(current));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2270,12 +2269,12 @@
</span><span class="cx"> void RenderObject::getTextDecorationColors(int decorations, Color&amp; underline, Color&amp; overline,
</span><span class="cx">                                            Color&amp; linethrough, bool quirksMode, bool firstlineStyle)
</span><span class="cx"> {
</span><del>-    RenderObject* curr = this;
-    RenderStyle* styleToUse = 0;
</del><ins>+    RenderObject* current = this;
+    RenderStyle* styleToUse = nullptr;
</ins><span class="cx">     TextDecoration currDecs = TextDecorationNone;
</span><span class="cx">     Color resultColor;
</span><span class="cx">     do {
</span><del>-        styleToUse = firstlineStyle ? &amp;curr-&gt;firstLineStyle() : &amp;curr-&gt;style();
</del><ins>+        styleToUse = firstlineStyle ? &amp;current-&gt;firstLineStyle() : &amp;current-&gt;style();
</ins><span class="cx">         currDecs = styleToUse-&gt;textDecoration();
</span><span class="cx">         resultColor = decorationColor(styleToUse);
</span><span class="cx">         // Parameter 'decorations' is cast as an int to enable the bitwise operations below.
</span><span class="lines">@@ -2293,16 +2292,16 @@
</span><span class="cx">                 linethrough = resultColor;
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        if (curr-&gt;isRubyText())
</del><ins>+        if (current-&gt;isRubyText())
</ins><span class="cx">             return;
</span><del>-        curr = curr-&gt;parent();
-        if (curr &amp;&amp; curr-&gt;isAnonymousBlock() &amp;&amp; toRenderBlock(curr)-&gt;continuation())
-            curr = toRenderBlock(curr)-&gt;continuation();
-    } while (curr &amp;&amp; decorations &amp;&amp; (!quirksMode || !curr-&gt;node() || (!is&lt;HTMLAnchorElement&gt;(*curr-&gt;node()) &amp;&amp; !curr-&gt;node()-&gt;hasTagName(fontTag))));
</del><ins>+        current = current-&gt;parent();
+        if (current &amp;&amp; current-&gt;isAnonymousBlock() &amp;&amp; downcast&lt;RenderBlock&gt;(*current).continuation())
+            current = downcast&lt;RenderBlock&gt;(*current).continuation();
+    } while (current &amp;&amp; decorations &amp;&amp; (!quirksMode || !current-&gt;node() || (!is&lt;HTMLAnchorElement&gt;(*current-&gt;node()) &amp;&amp; !current-&gt;node()-&gt;hasTagName(fontTag))));
</ins><span class="cx"> 
</span><span class="cx">     // If we bailed out, use the element we bailed out at (typically a &lt;font&gt; or &lt;a&gt; element).
</span><del>-    if (decorations &amp;&amp; curr) {
-        styleToUse = firstlineStyle ? &amp;curr-&gt;firstLineStyle() : &amp;curr-&gt;style();
</del><ins>+    if (decorations &amp;&amp; current) {
+        styleToUse = firstlineStyle ? &amp;current-&gt;firstLineStyle() : &amp;current-&gt;style();
</ins><span class="cx">         resultColor = decorationColor(styleToUse);
</span><span class="cx">         if (decorations &amp; TextDecorationUnderline)
</span><span class="cx">             underline = resultColor;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRuby.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRuby.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderRuby.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -75,13 +75,13 @@
</span><span class="cx"> static inline RenderBlock* rubyBeforeBlock(const RenderElement* ruby)
</span><span class="cx"> {
</span><span class="cx">     RenderObject* child = ruby-&gt;firstChild();
</span><del>-    return isRubyBeforeBlock(child) ? toRenderBlock(child) : 0;
</del><ins>+    return isRubyBeforeBlock(child) ? downcast&lt;RenderBlock&gt;(child) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline RenderBlock* rubyAfterBlock(const RenderElement* ruby)
</span><span class="cx"> {
</span><span class="cx">     RenderObject* child = ruby-&gt;lastChild();
</span><del>-    return isRubyAfterBlock(child) ? toRenderBlock(child) : 0;
</del><ins>+    return isRubyAfterBlock(child) ? downcast&lt;RenderBlock&gt;(child) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RenderBlock* createAnonymousRubyInlineBlock(RenderObject&amp; ruby)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderRubyBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderRubyBase.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderRubyBase.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderRubyBase.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">         // If toBase has a suitable block, we re-use it, otherwise create a new one.
</span><span class="cx">         RenderObject* lastChild = toBase-&gt;lastChild();
</span><span class="cx">         if (lastChild &amp;&amp; lastChild-&gt;isAnonymousBlock() &amp;&amp; lastChild-&gt;childrenInline())
</span><del>-            toBlock = toRenderBlock(lastChild);
</del><ins>+            toBlock = downcast&lt;RenderBlock&gt;(lastChild);
</ins><span class="cx">         else {
</span><span class="cx">             toBlock = toBase-&gt;createAnonymousBlock();
</span><span class="cx">             toBase-&gt;insertChildInternal(toBlock, nullptr, NotifyChildren);
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx">     RenderObject* lastChildThere = toBase-&gt;lastChild();
</span><span class="cx">     if (firstChildHere-&gt;isAnonymousBlock() &amp;&amp; firstChildHere-&gt;childrenInline() 
</span><span class="cx">             &amp;&amp; lastChildThere &amp;&amp; lastChildThere-&gt;isAnonymousBlock() &amp;&amp; lastChildThere-&gt;childrenInline()) {            
</span><del>-        RenderBlock* anonBlockHere = toRenderBlock(firstChildHere);
-        RenderBlock* anonBlockThere = toRenderBlock(lastChildThere);
</del><ins>+        RenderBlock* anonBlockHere = downcast&lt;RenderBlock&gt;(firstChildHere);
+        RenderBlock* anonBlockThere = downcast&lt;RenderBlock&gt;(lastChildThere);
</ins><span class="cx">         anonBlockHere-&gt;moveAllChildrenTo(anonBlockThere, true);
</span><span class="cx">         anonBlockHere-&gt;deleteLines();
</span><span class="cx">         anonBlockHere-&gt;destroy();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1821,15 +1821,15 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject&amp; o, const PaintInfo&amp; paintInfo, const IntRect&amp;)
</del><ins>+bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject&amp; renderer, const PaintInfo&amp; paintInfo, const IntRect&amp;)
</ins><span class="cx"> {
</span><span class="cx">     if (paintInfo.phase != PaintPhaseBlockBackground)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (!o.isRenderBlock())
</del><ins>+    if (!is&lt;RenderBlock&gt;(renderer))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    const RenderBlock&amp; renderBlock = *toRenderBlock(&amp;o);
</del><ins>+    const RenderBlock&amp; renderBlock = downcast&lt;RenderBlock&gt;(renderer);
</ins><span class="cx"> 
</span><span class="cx">     LayoutUnit contentWidth = renderBlock.contentWidth();
</span><span class="cx">     LayoutUnit contentHeight = renderBlock.contentHeight();
</span><span class="lines">@@ -1878,13 +1878,11 @@
</span><span class="cx"> 
</span><span class="cx">     // We could draw the snapshot with that coordinates, but we need to make sure there
</span><span class="cx">     // isn't a composited layer between us and the plugInRenderer.
</span><del>-    const RenderBox* renderBox = toRenderBox(&amp;o);
-    while (renderBox != plugInRenderer) {
</del><ins>+    for (auto* renderBox = &amp;downcast&lt;RenderBox&gt;(renderer); renderBox != plugInRenderer; renderBox = renderBox-&gt;parentBox()) {
</ins><span class="cx">         if (renderBox-&gt;hasLayer() &amp;&amp; renderBox-&gt;layer() &amp;&amp; renderBox-&gt;layer()-&gt;isComposited()) {
</span><span class="cx">             snapshotAbsPos = -renderBox-&gt;location();
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        renderBox = renderBox-&gt;parentBox();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     LayoutSize pluginSize(plugInRenderer-&gt;contentWidth(), plugInRenderer-&gt;contentHeight());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutosizercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutosizer.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/TextAutosizer.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // The layoutRoot could be neither a container nor a cluster, so walk up the tree till we find each of these.
</span><del>-    RenderBlock* container = layoutRoot-&gt;isRenderBlock() ? toRenderBlock(layoutRoot) : layoutRoot-&gt;containingBlock();
</del><ins>+    RenderBlock* container = is&lt;RenderBlock&gt;(*layoutRoot) ? downcast&lt;RenderBlock&gt;(layoutRoot) : layoutRoot-&gt;containingBlock();
</ins><span class="cx">     while (container &amp;&amp; !isAutosizingContainer(container))
</span><span class="cx">         container = container-&gt;containingBlock();
</span><span class="cx"> 
</span><span class="lines">@@ -204,14 +204,14 @@
</span><span class="cx"> 
</span><span class="cx">     RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(subtreeRoot, subtreeRoot);
</span><span class="cx">     while (descendant) {
</span><del>-        if (descendant-&gt;isText()) {
</del><ins>+        if (is&lt;RenderText&gt;(*descendant)) {
</ins><span class="cx">             if (localMultiplier != 1 &amp;&amp; descendant-&gt;style()-&gt;textAutosizingMultiplier() == 1) {
</span><span class="cx">                 setMultiplier(descendant, localMultiplier);
</span><span class="cx">                 setMultiplier(descendant-&gt;parent(), localMultiplier); // Parent does line spacing.
</span><span class="cx">             }
</span><span class="cx">             // FIXME: Increase list marker size proportionately.
</span><span class="cx">         } else if (isAutosizingContainer(descendant)) {
</span><del>-            RenderBlock* descendantBlock = toRenderBlock(descendant);
</del><ins>+            RenderBlock* descendantBlock = downcast&lt;RenderBlock&gt;(descendant);
</ins><span class="cx">             TextAutosizingClusterInfo descendantClusterInfo(descendantBlock);
</span><span class="cx">             if (isWiderDescendant(descendantBlock, clusterInfo) || isIndependentDescendant(descendantBlock))
</span><span class="cx">                 processCluster(descendantClusterInfo, descendantBlock, descendantBlock, windowInfo);
</span><span class="lines">@@ -496,7 +496,7 @@
</span><span class="cx">         if (!skipLocalText &amp;&amp; is&lt;RenderText&gt;(*descendant))
</span><span class="cx">             textWidth += downcast&lt;RenderText&gt;(*descendant).renderedTextLength() * descendant-&gt;style()-&gt;specifiedFontSize();
</span><span class="cx">         else if (isAutosizingContainer(descendant)) {
</span><del>-            RenderBlock* descendantBlock = toRenderBlock(descendant);
</del><ins>+            RenderBlock* descendantBlock = downcast&lt;RenderBlock&gt;(descendant);
</ins><span class="cx">             if (!isAutosizingCluster(descendantBlock, clusterInfo))
</span><span class="cx">                 measureDescendantTextWidth(descendantBlock, clusterInfo, minTextWidth, textWidth);
</span><span class="cx">         }
</span><span class="lines">@@ -542,8 +542,8 @@
</span><span class="cx">         lastNode = lastNode-&gt;parent();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (firstNode-&gt;isRenderBlock())
-        return toRenderBlock(firstNode);
</del><ins>+    if (is&lt;RenderBlock&gt;(*firstNode))
+        return downcast&lt;RenderBlock&gt;(firstNode);
</ins><span class="cx"> 
</span><span class="cx">     // containingBlock() should never leave the cluster, since it only skips ancestors when finding the
</span><span class="cx">     // container of position:absolute/fixed blocks, and those cannot exist between a cluster and its text
</span><span class="lines">@@ -558,21 +558,20 @@
</span><span class="cx"> const RenderObject* TextAutosizer::findFirstTextLeafNotInCluster(const RenderObject* parent, size_t&amp; depth, TraversalDirection direction)
</span><span class="cx"> {
</span><span class="cx">     if (parent-&gt;isEmpty())
</span><del>-        return parent-&gt;isText() ? parent : 0;
</del><ins>+        return is&lt;RenderText&gt;(*parent) ? parent : nullptr;
</ins><span class="cx"> 
</span><span class="cx">     ++depth;
</span><span class="cx">     const RenderObject* child = (direction == FirstToLast) ? parent-&gt;firstChild() : parent-&gt;lastChild();
</span><span class="cx">     while (child) {
</span><del>-        if (!isAutosizingContainer(child) || !isIndependentDescendant(toRenderBlock(child))) {
-            const RenderObject* leaf = findFirstTextLeafNotInCluster(child, depth, direction);
-            if (leaf)
</del><ins>+        if (!isAutosizingContainer(child) || !isIndependentDescendant(downcast&lt;RenderBlock&gt;(child))) {
+            if (const RenderObject* leaf = findFirstTextLeafNotInCluster(child, depth, direction))
</ins><span class="cx">                 return leaf;
</span><span class="cx">         }
</span><span class="cx">         child = (direction == FirstToLast) ? child-&gt;nextSibling() : child-&gt;previousSibling();
</span><span class="cx">     }
</span><span class="cx">     --depth;
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -300,7 +300,7 @@
</span><span class="cx">             auto index = indexWrapper();
</span><span class="cx">             float indexHeight = 0;
</span><span class="cx">             if (!index-&gt;isEmpty())
</span><del>-                indexHeight = toRenderBlock(index-&gt;firstChild())-&gt;logicalHeight();
</del><ins>+                indexHeight = downcast&lt;RenderBlock&gt;(*index-&gt;firstChild()).logicalHeight();
</ins><span class="cx">             float indexTopMargin = (1.0 - m_degreeBottomRaisePercent) * radical-&gt;stretchSize() + radicalTopMargin - indexHeight;
</span><span class="cx">             if (indexTopMargin &lt; 0) {
</span><span class="cx">                 // If the index is too tall, we must add space at the top of renderer.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-10-08  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects
+        https://bugs.webkit.org/show_bug.cgi?id=137512
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for RenderBlock objects and clean up the 
+        surrounding code.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::rangeForWebSelectionAtPosition):
+        (WebKit::WebPage::contractedRangeFromHandle):
+
</ins><span class="cx"> 2014-10-08  Ada Chan  &lt;adachan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement WKPageIsPlayingAudio().
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (174479 => 174480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-10-08 22:11:41 UTC (rev 174479)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-10-08 23:33:43 UTC (rev 174480)
</span><span class="lines">@@ -774,7 +774,7 @@
</span><span class="cx">     if (!renderer || renderer-&gt;style().userSelect() == SELECT_NONE)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (renderer-&gt;childrenInline() &amp;&amp; (renderer-&gt;isRenderBlock() &amp;&amp; !toRenderBlock(renderer)-&gt;inlineElementContinuation()) &amp;&amp; !renderer-&gt;isTable()) {
</del><ins>+    if (renderer-&gt;childrenInline() &amp;&amp; (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; !downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation()) &amp;&amp; !renderer-&gt;isTable()) {
</ins><span class="cx">         range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionBackward);
</span><span class="cx">         if (range &amp;&amp; !range-&gt;collapsed(ASSERT_NO_EXCEPTION))
</span><span class="cx">             return range;
</span><span class="lines">@@ -1316,7 +1316,7 @@
</span><span class="cx">         node = node-&gt;parentElement();
</span><span class="cx"> 
</span><span class="cx">     RenderObject* renderer = node-&gt;renderer();
</span><del>-    if (renderer &amp;&amp; renderer-&gt;childrenInline() &amp;&amp; (renderer-&gt;isRenderBlock() &amp;&amp; !toRenderBlock(renderer)-&gt;inlineElementContinuation()) &amp;&amp; !renderer-&gt;isTable())
</del><ins>+    if (renderer &amp;&amp; renderer-&gt;childrenInline() &amp;&amp; (is&lt;RenderBlock&gt;(*renderer) &amp;&amp; !downcast&lt;RenderBlock&gt;(*renderer).inlineElementContinuation()) &amp;&amp; !renderer-&gt;isTable())
</ins><span class="cx">         flags = None;
</span><span class="cx"> 
</span><span class="cx">     return bestRange;
</span></span></pre>
</div>
</div>

</body>
</html>