<!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<>() / downcast<>() for RenderBlock objects
https://bugs.webkit.org/show_bug.cgi?id=137512
Reviewed by Darin Adler.
Source/WebCore:
Use is<>() / downcast<>() 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<>() / downcast<>() 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for RenderBlock objects
+ https://bugs.webkit.org/show_bug.cgi?id=137512
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() 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 <jer.noble@apple.com>
</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& renderer)
</ins><span class="cx"> {
</span><del>- RenderObject* firstChild = renderer->firstChildSlow();
</del><ins>+ RenderObject* firstChild = renderer.firstChildSlow();
</ins><span class="cx">
</span><del>- if (!firstChild && isInlineWithContinuation(renderer))
- firstChild = firstChildInContinuation(toRenderInline(*renderer));
</del><ins>+ if (!firstChild && isInlineWithContinuation(&renderer))
+ firstChild = firstChildInContinuation(downcast<RenderInline>(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& renderer)
</ins><span class="cx"> {
</span><del>- RenderObject* lastChild = renderer->lastChildSlow();
- RenderObject* prev;
- RenderObject* cur = renderer;
</del><ins>+ if (!is<RenderInline>(renderer) && !is<RenderBlock>(renderer))
+ return &renderer;
</ins><span class="cx">
</span><del>- if (!cur->isRenderInline() && !cur->isRenderBlock())
- return renderer;
</del><ins>+ RenderObject* lastChild = downcast<RenderBoxModelObject>(renderer).lastChild();
+ RenderBoxModelObject* previous;
+ for (auto* current = &downcast<RenderBoxModelObject>(renderer); current; ) {
+ previous = current;
</ins><span class="cx">
</span><del>- while (cur) {
- prev = cur;
</del><ins>+ if (RenderObject* newLastChild = current->lastChild())
+ lastChild = newLastChild;
</ins><span class="cx">
</span><del>- if (RenderObject* lc = cur->lastChildSlow())
- lastChild = lc;
-
- if (cur->isRenderInline()) {
- cur = toRenderInline(cur)->inlineElementContinuation();
- ASSERT_UNUSED(prev, cur || !toRenderInline(prev)->continuation());
</del><ins>+ if (is<RenderInline>(*current)) {
+ current = downcast<RenderInline>(*current).inlineElementContinuation();
+ ASSERT_UNUSED(previous, current || !downcast<RenderInline>(*previous).continuation());
</ins><span class="cx"> } else
</span><del>- cur = toRenderBlock(cur)->inlineElementContinuation();
</del><ins>+ current = downcast<RenderBlock>(*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 && !canHaveChildren())
</span><span class="cx"> return AccessibilityNodeObject::lastChild();
</span><span class="lines">@@ -252,67 +250,61 @@
</span><span class="cx"> return axObjectCache()->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& renderer)
</ins><span class="cx"> {
</span><del>- if (r->isInlineElementContinuation())
- return toRenderInline(r->node()->renderer());
</del><ins>+ if (renderer.isInlineElementContinuation())
+ return downcast<RenderInline>(renderer.node()->renderer());
</ins><span class="cx">
</span><span class="cx"> // Blocks with a previous continuation always have a next continuation
</span><del>- if (r->isRenderBlock() && toRenderBlock(r)->inlineElementContinuation())
- return toRenderInline(toRenderBlock(r)->inlineElementContinuation()->element()->renderer());
</del><ins>+ if (is<RenderBlock>(renderer) && downcast<RenderBlock>(renderer).inlineElementContinuation())
+ return downcast<RenderInline>(downcast<RenderBlock>(renderer).inlineElementContinuation()->element()->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& renderer)
</ins><span class="cx"> {
</span><del>- RenderObject* prev = renderer;
- RenderObject* cur = renderer;
</del><ins>+ if (!is<RenderInline>(renderer) && !is<RenderBlock>(renderer))
+ return &renderer;
</ins><span class="cx">
</span><del>- if (!cur->isRenderInline() && !cur->isRenderBlock())
- return renderer;
-
- while (cur) {
- prev = cur;
- if (cur->isRenderInline()) {
- cur = toRenderInline(cur)->inlineElementContinuation();
- ASSERT(cur || !toRenderInline(prev)->continuation());
</del><ins>+ auto* previous = &downcast<RenderBoxModelObject>(renderer);
+ for (auto* current = previous; current; ) {
+ previous = current;
+ if (is<RenderInline>(*current)) {
+ current = downcast<RenderInline>(*current).inlineElementContinuation();
+ ASSERT(current || !downcast<RenderInline>(*previous).continuation());
</ins><span class="cx"> } else
</span><del>- cur = toRenderBlock(cur)->inlineElementContinuation();
</del><ins>+ current = downcast<RenderBlock>(*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->isRenderInline()) {
- cur = curContainer->firstChild();
- while (cur) {
- if (cur == child)
- return prev;
- prev = cur;
- cur = cur->nextSibling();
</del><ins>+ RenderObject* previous = nullptr;
+ for (RenderBoxModelObject* currentContainer = renderer; currentContainer; ) {
+ if (is<RenderInline>(*currentContainer)) {
+ auto* current = currentContainer->firstChild();
+ while (current) {
+ if (current == child)
+ return previous;
+ previous = current;
+ current = current->nextSibling();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- curContainer = toRenderInline(curContainer)->continuation();
- } else if (curContainer->isRenderBlock()) {
- if (curContainer == child)
- return prev;
</del><ins>+ currentContainer = downcast<RenderInline>(*currentContainer).continuation();
+ } else if (is<RenderBlock>(*currentContainer)) {
+ if (currentContainer == child)
+ return previous;
</ins><span class="cx">
</span><del>- prev = curContainer;
- curContainer = toRenderBlock(curContainer)->inlineElementContinuation();
</del><ins>+ previous = currentContainer;
+ currentContainer = downcast<RenderBlock>(*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->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer)))
</del><ins>+ if (is<RenderBox>(*m_renderer) && (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->isAnonymousBlock() && firstChildIsInlineContinuation(m_renderer)) {
</span><del>- RenderObject* firstParent = startOfContinuations(m_renderer->firstChildSlow())->parent();
</del><ins>+ auto* firstParent = startOfContinuations(*m_renderer->firstChildSlow())->parent();
</ins><span class="cx"> while (firstChildIsInlineContinuation(firstParent))
</span><del>- firstParent = startOfContinuations(firstParent->firstChildSlow())->parent();
</del><ins>+ firstParent = startOfContinuations(*firstParent->firstChild())->parent();
</ins><span class="cx"> previousSibling = firstParent->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->parent()->isRenderInline() && (startOfConts = startOfContinuations(m_renderer->parent())))
</del><ins>+ else if (is<RenderInline>(*m_renderer->parent()) && (startOfConts = startOfContinuations(*m_renderer->parent())))
</ins><span class="cx"> previousSibling = childBeforeConsideringContinuations(startOfConts, m_renderer->parent()->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->isRenderBlock() && (inlineContinuation = toRenderBlock(m_renderer)->inlineElementContinuation()))
- nextSibling = firstChildConsideringContinuation(inlineContinuation);
</del><ins>+ if (is<RenderBlock>(*m_renderer) && (inlineContinuation = downcast<RenderBlock>(*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->isAnonymousBlock() && lastChildHasContinuation(m_renderer)) {
</span><del>- RenderElement* lastParent = endOfContinuations(toRenderBlock(m_renderer)->lastChild())->parent();
</del><ins>+ RenderElement* lastParent = endOfContinuations(*downcast<RenderBlock>(*m_renderer).lastChild())->parent();
</ins><span class="cx"> while (lastChildHasContinuation(lastParent))
</span><del>- lastParent = endOfContinuations(lastParent->lastChild())->parent();
</del><ins>+ lastParent = endOfContinuations(*lastParent->lastChild())->parent();
</ins><span class="cx"> nextSibling = lastParent->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)->nextSibling();
</del><ins>+ nextSibling = endOfContinuations(*m_renderer)->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->parent())) {
</span><del>- auto continuation = toRenderInline(m_renderer->parent())->continuation();
</del><ins>+ auto& continuation = *downcast<RenderInline>(*m_renderer->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->isRenderBlock())
- nextSibling = continuation;
</del><ins>+ if (is<RenderBlock>(continuation))
+ nextSibling = &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()->getOrCreate(nextSibling);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RenderBoxModelObject* nextContinuation(RenderObject* renderer)
</del><ins>+static RenderBoxModelObject* nextContinuation(RenderObject& renderer)
</ins><span class="cx"> {
</span><del>- ASSERT(renderer);
- if (renderer->isRenderInline() && !renderer->isReplaced())
- return toRenderInline(renderer)->continuation();
- if (renderer->isRenderBlock())
- return toRenderBlock(renderer)->inlineElementContinuation();
</del><ins>+ if (is<RenderInline>(renderer) && !renderer.isReplaced())
+ return downcast<RenderInline>(renderer).continuation();
+ if (is<RenderBlock>(renderer))
+ return downcast<RenderBlock>(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->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer)))
</del><ins>+ if (is<RenderBlock>(*m_renderer) && (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 && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
</del><ins>+ else if (is<RenderInline>(parent) && (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->node()->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->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 && !currRenderer->node(); currRenderer = currRenderer->parent()) {
- if (currRenderer->isAnonymousBlock()) {
- RenderObject* continuation = toRenderBlock(currRenderer)->continuation();
- if (continuation)
</del><ins>+ for (currentRenderer = m_renderer; currentRenderer && !currentRenderer->node(); currentRenderer = currentRenderer->parent()) {
+ if (currentRenderer->isAnonymousBlock()) {
+ if (RenderObject* continuation = downcast<RenderBlock>(*currentRenderer).continuation())
</ins><span class="cx"> return cache->getOrCreate(continuation)->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->node();
- for ( ; node; node = node->parentNode()) {
</del><ins>+ for (Node* node = currentRenderer->node(); node; node = node->parentNode()) {
</ins><span class="cx"> if (is<HTMLAnchorElement>(*node) || (node->renderer() && cache->getOrCreate(node->renderer())->isAnchor()))
</span><span class="cx"> return downcast<Element>(node);
</span><span class="cx"> }
</span><span class="lines">@@ -1677,14 +1666,14 @@
</span><span class="cx"> return;
</span><span class="cx"> Element& element = downcast<Element>(*m_renderer->node());
</span><span class="cx">
</span><del>- if (!m_renderer->isBoxModelObject())
</del><ins>+ if (!is<RenderBoxModelObject>(*m_renderer))
</ins><span class="cx"> return;
</span><del>- RenderBoxModelObject* renderer = toRenderBoxModelObject(m_renderer);
</del><ins>+ RenderBoxModelObject& renderer = downcast<RenderBoxModelObject>(*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->isTextField() && is<HTMLInputElement>(element))
</del><ins>+ if (renderer.isTextField() && is<HTMLInputElement>(element))
</ins><span class="cx"> downcast<HTMLInputElement>(element).setValue(string);
</span><del>- else if (renderer->isTextArea() && is<HTMLTextAreaElement>(element))
</del><ins>+ else if (renderer.isTextArea() && is<HTMLTextAreaElement>(element))
</ins><span class="cx"> downcast<HTMLTextAreaElement>(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)->renderer();
- return (renderer &&
- renderer->childrenInline() &&
- (renderer->isRenderBlock() && toRenderBlock(renderer)->inlineElementContinuation() == nil) &&
- !renderer->isTable());
</del><ins>+ RenderObject* renderer = core(self)->renderer();
+ return renderer
+ && renderer->childrenInline()
+ && (is<RenderBlock>(*renderer) && !downcast<RenderBlock>(*renderer).inlineElementContinuation())
+ && !renderer->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)->renderer();
- return (renderer && (renderer->isRenderBlockFlow() || (renderer->isRenderBlock() && toRenderBlock(renderer)->inlineElementContinuation() != nil)));
</del><ins>+ RenderObject* renderer = core(self)->renderer();
+ return renderer && (is<RenderBlockFlow>(*renderer) || (is<RenderBlock>(*renderer) && downcast<RenderBlock>(*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->isEmpty()) {
</span><span class="cx"> result = 0;
</span><del>- } else if (renderer->isRenderBlockFlow() || (renderer->isRenderBlock() && toRenderBlock(renderer)->inlineElementContinuation() != 0)) {
</del><ins>+ } else if (is<RenderBlockFlow>(*renderer) || (is<RenderBlock>(*renderer) && downcast<RenderBlock>(*renderer).inlineElementContinuation())) {
</ins><span class="cx"> BOOL noCost = NO;
</span><del>- if (renderer->isBox()) {
- RenderBox &asBox = renderer->enclosingBox();
- RenderObject *parent = asBox.parent();
- RenderBox *parentRenderBox = (parent && parent->isBox()) ? toRenderBox(parent) : 0;
</del><ins>+ if (is<RenderBox>(*renderer)) {
+ RenderBox& asBox = renderer->enclosingBox();
+ RenderObject* parent = asBox.parent();
+ RenderBox* parentRenderBox = is<RenderBox>(parent) ? downcast<RenderBox>(parent) : nullptr;
</ins><span class="cx"> if (parentRenderBox && asBox.width() == parentRenderBox->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<GridTrackSize>& trackSizes = direction == ForColumns ? style->gridColumns() : style->gridRows();
</span><span class="cx"> const OrderedNamedGridLinesMap& orderedNamedGridLines = direction == ForColumns ? style->orderedNamedGridColumnLines() : style->orderedNamedGridRowLines();
</span><del>- bool isRenderGrid = renderer && renderer->isRenderGrid();
</del><ins>+ bool isRenderGrid = is<RenderGrid>(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)->firstChild();
</del><ins>+ trackListIsEmpty = !downcast<RenderBlock>(*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<LayoutUnit>& trackPositions = direction == ForColumns ? toRenderGrid(renderer)->columnPositions() : toRenderGrid(renderer)->rowPositions();
</del><ins>+ const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? downcast<RenderGrid>(*renderer).columnPositions() : downcast<RenderGrid>(*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 >= 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 "RemoveCSSPropertyCommand.h"
</span><span class="cx"> #include "RemoveNodeCommand.h"
</span><span class="cx"> #include "RemoveNodePreservingChildrenCommand.h"
</span><ins>+#include "RenderBlockFlow.h"
+#include "RenderText.h"
</ins><span class="cx"> #include "ReplaceNodeWithSpanCommand.h"
</span><span class="cx"> #include "ReplaceSelectionCommand.h"
</span><del>-#include "RenderBlock.h"
-#include "RenderText.h"
</del><span class="cx"> #include "ScopedEventQueue.h"
</span><span class="cx"> #include "SetNodeAttributeCommand.h"
</span><span class="cx"> #include "SplitElementCommand.h"
</span><span class="lines">@@ -929,21 +929,21 @@
</span><span class="cx"> PassRefPtr<Node> 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->renderer();
</span><del>- if (!renderer || !renderer->isRenderBlockFlow())
- return 0;
</del><ins>+ if (!is<RenderBlockFlow>(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->height() == 0 || (block->isListItem() && block->isEmpty()))
</del><ins>+ RenderBlockFlow& blockFlow = downcast<RenderBlockFlow>(*renderer);
+ if (!blockFlow.height() || (blockFlow.isListItem() && 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->renderer() || m_node->renderer()->style().visibility() != VISIBLE
</span><del>- || (m_node->renderer()->isRenderBlockFlow() && !toRenderBlock(m_node->renderer())->height() && !m_node->hasTagName(bodyTag)))
</del><ins>+ || (is<RenderBlockFlow>(*m_node->renderer()) && !downcast<RenderBlockFlow>(*m_node->renderer()).height() && !is<HTMLBodyElement>(*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->renderer();
</span><del>- if (!renderer || !renderer->isRenderBlock())
</del><ins>+ if (!is<RenderBlock>(renderer))
</ins><span class="cx"> return 0;
</span><span class="cx">
</span><del>- RenderBlock* block = toRenderBlock(renderer);
- return block->height() + block->marginTop() + block->marginBottom();
</del><ins>+ RenderBlock& block = downcast<RenderBlock>(*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 && !object->canContainFixedPositionObjects())
</span><span class="cx"> object = object->parent();
</span><span class="cx"> ASSERT(!object || !object->isAnonymousBlock());
</span><del>- return toRenderBlock(object);
</del><ins>+ return downcast<RenderBlock>(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 && !object->isRenderBlock())
</del><ins>+ if (object && !is<RenderBlock>(*object))
</ins><span class="cx"> object = object->containingBlock();
</span><span class="cx">
</span><span class="cx"> while (object && object->isAnonymousBlock())
</span><span class="cx"> object = object->containingBlock();
</span><span class="cx">
</span><del>- return toRenderBlock(object);
</del><ins>+ return downcast<RenderBlock>(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 && isNonRenderBlockInline(*object))
</span><span class="cx"> object = object->parent();
</span><del>- return toRenderBlock(object);
</del><ins>+ return downcast<RenderBlock>(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->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 && (cb->style().position() == StaticPosition || (cb->isInline() && !cb->isReplaced())) && !cb->isRenderView()) {
- if (cb->style().position() == RelativePosition && cb->isInline() && !cb->isReplaced()) {
- cb = cb->containingBlock();
</del><ins>+ auto containingBlock = parent();
+ while (containingBlock && (containingBlock->style().position() == StaticPosition || (containingBlock->isInline() && !containingBlock->isReplaced())) && !containingBlock->isRenderView()) {
+ if (containingBlock->style().position() == RelativePosition && containingBlock->isInline() && !containingBlock->isReplaced()) {
+ containingBlock = containingBlock->containingBlock();
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><del>- cb = cb->parent();
</del><ins>+ containingBlock = containingBlock->parent();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (cb->isRenderBlock())
- toRenderBlock(cb)->removePositionedObjects(this, NewContainingBlock);
</del><ins>+ if (is<RenderBlock>(*containingBlock))
+ downcast<RenderBlock>(*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 && beforeChild->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 && beforeChild->parent() == curr) {
- if (curr->firstChild() == beforeChild)
</del><ins>+ for (auto* current = downcast<RenderBlock>(continuation()); current; current = downcast<RenderBlock>(current->continuation())) {
+ if (beforeChild && beforeChild->parent() == current) {
+ if (current->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->continuation());
</del><ins>+ last = current;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!beforeChild && !last->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<RenderBlock> cloneBlock = clone();
- if (!isAnonymousBlock())
- cloneBlock->setContinuation(oldCont);
-
- if (!beforeChild && 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 && 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->isAnonymousBlock())
- middleBlock->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->nextSibling();
-
- while (curr && curr->isDescendantOf(fromBlock) && curr != fromBlock) {
- RenderBlock* blockCurr = toRenderBlock(curr);
-
- // Create a new clone.
- RenderPtr<RenderBlock> cloneChild = WTF::move(cloneBlock);
- cloneBlock = blockCurr->clone();
-
- // Insert our child clone as the first child.
- cloneBlock->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->isAnonymousBlock()) {
- oldCont = blockCurr->continuation();
- blockCurr->setContinuation(cloneBlock.get());
- cloneBlock->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->moveChildrenTo(cloneBlock.get(), currChildNextSibling, 0, true);
-
- // Keep walking up the chain.
- currChild = curr;
- currChildNextSibling = currChild->nextSibling();
- curr = toRenderBoxModelObject(curr->parent());
- }
-
- // Now we are at the columns block level. We need to put the clone into the toBlock.
- toBlock->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 && currChildNextSibling->parent() == fromBlock)
- fromBlock->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() && !isAnonymousBlock())
</span><span class="lines">@@ -559,7 +486,7 @@
</span><span class="cx"> RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : lastChild();
</span><span class="cx">
</span><span class="cx"> if (afterChild && afterChild->isAnonymousBlock()) {
</span><del>- toRenderBlock(afterChild)->addChild(newChild);
</del><ins>+ downcast<RenderBlock>(*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 && parent() && isAnonymousBlock() && parent()->isRenderBlock())
- toRenderBlock(parent())->removeLeftoverAnonymousBlock(this);
</del><ins>+ if (madeBoxesNonInline && is<RenderBlock>(parent()) && isAnonymousBlock())
+ downcast<RenderBlock>(*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->destroy();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool canMergeAnonymousBlock(RenderBlock* anonymousBlock)
</del><ins>+static bool canMergeAnonymousBlock(RenderBlock& anonymousBlock)
</ins><span class="cx"> {
</span><del>- if (anonymousBlock->beingDestroyed() || anonymousBlock->continuation())
</del><ins>+ if (anonymousBlock.beingDestroyed() || anonymousBlock.continuation())
</ins><span class="cx"> return false;
</span><del>- if (anonymousBlock->isRubyRun() || anonymousBlock->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->isAnonymousBlock())
</span><span class="cx"> return false;
</span><del>- RenderBlock* previousAnonymousBlock = toRenderBlock(previous);
</del><ins>+ RenderBlock& previousAnonymousBlock = downcast<RenderBlock>(*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->isAnonymousBlock())
</span><span class="cx"> return false;
</span><del>- RenderBlock* nextAnonymousBlock = toRenderBlock(next);
</del><ins>+ RenderBlock& nextAnonymousBlock = downcast<RenderBlock>(*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& parent, RenderBlock* child)
</ins><span class="cx"> {
</span><del>- parent->setNeedsLayoutAndPrefWidthsRecalc();
- parent->setChildrenInline(child->childrenInline());
</del><ins>+ parent.setNeedsLayoutAndPrefWidthsRecalc();
+ parent.setChildrenInline(child->childrenInline());
</ins><span class="cx"> RenderObject* nextSibling = child->nextSibling();
</span><span class="cx">
</span><span class="cx"> RenderFlowThread* childFlowThread = child->flowThreadContainingBlock();
</span><span class="lines">@@ -764,8 +691,8 @@
</span><span class="cx"> if (childFlowThread && childFlowThread->isRenderNamedFlowThread())
</span><span class="cx"> toRenderNamedFlowThread(childFlowThread)->removeFlowChildInfo(child);
</span><span class="cx">
</span><del>- parent->removeChildInternal(*child, child->hasLayer() ? NotifyChildren : DontNotifyChildren);
- child->moveAllChildrenTo(parent, nextSibling, child->hasLayer());
</del><ins>+ parent.removeChildInternal(*child, child->hasLayer() ? NotifyChildren : DontNotifyChildren);
+ child->moveAllChildrenTo(&parent, nextSibling, child->hasLayer());
</ins><span class="cx"> // Delete the now-empty block's lines and nuke it.
</span><span class="cx"> child->deleteLines();
</span><span class="cx"> child->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 && prev && next) {
</span><span class="cx"> prev->setNeedsLayoutAndPrefWidthsRecalc();
</span><del>- RenderBlock* nextBlock = toRenderBlock(next);
- RenderBlock* prevBlock = toRenderBlock(prev);
</del><ins>+ RenderBlock& nextBlock = downcast<RenderBlock>(*next);
+ RenderBlock& prevBlock = downcast<RenderBlock>(*prev);
</ins><span class="cx">
</span><span class="cx"> if (prev->childrenInline() != next->childrenInline()) {
</span><del>- RenderBlock* inlineChildrenBlock = prev->childrenInline() ? prevBlock : nextBlock;
- RenderBlock* blockChildrenBlock = prev->childrenInline() ? nextBlock : prevBlock;
</del><ins>+ RenderBlock& inlineChildrenBlock = prev->childrenInline() ? prevBlock : nextBlock;
+ RenderBlock& blockChildrenBlock = prev->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->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->hasLayer();
- inlineChildrenBlock->setStyle(RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK));
- removeChildInternal(*inlineChildrenBlock, inlineChildrenBlockHasLayer ? NotifyChildren : DontNotifyChildren);
</del><ins>+ bool inlineChildrenBlockHasLayer = inlineChildrenBlock.hasLayer();
+ inlineChildrenBlock.setStyle(RenderStyle::createAnonymousStyleWithDisplay(&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->firstChild() : nullptr;
- blockChildrenBlock->insertChildInternal(inlineChildrenBlock, beforeChild,
- (inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer()) ? NotifyChildren : DontNotifyChildren);
</del><ins>+ RenderObject* beforeChild = prev == &inlineChildrenBlock ? blockChildrenBlock.firstChild() : nullptr;
+ blockChildrenBlock.insertChildInternal(&inlineChildrenBlock, beforeChild,
+ (inlineChildrenBlockHasLayer || blockChildrenBlock.hasLayer()) ? NotifyChildren : DontNotifyChildren);
</ins><span class="cx"> next->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 "this". 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 (&inlineChildrenBlock == &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->moveAllChildrenIncludingFloatsTo(prevBlock, nextBlock->hasLayer() || prevBlock->hasLayer());
</del><ins>+ nextBlock.moveAllChildrenIncludingFloatsTo(&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->deleteLines();
- nextBlock->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<RenderBlock>(child));
</ins><span class="cx"> nextSibling = nullptr;
</span><span class="cx"> } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousBlock())) && 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 && prev->isAnonymousBlock()) ? prev : next);
</del><ins>+ RenderBlock* anonBlock = downcast<RenderBlock>((prev && prev->isAnonymousBlock()) ? prev : next);
</ins><span class="cx"> if ((anonBlock->previousSibling() || anonBlock->nextSibling())
</span><span class="cx"> && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->style().styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating() && !anonBlock->previousSibling()->previousSibling()))
</span><span class="cx"> && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style().styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating() && !anonBlock->nextSibling()->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 && containingBlockIgnoringAnonymous->isAnonymousBlock())
</span><span class="cx"> containingBlockIgnoringAnonymous = containingBlockIgnoringAnonymous->containingBlock();
</span><del>- for (RenderObject* curr = this; curr; curr = curr->previousInPreOrder(containingBlockIgnoringAnonymous)) {
- if (curr->virtualContinuation() != this)
</del><ins>+ for (RenderObject* current = this; current; current = current->previousInPreOrder(containingBlockIgnoringAnonymous)) {
+ if (current->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->isRenderInline())
- toRenderInline(curr)->setContinuation(nextContinuation);
- else if (curr->isRenderBlock())
- toRenderBlock(curr)->setContinuation(nextContinuation);
</del><ins>+ if (is<RenderInline>(*current))
+ downcast<RenderInline>(*current).setContinuation(nextContinuation);
+ else if (is<RenderBlock>(*current))
+ downcast<RenderBlock>(*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->isInline())
</span><del>- return 0;
- RenderBlock* nextContinuation = toRenderBlock(currentContinuation);
- if (nextContinuation->isAnonymousBlock())
- return nextContinuation->blockElementContinuation();
- return nextContinuation;
</del><ins>+ return nullptr;
+ RenderBlock& nextContinuation = downcast<RenderBlock>(*currentContinuation);
+ if (nextContinuation.isAnonymousBlock())
+ return nextContinuation.blockElementContinuation();
+ return &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->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)->selectionGaps(rootBlock, rootBlockPhysicalPosition, LayoutSize(offsetFromRootBlock.width() + curr->x(), offsetFromRootBlock.height() + curr->y()),
</del><ins>+ result.unite(downcast<RenderBlock>(*curr).selectionGaps(rootBlock, rootBlockPhysicalPosition, LayoutSize(offsetFromRootBlock.width() + curr->x(), offsetFromRootBlock.height() + curr->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& 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->previousSibling();
</span><del>- while (sibling && (!sibling->isRenderBlock() || toRenderBlock(sibling)->isSelectionRoot()))
</del><ins>+ while (sibling && (!is<RenderBlock>(*sibling) || downcast<RenderBlock>(*sibling).isSelectionRoot()))
</ins><span class="cx"> sibling = sibling->previousSibling();
</span><span class="cx">
</span><del>- offset -= LayoutSize(toRenderBlock(object)->logicalLeft(), toRenderBlock(object)->logicalTop());
</del><ins>+ offset -= LayoutSize(downcast<RenderBlock>(*object).logicalLeft(), downcast<RenderBlock>(*object).logicalTop());
</ins><span class="cx"> object = object->parent();
</span><del>- } while (!sibling && object && object->isRenderBlock() && !toRenderBlock(object)->isSelectionRoot());
</del><ins>+ } while (!sibling && is<RenderBlock>(object) && !downcast<RenderBlock>(*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<RenderBlock>(sibling);
</ins><span class="cx">
</span><span class="cx"> offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop());
</span><span class="cx">
</span><span class="cx"> RenderObject* child = beforeBlock->lastChild();
</span><del>- while (child && child->isRenderBlock()) {
- beforeBlock = toRenderBlock(child);
</del><ins>+ while (is<RenderBlock>(child)) {
+ beforeBlock = downcast<RenderBlock>(child);
</ins><span class="cx"> offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop());
</span><span class="cx"> child = beforeBlock->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& block = box.isRenderBlock() ? toRenderBlock(box) : *box.containingBlock();
</del><ins>+ const RenderBlock& block = is<RenderBlock>(box) ? downcast<RenderBlock>(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->isReplaced() || firstLineBlock->isFloating()
</span><span class="cx"> || !parentBlock || parentBlock->firstChild() != firstLineBlock || !isRenderBlockFlowOrRenderButton(*parentBlock))
</span><span class="cx"> break;
</span><del>- firstLineBlock = toRenderBlock(parentBlock);
</del><ins>+ firstLineBlock = downcast<RenderBlock>(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->parent();
</span><span class="cx"> if (firstLetterBlock->isReplaced() || !parentBlock || parentBlock->firstChild() != firstLetterBlock
</span><span class="cx"> || !isRenderBlockFlowOrRenderButton(*parentBlock))
</span><del>- return 0;
- firstLetterBlock = toRenderBlock(parentBlock);
</del><ins>+ return nullptr;
+ firstLetterBlock = downcast<RenderBlock>(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() && parent() && parent()->isRenderBlock())
- toRenderBlock(parent())->removeLeftoverAnonymousBlock(this);
</del><ins>+ if (isAnonymousBlock() && is<RenderBlock>(parent()))
+ downcast<RenderBlock>(*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<RenderBlock>(child) ? downcast<RenderBlock>(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<RenderBlock>(child) ? downcast<RenderBlock>(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<RenderBlock>(child) ? downcast<RenderBlock>(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<RenderBlock>(child) ? downcast<RenderBlock>(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& 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<RenderBlock> 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& rootBlock, const LayoutSize& offsetFromRootBlock);
</span><span class="cx"> LayoutUnit inlineDirectionOffset(RenderBlock& rootBlock, const LayoutSize& offsetFromRootBlock);
</span><span class="cx"> VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock&, RenderBox&, const LayoutPoint&);
</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->needsLayout()) {
</span><span class="cx"> grandchildBox->computeAndSetBlockDirectionMargins(this);
</span><del>- if (grandchildBox->isRenderBlock()) {
- RenderBlock* grandchildBlock = toRenderBlock(grandchildBox);
- grandchildBlock->setHasMarginBeforeQuirk(grandchildBox->style().hasMarginBeforeQuirk());
- grandchildBlock->setHasMarginAfterQuirk(grandchildBox->style().hasMarginAfterQuirk());
</del><ins>+ if (is<RenderBlock>(*grandchildBox)) {
+ RenderBlock& grandchildBlock = downcast<RenderBlock>(*grandchildBox);
+ grandchildBlock.setHasMarginBeforeQuirk(grandchildBox->style().hasMarginBeforeQuirk());
+ grandchildBlock.setHasMarginAfterQuirk(grandchildBox->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() && child.isRenderBlock())
- logicalTopEstimate += toRenderBlock(child).paginationStrut();
</del><ins>+ if (!child.selfNeedsLayout() && is<RenderBlock>(child))
+ logicalTopEstimate += downcast<RenderBlock>(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& child, bool atBeforeSideOfBlock)
</span><span class="cx"> {
</span><del>- RenderBlock* childRenderBlock = child.isRenderBlock() ? toRenderBlock(&child) : nullptr;
</del><ins>+ RenderBlock* childRenderBlock = is<RenderBlock>(child) ? &downcast<RenderBlock>(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(&childBox) : nullptr;
</del><ins>+ RenderBlock* childBlock = is<RenderBlock>(childBox) ? &downcast<RenderBlock>(childBox) : nullptr;
</ins><span class="cx"> if (childBlock && childBlock->paginationStrut()) {
</span><span class="cx"> newLogicalTop += childBlock->paginationStrut();
</span><span class="cx"> childBlock->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->nextSibling()) {
</span><del>- if (!next->isRenderBlockFlow() || next->isFloatingOrOutOfFlowPositioned() || toRenderBlock(next)->avoidsFloats())
</del><ins>+ if (!is<RenderBlockFlow>(*next) || next->isFloatingOrOutOfFlowPositioned() || downcast<RenderBlockFlow>(*next).avoidsFloats())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- RenderBlockFlow* nextBlock = toRenderBlockFlow(next);
</del><ins>+ RenderBlockFlow& nextBlock = downcast<RenderBlockFlow>(*next);
</ins><span class="cx"> for (auto it = floatingObjectSet.begin(); it != end; ++it) {
</span><span class="cx"> RenderBox& floatingBox = (*it)->renderer();
</span><span class="cx"> if (floatToRemove && &floatingBox != floatToRemove)
</span><span class="cx"> continue;
</span><del>- if (nextBlock->containsFloat(floatingBox))
- nextBlock->markAllDescendantsWithFloatsForLayout(&floatingBox);
</del><ins>+ if (nextBlock.containsFloat(floatingBox))
+ nextBlock.markAllDescendantsWithFloatsForLayout(&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->renderer()))
</span><span class="cx"> floatBox.setNeedsLayout(MarkOnlyThis);
</span><del>- else if (floatBox.isRenderBlock())
- toRenderBlock(floatBox).setChildNeedsLayout(MarkOnlyThis);
</del><ins>+ else if (is<RenderBlock>(floatBox))
+ downcast<RenderBlock>(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->isAnonymous() && !cb->isRenderView()) {
</del><ins>+ while (cb->isAnonymous() && !is<RenderView>(*cb)) {
</ins><span class="cx"> cb = cb->containingBlock();
</span><del>- toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderBox&>(*this));
</del><ins>+ downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*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->isOutOfFlowPositioned() && cb->style().height().isAuto() && !(cb->style().top().isAuto() || cb->style().bottom().isAuto())) {
</span><span class="cx"> ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock());
</span><del>- RenderBlock* block = toRenderBlock(cb);
</del><ins>+ RenderBlock& block = downcast<RenderBlock>(*cb);
</ins><span class="cx"> LogicalExtentComputedValues computedValues;
</span><del>- block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
- LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight();
- LayoutUnit newHeight = block->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)->addPercentHeightDescendant(const_cast<RenderBox&>(*this));
</del><ins>+ downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
</ins><span class="cx"> cb = cb->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() && isOutOfFlowPositioned() && style().height().isAuto() && !(style().top().isAuto() || style().bottom().isAuto())) {
- RenderBlock* block = const_cast<RenderBlock*>(toRenderBlock(this));
</del><ins>+ if (is<RenderBlock>(*this) && isOutOfFlowPositioned() && style().height().isAuto() && !(style().top().isAuto() || style().bottom().isAuto())) {
+ RenderBlock& block = const_cast<RenderBlock&>(downcast<RenderBlock>(*this));
</ins><span class="cx"> LogicalExtentComputedValues computedValues;
</span><del>- block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
- LayoutUnit newContentHeight = computedValues.m_extent - block->borderAndPaddingLogicalHeight() - block->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 && containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode())
</span><span class="cx"> return containingBlockLogicalHeightForPositioned(containingBlock, false);
</span><span class="cx">
</span><del>- if (containingBlock->isBox()) {
</del><ins>+ if (is<RenderBox>(*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 && containingBlock->isRenderView())
- return toRenderView(containingBlock)->clientLogicalWidthForFixedPosition();
</del><ins>+ if (isFixedPosition && is<RenderView>(*containingBlock))
+ return downcast<RenderView>(*containingBlock).clientLogicalWidthForFixedPosition();
</ins><span class="cx">
</span><del>- return toRenderBox(containingBlock)->clientLogicalWidth();
</del><ins>+ return downcast<RenderBox>(*containingBlock).clientLogicalWidth();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (isFixedPosition && containingBlock->isRenderNamedFlowThread())
</del><ins>+ if (isFixedPosition && is<RenderNamedFlowThread>(*containingBlock))
</ins><span class="cx"> return containingBlock->view().clientLogicalWidth();
</span><span class="cx">
</span><del>- if (!containingBlock->isRenderBlock())
- return toRenderBox(*containingBlock).clientLogicalWidth();
</del><ins>+ if (!is<RenderBlock>(*containingBlock))
+ return downcast<RenderBox>(*containingBlock).clientLogicalWidth();
</ins><span class="cx">
</span><del>- const RenderBlock* cb = toRenderBlock(containingBlock);
- RenderBoxRegionInfo* boxInfo = 0;
</del><ins>+ const RenderBlock& cb = downcast<RenderBlock>(*containingBlock);
+ RenderBoxRegionInfo* boxInfo = nullptr;
</ins><span class="cx"> if (!region) {
</span><span class="cx"> if (containingBlock->isRenderFlowThread() && !checkForPerpendicularWritingMode)
</span><span class="cx"> return toRenderFlowThread(containingBlock)->contentLogicalWidthOfFirstRegion();
</span><span class="cx"> if (isWritingModeRoot()) {
</span><del>- LayoutUnit cbPageOffset = cb->offsetFromLogicalTopOfFirstPage();
- RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset);
</del><ins>+ LayoutUnit cbPageOffset = cb.offsetFromLogicalTopOfFirstPage();
+ RenderRegion* cbRegion = cb.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx"> if (cbRegion)
</span><del>- boxInfo = cb->renderBoxRegionInfo(cbRegion);
</del><ins>+ boxInfo = cb.renderBoxRegionInfo(cbRegion);
</ins><span class="cx"> }
</span><span class="cx"> } else if (region && flowThread->isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode()) {
</span><del>- RenderRegion* containingBlockRegion = cb->clampToStartAndEndRegions(region);
- boxInfo = cb->renderBoxRegionInfo(containingBlockRegion);
</del><ins>+ RenderRegion* containingBlockRegion = cb.clampToStartAndEndRegions(region);
+ boxInfo = cb.renderBoxRegionInfo(containingBlockRegion);
</ins><span class="cx"> }
</span><del>- return (boxInfo) ? std::max<LayoutUnit>(0, cb->clientLogicalWidth() - (cb->logicalWidth() - boxInfo->logicalWidth())) : cb->clientLogicalWidth();
</del><ins>+ return (boxInfo) ? std::max<LayoutUnit>(0, cb.clientLogicalWidth() - (cb.logicalWidth() - boxInfo->logicalWidth())) : cb.clientLogicalWidth();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT(containingBlock->isRenderInline() && containingBlock->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 && containingBlock->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->isBox()) {
</span><span class="cx"> bool isFixedPosition = style().position() == FixedPosition;
</span><span class="cx">
</span><del>- if (isFixedPosition && containingBlock->isRenderView())
- return toRenderView(containingBlock)->clientLogicalHeightForFixedPosition();
</del><ins>+ if (isFixedPosition && is<RenderView>(*containingBlock))
+ return downcast<RenderView>(*containingBlock).clientLogicalHeightForFixedPosition();
</ins><span class="cx">
</span><del>- const RenderBlock* cb = containingBlock->isRenderBlock() ? toRenderBlock(containingBlock) : containingBlock->containingBlock();
</del><ins>+ const RenderBlock* cb = is<RenderBlock>(*containingBlock) ? downcast<RenderBlock>(containingBlock) : containingBlock->containingBlock();
</ins><span class="cx"> LayoutUnit result = cb->clientLogicalHeight();
</span><span class="cx"> RenderFlowThread* flowThread = flowThreadContainingBlock();
</span><del>- if (flowThread && containingBlock->isRenderFlowThread() && flowThread->isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode()) {
- if (containingBlock->isRenderNamedFlowThread() && isFixedPosition)
</del><ins>+ if (flowThread && is<RenderFlowThread>(*containingBlock) && flowThread->isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode()) {
+ if (is<RenderNamedFlowThread>(*containingBlock) && isFixedPosition)
</ins><span class="cx"> return containingBlock->view().clientLogicalHeight();
</span><del>- return toRenderFlowThread(containingBlock)->contentLogicalHeightOfFirstRegion();
</del><ins>+ return downcast<RenderFlowThread>(*containingBlock).contentLogicalHeightOfFirstRegion();
</ins><span class="cx"> }
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ASSERT(containingBlock->isRenderInline() && containingBlock->isInFlowPositioned());
</del><ins>+ ASSERT(is<RenderInline>(*containingBlock) && containingBlock->isInFlowPositioned());
</ins><span class="cx">
</span><del>- const RenderInline* flow = toRenderInline(containingBlock);
- InlineFlowBox* first = flow->firstLineBox();
- InlineFlowBox* last = flow->lastLineBox();
</del><ins>+ const RenderInline& flow = downcast<RenderInline>(*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->linesBoundingBox();
</del><ins>+ LayoutRect boundingBox = flow.linesBoundingBox();
</ins><span class="cx"> if (containingBlock->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->parent()->style().direction() == LTR) {
</span><span class="cx"> LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();
</span><del>- for (auto curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
- if (curr->isBox()) {
- staticPosition += toRenderBox(curr)->logicalLeft();
- if (region && toRenderBox(curr)->isRenderBlock()) {
- const RenderBlock* cb = toRenderBlock(curr);
- region = cb->clampToStartAndEndRegions(region);
- RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(region);
</del><ins>+ for (auto current = child->parent(); current && current != containerBlock; current = current->container()) {
+ if (is<RenderBox>(*current)) {
+ staticPosition += downcast<RenderBox>(*current).logicalLeft();
+ if (region && is<RenderBlock>(*current)) {
+ const RenderBlock& currentBlock = downcast<RenderBlock>(*current);
+ region = currentBlock.clampToStartAndEndRegions(region);
+ RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region);
</ins><span class="cx"> if (boxInfo)
</span><span class="cx"> staticPosition += boxInfo->logicalLeft();
</span><span class="cx"> }
</span><span class="lines">@@ -3196,25 +3196,25 @@
</span><span class="cx"> } else {
</span><span class="cx"> RenderBox& enclosingBox = child->parent()->enclosingBox();
</span><span class="cx"> LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft();
</span><del>- for (RenderElement* curr = &enclosingBox; curr; curr = curr->container()) {
- if (curr->isBox()) {
- if (curr != containerBlock)
- staticPosition -= toRenderBox(curr)->logicalLeft();
- if (curr == &enclosingBox)
</del><ins>+ for (RenderElement* current = &enclosingBox; current; current = current->container()) {
+ if (is<RenderBox>(*current)) {
+ if (current != containerBlock)
+ staticPosition -= downcast<RenderBox>(*current).logicalLeft();
+ if (current == &enclosingBox)
</ins><span class="cx"> staticPosition -= enclosingBox.logicalWidth();
</span><del>- if (region && curr->isRenderBlock()) {
- const RenderBlock* cb = toRenderBlock(curr);
- region = cb->clampToStartAndEndRegions(region);
- RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(region);
</del><ins>+ if (region && is<RenderBlock>(*current)) {
+ const RenderBlock& currentBlock = downcast<RenderBlock>(*current);
+ region = currentBlock.clampToStartAndEndRegions(region);
+ RenderBoxRegionInfo* boxInfo = currentBlock.renderBoxRegionInfo(region);
</ins><span class="cx"> if (boxInfo) {
</span><del>- if (curr != containerBlock)
- staticPosition -= cb->logicalWidth() - (boxInfo->logicalLeft() + boxInfo->logicalWidth());
- if (curr == &enclosingBox)
</del><ins>+ if (current != containerBlock)
+ staticPosition -= currentBlock.logicalWidth() - (boxInfo->logicalLeft() + boxInfo->logicalWidth());
+ if (current == &enclosingBox)
</ins><span class="cx"> staticPosition += enclosingBox.logicalWidth() - boxInfo->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 && !region && isWritingModeRoot() && isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode() && containerBlock->isRenderBlock()) {
</del><ins>+ if (flowThread && !region && isWritingModeRoot() && isHorizontalWritingMode() == containerBlock->isHorizontalWritingMode() && is<RenderBlock>(*containerBlock)) {
</ins><span class="cx"> ASSERT(containerBlock->canHaveBoxInfoInRegion());
</span><span class="cx"> LayoutUnit logicalLeftPos = computedValues.m_position;
</span><del>- const RenderBlock* cb = toRenderBlock(containerBlock);
- LayoutUnit cbPageOffset = cb->offsetFromLogicalTopOfFirstPage();
- RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset);
</del><ins>+ const RenderBlock& renderBlock = downcast<RenderBlock>(*containerBlock);
+ LayoutUnit cbPageOffset = renderBlock.offsetFromLogicalTopOfFirstPage();
+ RenderRegion* cbRegion = renderBlock.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx"> if (cbRegion) {
</span><del>- RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(cbRegion);
</del><ins>+ RenderBoxRegionInfo* boxInfo = renderBlock.renderBoxRegionInfo(cbRegion);
</ins><span class="cx"> if (boxInfo) {
</span><span class="cx"> logicalLeftPos += boxInfo->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 && isHorizontalWritingMode() != containerBlock->isHorizontalWritingMode() && containerBlock->isRenderBlock()) {
</del><ins>+ if (flowThread && isHorizontalWritingMode() != containerBlock->isHorizontalWritingMode() && is<RenderBlock>(*containerBlock)) {
</ins><span class="cx"> ASSERT(containerBlock->canHaveBoxInfoInRegion());
</span><span class="cx"> LayoutUnit logicalTopPos = computedValues.m_position;
</span><del>- const RenderBlock* cb = toRenderBlock(containerBlock);
- LayoutUnit cbPageOffset = cb->offsetFromLogicalTopOfFirstPage() - logicalLeft();
- RenderRegion* cbRegion = cb->regionAtBlockOffset(cbPageOffset);
</del><ins>+ const RenderBlock& renderBox = downcast<RenderBlock>(*containerBlock);
+ LayoutUnit cbPageOffset = renderBox.offsetFromLogicalTopOfFirstPage() - logicalLeft();
+ RenderRegion* cbRegion = renderBox.regionAtBlockOffset(cbPageOffset);
</ins><span class="cx"> if (cbRegion) {
</span><del>- RenderBoxRegionInfo* boxInfo = cb->renderBoxRegionInfo(cbRegion);
</del><ins>+ RenderBoxRegionInfo* boxInfo = renderBox.renderBoxRegionInfo(cbRegion);
</ins><span class="cx"> if (boxInfo) {
</span><span class="cx"> logicalTopPos += boxInfo->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->isAnonymousBlock() || !child->isInFlowPositioned())
</span><span class="cx"> return LayoutSize();
</span><span class="cx"> LayoutSize offset;
</span><del>- RenderElement* p = toRenderBlock(child)->inlineElementContinuation();
- while (p && p->isRenderInline()) {
</del><ins>+ RenderElement* p = downcast<RenderBlock>(*child).inlineElementContinuation();
+ while (is<RenderInline>(p)) {
</ins><span class="cx"> if (p->isInFlowPositioned()) {
</span><del>- RenderInline* renderInline = toRenderInline(p);
- offset += renderInline->offsetForInFlowPosition();
</del><ins>+ RenderInline& renderInline = downcast<RenderInline>(*p);
+ offset += renderInline.offsetForInFlowPosition();
</ins><span class="cx"> }
</span><span class="cx"> p = p->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)->hasPositionedObjects());
</del><ins>+ ASSERT(!fullRemoveInsert || !is<RenderBlock>(*this) || !downcast<RenderBlock>(*this).hasPositionedObjects());
</ins><span class="cx">
</span><span class="cx"> ASSERT(this == child->parent());
</span><span class="cx"> ASSERT(!beforeChild || toBoxModelObject == beforeChild->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 && isRenderBlock()) {
- toRenderBlock(this)->removePositionedObjects(0);
- if (isRenderBlockFlow())
- toRenderBlockFlow(this)->removeFloatingObjects();
</del><ins>+ if (fullRemoveInsert && is<RenderBlock>(*this)) {
+ downcast<RenderBlock>(*this).removePositionedObjects(nullptr);
+ if (is<RenderBlockFlow>(*this))
+ downcast<RenderBlockFlow>(*this).removeFloatingObjects();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ASSERT(!beforeChild || toBoxModelObject == beforeChild->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 && !elementChild.isRenderBlock())
</del><ins>+ if (propagationType == PropagateToBlockChildrenOnly && !is<RenderBlock>(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<RenderFlowThread>(elementChild))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&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() && toRenderBlock(elementChild).isAnonymousBlockContinuation())
</del><ins>+ if (elementChild.isInFlowPositioned() && downcast<RenderBlock>(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<RenderBlock>(boxModelObject))
+ top = downcast<RenderBlock>(boxModelObject).offsetFromLogicalTopOfFirstPage();
</ins><span class="cx"> else {
</span><span class="cx"> if (boxModelObject.containingBlock())
</span><span class="cx"> top = boxModelObject.containingBlock()->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<RenderBox>(boxModelObject))
+ top += downcast<RenderBox>(boxModelObject).topLeftLocation().y();
+ else if (is<RenderInline>(boxModelObject))
+ top -= downcast<RenderInline>(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 && child->isAnonymousBlock()) {
</span><del>- auto& anonymousBlock = toRenderBlock(*child);
</del><ins>+ auto& anonymousBlock = downcast<RenderBlock>(*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->isAnonymousBlock() && !requiresRenderTreeRebuild) {
</span><del>- if (auto* nonAnonymousChild = toRenderBlock(*child).firstChild())
</del><ins>+ if (auto* nonAnonymousChild = downcast<RenderBlock>(*child).firstChild())
</ins><span class="cx"> child = nonAnonymousChild;
</span><span class="cx"> else {
</span><span class="cx"> child->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->isRenderInline())
- return toRenderInline(continuation);
</del><ins>+ if (is<RenderInline>(*continuation))
+ return downcast<RenderInline>(continuation);
</ins><span class="cx">
</span><del>- return continuation->isRenderBlock() ? toRenderBlock(continuation)->inlineElementContinuation() : nullptr;
</del><ins>+ return is<RenderBlock>(*continuation) ? downcast<RenderBlock>(*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->style().position() == newStyle->position())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (!box->isRenderBlock())
</del><ins>+ if (!is<RenderBlock>(*box))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- RenderBlock* block = toRenderBlock(box);
- if (!block->isAnonymousBlockContinuation())
</del><ins>+ RenderBlock& block = downcast<RenderBlock>(*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->inlineElementContinuation();
- if (oldStyle->hasInFlowPosition() && inFlowPositionedInlineAncestor(cont))
</del><ins>+ RenderInline* continuation = block.inlineElementContinuation();
+ if (oldStyle->hasInFlowPosition() && inFlowPositionedInlineAncestor(continuation))
</ins><span class="cx"> continue;
</span><del>- auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(&block->style(), BLOCK);
</del><ins>+ auto blockStyle = RenderStyle::createAnonymousStyleWithDisplay(&block.style(), BLOCK);
</ins><span class="cx"> blockStyle.get().setPosition(newStyle->position());
</span><del>- block->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()->nextSibling();
</span><span class="cx"> ASSERT(block && block->isAnonymousBlock());
</span><del>- updateStyleOfAnonymousBlockContinuations(toRenderBlock(block), &newStyle, oldStyle);
</del><ins>+ updateStyleOfAnonymousBlockContinuations(downcast<RenderBlock>(block), &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->isInline() && !renderer->isReplaced())
- return toRenderInline(renderer)->continuation();
- return toRenderBlock(renderer)->inlineElementContinuation();
</del><ins>+ if (is<RenderInline>(*renderer) && !renderer->isReplaced())
+ return downcast<RenderInline>(*renderer).continuation();
+ return downcast<RenderBlock>(*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->isAnonymousBlock() && (!block->parent() || !block->parent()->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->removePositionedObjects(0);
</del><ins>+ pre->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->isRenderBlockFlow())
- toRenderBlockFlow(pre)->removeFloatingObjects();
</del><ins>+ if (is<RenderBlockFlow>(*pre))
+ downcast<RenderBlockFlow>(*pre).removeFloatingObjects();
</ins><span class="cx"> block = block->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->createAnonymousBoxWithSameTypeAs(block));
</del><ins>+ RenderBlock& post = downcast<RenderBlock>(*pre->createAnonymousBoxWithSameTypeAs(block));
</ins><span class="cx">
</span><span class="cx"> RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
</span><span class="cx"> if (madeNewBeforeBlock)
</span><span class="cx"> block->insertChildInternal(pre, boxFirst, NotifyChildren);
</span><span class="cx"> block->insertChildInternal(newBlockBox, boxFirst, NotifyChildren);
</span><del>- block->insertChildInternal(post, boxFirst, NotifyChildren);
</del><ins>+ block->insertChildInternal(&post, boxFirst, NotifyChildren);
</ins><span class="cx"> block->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, &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->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> block->setNeedsLayoutAndPrefWidthsRecalc();
</span><del>- post->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& 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& containingBlock = *this->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->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->location() + point;
- RenderBoxModelObject* c = continuation();
- while (c) {
- RenderBox* contBlock = c->isInline() ? c->containingBlock() : toRenderBlock(c);
- if (c->isInline() || c->firstChild())
- return c->positionForPoint(parentBlockPoint - contBlock->locationOffset(), region);
- c = toRenderBlock(c)->inlineElementContinuation();
</del><ins>+ LayoutPoint parentBlockPoint = containingBlock.location() + point;
+ RenderBoxModelObject* continuation = this->continuation();
+ while (continuation) {
+ RenderBlock* currentBlock = continuation->isInline() ? continuation->containingBlock() : downcast<RenderBlock>(continuation);
+ if (continuation->isInline() || continuation->firstChild())
+ return continuation->positionForPoint(parentBlockPoint - currentBlock->locationOffset(), region);
+ continuation = downcast<RenderBlock>(*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& block = toRenderBlock(renderer());
</del><ins>+ if (is<RenderBlock>(renderer())) {
+ RenderBlock& block = downcast<RenderBlock>(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->width(), 0));
</span><span class="cx"> } else {
</span><del>- RenderBlock* rendererContainingBlock = boxModelObject.enclosingBox().isRenderBlock() ? toRenderBlock(&boxModelObject.enclosingBox()) : 0;
</del><ins>+ RenderBlock* rendererContainingBlock = is<RenderBlock>(boxModelObject.enclosingBox()) ? &downcast<RenderBlock>(boxModelObject.enclosingBox()) : nullptr;
</ins><span class="cx"> if (rendererContainingBlock)
</span><span class="cx"> rendererContainingBlock->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 "ElementTraversal.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLOListElement.h"
</span><ins>+#include "HTMLUListElement.h"
</ins><span class="cx"> #include "InlineElementBox.h"
</span><span class="cx"> #include "PseudoElement.h"
</span><ins>+#include "RenderInline.h"
</ins><span class="cx"> #include "RenderListMarker.h"
</span><span class="cx"> #include "RenderMultiColumnFlowThread.h"
</span><span class="cx"> #include "RenderView.h"
</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->isInline() && (!currChild->isRenderInline() || curr->generatesLineBoxesForInlineChild(currChild)))
</del><ins>+ if (currChild->isInline() && (!is<RenderInline>(*currChild) || curr->generatesLineBoxesForInlineChild(currChild)))
</ins><span class="cx"> return curr;
</span><span class="cx">
</span><span class="cx"> if (currChild->isFloating() || currChild->isOutOfFlowPositioned())
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (currChild->isTable() || !currChild->isRenderBlock() || (currChild->isBox() && toRenderBox(currChild)->isWritingModeRoot()))
</del><ins>+ if (currChild->isTable() || !is<RenderBlock>(*currChild) || (is<RenderBox>(*currChild) && downcast<RenderBox>(*currChild).isWritingModeRoot()))
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> if (curr->isListItem() && inQuirksMode && currChild->node() &&
</span><del>- (currChild->node()->hasTagName(ulTag)|| currChild->node()->hasTagName(olTag)))
</del><ins>+ (is<HTMLUListElement>(*currChild->node()) || is<HTMLOListElement>(*currChild->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<RenderBlock>(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->addChild(m_marker.get(), firstNonMarkerChild(newParent));
</span><span class="cx"> m_marker->updateMarginsAndContent();
</span><span class="cx"> // If current parent is an anonymous block that has lost all its children, destroy it.
</span><del>- if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !toRenderBlock(currentParent)->continuation())
</del><ins>+ if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !downcast<RenderBlock>(*currentParent).continuation())
</ins><span class="cx"> currentParent->destroy();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -406,11 +407,11 @@
</span><span class="cx"> o = o->parentBox();
</span><span class="cx"> if (o->hasOverflowClip())
</span><span class="cx"> propagateVisualOverflow = false;
</span><del>- if (o->isRenderBlock()) {
</del><ins>+ if (is<RenderBlock>(*o)) {
</ins><span class="cx"> if (propagateVisualOverflow)
</span><del>- toRenderBlock(o)->addVisualOverflow(markerRect);
</del><ins>+ downcast<RenderBlock>(*o).addVisualOverflow(markerRect);
</ins><span class="cx"> if (propagateLayoutOverflow)
</span><del>- toRenderBlock(o)->addLayoutOverflow(markerRect);
</del><ins>+ downcast<RenderBlock>(*o).addLayoutOverflow(markerRect);
</ins><span class="cx"> }
</span><span class="cx"> if (o->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& styleToUse = parent()->style();
</span><del>- return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : toRenderBlock(parent())->computeReplacedLogicalHeightUsing(styleToUse.logicalMaxHeight());
</del><ins>+ return styleToUse.logicalMaxHeight().isUndefined() ? RenderFlowThread::maxLogicalHeight() : downcast<RenderBlock>(*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& style = render->style();
</del><ins>+ const RenderStyle& style = renderer->style();
</ins><span class="cx"> if (style.height().type() == Fixed) {
</span><del>- if (render->isRenderBlock()) {
- const RenderBlock* block = toRenderBlock(render);
</del><ins>+ if (is<RenderBlock>(*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 && style.height().value() < block->layoutOverflowRect().maxY())
</del><ins>+ if (style.overflowY() == OVISIBLE
+ && style.height().value() < downcast<RenderBlock>(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)->checkPositionedObjectsNeedLayout();
</del><ins>+ if (is<RenderBlock>(*this))
+ downcast<RenderBlock>(*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 && isRenderScrollbarPart())
- o = toRenderScrollbarPart(this)->rendererOwningScrollbar();
</del><ins>+ auto parent = this->parent();
+ if (!parent && is<RenderScrollbarPart>(*this))
+ parent = downcast<RenderScrollbarPart>(*this).rendererOwningScrollbar();
</ins><span class="cx">
</span><span class="cx"> const RenderStyle& style = this->style();
</span><del>- if (!isText() && style.position() == FixedPosition)
- o = containingBlockForFixedPosition(o);
- else if (!isText() && style.position() == AbsolutePosition)
- o = containingBlockForAbsolutePosition(o);
</del><ins>+ if (!is<RenderText>(*this) && style.position() == FixedPosition)
+ parent = containingBlockForFixedPosition(parent);
+ else if (!is<RenderText>(*this) && 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->isRenderBlock())
- return 0; // This can still happen in case of an orphaned tree
</del><ins>+ if (!is<RenderBlock>(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<RenderBlock>(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()->childrenInline()) {
</span><span class="cx"> if (!isInline())
</span><del>- toRenderBoxModelObject(parent())->childBecameNonInline(this);
</del><ins>+ downcast<RenderBoxModelObject>(*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())->createAnonymousBlock();
</del><ins>+ RenderBlock* block = downcast<RenderBlock>(*parent()).createAnonymousBlock();
</ins><span class="cx"> parent()->insertChildInternal(block, this, RenderElement::NotifyChildren);
</span><span class="cx"> parent()->removeChildInternal(*this, RenderElement::NotifyChildren);
</span><span class="cx"> block->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->canCollapseAnonymousBlockChild())
</del><ins>+ RenderBlock& parentBlock = downcast<RenderBlock>(*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()->firstChild();
- while (curr && ((curr->isAnonymousBlock() && !toRenderBlock(curr)->isAnonymousBlockContinuation()) || curr->style().isFloating() || curr->style().hasOutOfFlowPosition()))
- curr = curr->nextSibling();
</del><ins>+ RenderObject* current = parent()->firstChild();
+ while (current && ((current->isAnonymousBlock() && !downcast<RenderBlock>(*current).isAnonymousBlockContinuation()) || current->style().isFloating() || current->style().hasOutOfFlowPosition()))
+ current = current->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()->firstChild();
- while (curr) {
- RenderObject* next = curr->nextSibling();
- if (curr->isAnonymousBlock())
- parentBlock->collapseAnonymousBoxChild(parentBlock, toRenderBlock(curr));
- curr = next;
</del><ins>+ RenderObject* next;
+ for (current = parent()->firstChild(); current; current = next) {
+ next = current->nextSibling();
+ if (current->isAnonymousBlock())
+ parentBlock.collapseAnonymousBoxChild(parentBlock, downcast<RenderBlock>(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& underline, Color& overline,
</span><span class="cx"> Color& 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 ? &curr->firstLineStyle() : &curr->style();
</del><ins>+ styleToUse = firstlineStyle ? &current->firstLineStyle() : &current->style();
</ins><span class="cx"> currDecs = styleToUse->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->isRubyText())
</del><ins>+ if (current->isRubyText())
</ins><span class="cx"> return;
</span><del>- curr = curr->parent();
- if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuation())
- curr = toRenderBlock(curr)->continuation();
- } while (curr && decorations && (!quirksMode || !curr->node() || (!is<HTMLAnchorElement>(*curr->node()) && !curr->node()->hasTagName(fontTag))));
</del><ins>+ current = current->parent();
+ if (current && current->isAnonymousBlock() && downcast<RenderBlock>(*current).continuation())
+ current = downcast<RenderBlock>(*current).continuation();
+ } while (current && decorations && (!quirksMode || !current->node() || (!is<HTMLAnchorElement>(*current->node()) && !current->node()->hasTagName(fontTag))));
</ins><span class="cx">
</span><span class="cx"> // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
</span><del>- if (decorations && curr) {
- styleToUse = firstlineStyle ? &curr->firstLineStyle() : &curr->style();
</del><ins>+ if (decorations && current) {
+ styleToUse = firstlineStyle ? &current->firstLineStyle() : &current->style();
</ins><span class="cx"> resultColor = decorationColor(styleToUse);
</span><span class="cx"> if (decorations & 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->firstChild();
</span><del>- return isRubyBeforeBlock(child) ? toRenderBlock(child) : 0;
</del><ins>+ return isRubyBeforeBlock(child) ? downcast<RenderBlock>(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->lastChild();
</span><del>- return isRubyAfterBlock(child) ? toRenderBlock(child) : 0;
</del><ins>+ return isRubyAfterBlock(child) ? downcast<RenderBlock>(child) : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static RenderBlock* createAnonymousRubyInlineBlock(RenderObject& 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->lastChild();
</span><span class="cx"> if (lastChild && lastChild->isAnonymousBlock() && lastChild->childrenInline())
</span><del>- toBlock = toRenderBlock(lastChild);
</del><ins>+ toBlock = downcast<RenderBlock>(lastChild);
</ins><span class="cx"> else {
</span><span class="cx"> toBlock = toBase->createAnonymousBlock();
</span><span class="cx"> toBase->insertChildInternal(toBlock, nullptr, NotifyChildren);
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx"> RenderObject* lastChildThere = toBase->lastChild();
</span><span class="cx"> if (firstChildHere->isAnonymousBlock() && firstChildHere->childrenInline()
</span><span class="cx"> && lastChildThere && lastChildThere->isAnonymousBlock() && lastChildThere->childrenInline()) {
</span><del>- RenderBlock* anonBlockHere = toRenderBlock(firstChildHere);
- RenderBlock* anonBlockThere = toRenderBlock(lastChildThere);
</del><ins>+ RenderBlock* anonBlockHere = downcast<RenderBlock>(firstChildHere);
+ RenderBlock* anonBlockThere = downcast<RenderBlock>(lastChildThere);
</ins><span class="cx"> anonBlockHere->moveAllChildrenTo(anonBlockThere, true);
</span><span class="cx"> anonBlockHere->deleteLines();
</span><span class="cx"> anonBlockHere->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& o, const PaintInfo& paintInfo, const IntRect&)
</del><ins>+bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect&)
</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<RenderBlock>(renderer))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><del>- const RenderBlock& renderBlock = *toRenderBlock(&o);
</del><ins>+ const RenderBlock& renderBlock = downcast<RenderBlock>(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(&o);
- while (renderBox != plugInRenderer) {
</del><ins>+ for (auto* renderBox = &downcast<RenderBox>(renderer); renderBox != plugInRenderer; renderBox = renderBox->parentBox()) {
</ins><span class="cx"> if (renderBox->hasLayer() && renderBox->layer() && renderBox->layer()->isComposited()) {
</span><span class="cx"> snapshotAbsPos = -renderBox->location();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- renderBox = renderBox->parentBox();
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutSize pluginSize(plugInRenderer->contentWidth(), plugInRenderer->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->isRenderBlock() ? toRenderBlock(layoutRoot) : layoutRoot->containingBlock();
</del><ins>+ RenderBlock* container = is<RenderBlock>(*layoutRoot) ? downcast<RenderBlock>(layoutRoot) : layoutRoot->containingBlock();
</ins><span class="cx"> while (container && !isAutosizingContainer(container))
</span><span class="cx"> container = container->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->isText()) {
</del><ins>+ if (is<RenderText>(*descendant)) {
</ins><span class="cx"> if (localMultiplier != 1 && descendant->style()->textAutosizingMultiplier() == 1) {
</span><span class="cx"> setMultiplier(descendant, localMultiplier);
</span><span class="cx"> setMultiplier(descendant->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<RenderBlock>(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 && is<RenderText>(*descendant))
</span><span class="cx"> textWidth += downcast<RenderText>(*descendant).renderedTextLength() * descendant->style()->specifiedFontSize();
</span><span class="cx"> else if (isAutosizingContainer(descendant)) {
</span><del>- RenderBlock* descendantBlock = toRenderBlock(descendant);
</del><ins>+ RenderBlock* descendantBlock = downcast<RenderBlock>(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->parent();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (firstNode->isRenderBlock())
- return toRenderBlock(firstNode);
</del><ins>+ if (is<RenderBlock>(*firstNode))
+ return downcast<RenderBlock>(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& depth, TraversalDirection direction)
</span><span class="cx"> {
</span><span class="cx"> if (parent->isEmpty())
</span><del>- return parent->isText() ? parent : 0;
</del><ins>+ return is<RenderText>(*parent) ? parent : nullptr;
</ins><span class="cx">
</span><span class="cx"> ++depth;
</span><span class="cx"> const RenderObject* child = (direction == FirstToLast) ? parent->firstChild() : parent->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<RenderBlock>(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->nextSibling() : child->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->isEmpty())
</span><del>- indexHeight = toRenderBlock(index->firstChild())->logicalHeight();
</del><ins>+ indexHeight = downcast<RenderBlock>(*index->firstChild()).logicalHeight();
</ins><span class="cx"> float indexTopMargin = (1.0 - m_degreeBottomRaisePercent) * radical->stretchSize() + radicalTopMargin - indexHeight;
</span><span class="cx"> if (indexTopMargin < 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for RenderBlock objects
+ https://bugs.webkit.org/show_bug.cgi?id=137512
+
+ Reviewed by Darin Adler.
+
+ Use is<>() / downcast<>() 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 <adachan@apple.com>
</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->style().userSelect() == SELECT_NONE)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- if (renderer->childrenInline() && (renderer->isRenderBlock() && !toRenderBlock(renderer)->inlineElementContinuation()) && !renderer->isTable()) {
</del><ins>+ if (renderer->childrenInline() && (is<RenderBlock>(*renderer) && !downcast<RenderBlock>(*renderer).inlineElementContinuation()) && !renderer->isTable()) {
</ins><span class="cx"> range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionBackward);
</span><span class="cx"> if (range && !range->collapsed(ASSERT_NO_EXCEPTION))
</span><span class="cx"> return range;
</span><span class="lines">@@ -1316,7 +1316,7 @@
</span><span class="cx"> node = node->parentElement();
</span><span class="cx">
</span><span class="cx"> RenderObject* renderer = node->renderer();
</span><del>- if (renderer && renderer->childrenInline() && (renderer->isRenderBlock() && !toRenderBlock(renderer)->inlineElementContinuation()) && !renderer->isTable())
</del><ins>+ if (renderer && renderer->childrenInline() && (is<RenderBlock>(*renderer) && !downcast<RenderBlock>(*renderer).inlineElementContinuation()) && !renderer->isTable())
</ins><span class="cx"> flags = None;
</span><span class="cx">
</span><span class="cx"> return bestRange;
</span></span></pre>
</div>
</div>
</body>
</html>