<!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>[174619] 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/174619">174619</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-10 16:06:32 -0700 (Fri, 10 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use is<>() / downcast<>() for RenderElement
https://bugs.webkit.org/show_bug.cgi?id=137622
Reviewed by Benjamin Poulain.
Use is<>() / downcast<>() for RenderElement and clean up the
surrounding code.
Source/WebCore:
No new tests, no behavior change.
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* dom/Node.cpp:
(WebCore::Node::materializeRareData):
* dom/Position.cpp:
(WebCore::isNonTextLeafChild):
(WebCore::searchAheadForBetterMatch):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::didRecalcStyle):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
* editing/htmlediting.cpp:
(WebCore::isEmptyTableCell):
* rendering/InlineIterator.h:
(WebCore::bidiNextShared):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::layout):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::rendererRemovedFromTree):
(WebCore::RenderCounter::rendererSubtreeAttached):
(showCounterRendererTree):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
(WebCore::RenderElement::removeChildInternal):
(WebCore::RenderElement::findNextLayer):
(WebCore::RenderElement::layout):
* rendering/RenderElement.h:
(WebCore::RenderObject::isRenderLayerModelObject):
(WebCore::RenderObject::isBoxModelObject):
(WebCore::RenderObject::isRenderBlock):
(WebCore::RenderObject::isRenderBlockFlow):
(WebCore::RenderObject::isRenderReplaced):
(WebCore::RenderObject::isRenderInline):
(WebCore::RenderObject::style):
(WebCore::RenderObject::firstLineStyle):
(WebCore::ContainerNode::renderer):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
(WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
(WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::clearNeedsLayout):
(WebCore::RenderObject::willBeDestroyed):
(WebCore::RenderObject::collectAnnotatedRegions):
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::initializeLayoutParameters):
(WebCore::RenderVTTCue::repositionGenericCue):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::addChild):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::addChild):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::rebuildTokenContent):
(WebCore::RenderMathMLOperator::updateStyle):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::addChild):
(WebCore::RenderMathMLRoot::layout):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::addChild):
(WebCore::RenderMathMLToken::updateTokenContent):
(WebCore::RenderMathMLToken::updateStyle):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layout):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
* rendering/svg/RenderSVGText.cpp:
(WebCore::findPreviousAndNextAttributes):
(WebCore::RenderSVGText::subtreeStyleDidChange):
(WebCore::updateFontInAllDescendants):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::layoutChildren):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientWasAddedToTree):
(WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
(WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
(WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
* rendering/svg/SVGTextLayoutAttributesBuilder.h:
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
(WebCore::SVGTextMetricsBuilder::measureTextRenderer):
(WebCore::SVGTextMetricsBuilder::walkTree):
(WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
* rendering/svg/SVGTextMetricsBuilder.h:
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
Source/WebKit/win:
* WebFrame.cpp:
(WebFrame::pauseAnimation):
(WebFrame::pauseTransition):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkcpp">trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPseudoElementcpp">trunk/Source/WebCore/dom/PseudoElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingcpp">trunk/Source/WebCore/editing/htmlediting.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorh">trunk/Source/WebCore/rendering/InlineIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderCountercpp">trunk/Source/WebCore/rendering/RenderCounter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFrameSetcpp">trunk/Source/WebCore/rendering/RenderFrameSet.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.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="#trunkSourceWebCorerenderingRenderVTTCuecpp">trunk/Source/WebCore/rendering/RenderVTTCue.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLFractioncpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLMenclosecpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLUnderOvercpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourcecpp">trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGTextcpp">trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderSupportcpp">trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGResourcesCachecpp">trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuilderh">trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextMetricsBuildercpp">trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextMetricsBuilderh">trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGTextRunRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontDatacpp">trunk/Source/WebCore/svg/SVGFontData.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebFramecpp">trunk/Source/WebKit/win/WebFrame.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/ChangeLog        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1,3 +1,117 @@
</span><ins>+2014-10-10 Chris Dumez <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for RenderElement
+ https://bugs.webkit.org/show_bug.cgi?id=137622
+
+ Reviewed by Benjamin Poulain.
+
+ Use is<>() / downcast<>() for RenderElement and clean up the
+ surrounding code.
+
+ No new tests, no behavior change.
+
+ * accessibility/AccessibilityImageMapLink.cpp:
+ (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::computeRenderStyleForProperty):
+ * dom/Node.cpp:
+ (WebCore::Node::materializeRareData):
+ * dom/Position.cpp:
+ (WebCore::isNonTextLeafChild):
+ (WebCore::searchAheadForBetterMatch):
+ * dom/PseudoElement.cpp:
+ (WebCore::PseudoElement::didRecalcStyle):
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
+ * editing/htmlediting.cpp:
+ (WebCore::isEmptyTableCell):
+ * rendering/InlineIterator.h:
+ (WebCore::bidiNextShared):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::getFirstLetter):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::layout):
+ * rendering/RenderCounter.cpp:
+ (WebCore::RenderCounter::rendererRemovedFromTree):
+ (WebCore::RenderCounter::rendererSubtreeAttached):
+ (showCounterRendererTree):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::insertChildInternal):
+ (WebCore::RenderElement::removeChildInternal):
+ (WebCore::RenderElement::findNextLayer):
+ (WebCore::RenderElement::layout):
+ * rendering/RenderElement.h:
+ (WebCore::RenderObject::isRenderLayerModelObject):
+ (WebCore::RenderObject::isBoxModelObject):
+ (WebCore::RenderObject::isRenderBlock):
+ (WebCore::RenderObject::isRenderBlockFlow):
+ (WebCore::RenderObject::isRenderReplaced):
+ (WebCore::RenderObject::isRenderInline):
+ (WebCore::RenderObject::style):
+ (WebCore::RenderObject::firstLineStyle):
+ (WebCore::ContainerNode::renderer):
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::paint):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects):
+ * rendering/RenderNamedFlowFragment.cpp:
+ (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
+ (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
+ (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::clearNeedsLayout):
+ (WebCore::RenderObject::willBeDestroyed):
+ (WebCore::RenderObject::collectAnnotatedRegions):
+ * rendering/RenderVTTCue.cpp:
+ (WebCore::RenderVTTCue::initializeLayoutParameters):
+ (WebCore::RenderVTTCue::repositionGenericCue):
+ * rendering/mathml/RenderMathMLFraction.cpp:
+ (WebCore::RenderMathMLFraction::addChild):
+ * rendering/mathml/RenderMathMLMenclose.cpp:
+ (WebCore::RenderMathMLMenclose::addChild):
+ * rendering/mathml/RenderMathMLOperator.cpp:
+ (WebCore::RenderMathMLOperator::rebuildTokenContent):
+ (WebCore::RenderMathMLOperator::updateStyle):
+ * rendering/mathml/RenderMathMLRoot.cpp:
+ (WebCore::RenderMathMLRoot::addChild):
+ (WebCore::RenderMathMLRoot::layout):
+ * rendering/mathml/RenderMathMLToken.cpp:
+ (WebCore::RenderMathMLToken::addChild):
+ (WebCore::RenderMathMLToken::updateTokenContent):
+ (WebCore::RenderMathMLToken::updateStyle):
+ * rendering/mathml/RenderMathMLUnderOver.cpp:
+ (WebCore::RenderMathMLUnderOver::layout):
+ * rendering/svg/RenderSVGResource.cpp:
+ (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
+ * rendering/svg/RenderSVGText.cpp:
+ (WebCore::findPreviousAndNextAttributes):
+ (WebCore::RenderSVGText::subtreeStyleDidChange):
+ (WebCore::updateFontInAllDescendants):
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::layoutChildren):
+ * rendering/svg/SVGResourcesCache.cpp:
+ (WebCore::SVGResourcesCache::clientWasAddedToTree):
+ (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
+ * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
+ (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
+ (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
+ (WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
+ * rendering/svg/SVGTextLayoutAttributesBuilder.h:
+ * rendering/svg/SVGTextMetricsBuilder.cpp:
+ (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
+ (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
+ (WebCore::SVGTextMetricsBuilder::walkTree):
+ (WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
+ * rendering/svg/SVGTextMetricsBuilder.h:
+ * rendering/svg/SVGTextRunRenderingContext.cpp:
+ (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
+ (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
+ (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
+ * svg/SVGFontData.cpp:
+ (WebCore::SVGFontData::applySVGGlyphSelection):
+
</ins><span class="cx"> 2014-10-10 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> Update :nth-child(An+B of selector-list) to the latest specification
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">
</span><span class="cx"> RenderElement* renderer = nullptr;
</span><span class="cx"> if (m_parent && m_parent->isAccessibilityRenderObject())
</span><del>- renderer = toRenderElement(toAccessibilityRenderObject(m_parent)->renderer());
</del><ins>+ renderer = downcast<RenderElement>(toAccessibilityRenderObject(m_parent)->renderer());
</ins><span class="cx"> else
</span><span class="cx"> renderer = m_mapElement->renderer();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1318,7 +1318,7 @@
</span><span class="cx">
</span><span class="cx"> // check whether rendered image was stretched from one-dimensional file image
</span><span class="cx"> if (image.cachedImage()) {
</span><del>- LayoutSize imageSize = image.cachedImage()->imageSizeForRenderer(toRenderElement(m_renderer), image.view().zoomFactor());
</del><ins>+ LayoutSize imageSize = image.cachedImage()->imageSizeForRenderer(&image, image.view().zoomFactor());
</ins><span class="cx"> return imageSize.height() <= 1 || imageSize.width() <= 1;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1664,7 +1664,7 @@
</span><span class="cx">
</span><span class="cx"> if (renderer && renderer->isComposited() && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
</span><span class="cx"> AnimationUpdateBlock animationUpdateBlock(&renderer->animation());
</span><del>- RefPtr<RenderStyle> style = renderer->animation().getAnimatedStyleForRenderer(toRenderElement(renderer));
</del><ins>+ RefPtr<RenderStyle> style = renderer->animation().getAnimatedStyleForRenderer(downcast<RenderElement>(renderer));
</ins><span class="cx"> if (pseudoElementSpecifier && !styledNode->isPseudoElement()) {
</span><span class="cx"> // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
</span><span class="cx"> return style->getCachedPseudoStyle(pseudoElementSpecifier);
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -349,8 +349,8 @@
</span><span class="cx"> void Node::materializeRareData()
</span><span class="cx"> {
</span><span class="cx"> NodeRareData* data;
</span><del>- if (isElementNode())
- data = std::make_unique<ElementRareData>(toRenderElement(m_data.m_renderer)).release();
</del><ins>+ if (is<Element>(*this))
+ data = std::make_unique<ElementRareData>(downcast<RenderElement>(m_data.m_renderer)).release();
</ins><span class="cx"> else
</span><span class="cx"> data = std::make_unique<NodeRareData>(m_data.m_renderer).release();
</span><span class="cx"> ASSERT(data);
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/dom/Position.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1095,13 +1095,11 @@
</span><span class="cx"> getInlineBoxAndOffset(affinity, primaryDirection(), inlineBox, caretOffset);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isNonTextLeafChild(RenderObject* object)
</del><ins>+static bool isNonTextLeafChild(RenderObject& object)
</ins><span class="cx"> {
</span><del>- if (object->isText())
</del><ins>+ if (is<RenderText>(object))
</ins><span class="cx"> return false;
</span><del>- if (toRenderElement(object)->firstChild())
- return false;
- return true;
</del><ins>+ return !downcast<RenderElement>(object).firstChild();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static InlineTextBox* searchAheadForBetterMatch(RenderObject* renderer)
</span><span class="lines">@@ -1113,7 +1111,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (next->isBR())
</span><span class="cx"> return nullptr;
</span><del>- if (isNonTextLeafChild(next))
</del><ins>+ if (isNonTextLeafChild(*next))
</ins><span class="cx"> return nullptr;
</span><span class="cx"> if (is<RenderText>(*next)) {
</span><span class="cx"> InlineTextBox* match = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPseudoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PseudoElement.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PseudoElement.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/dom/PseudoElement.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -107,13 +107,13 @@
</span><span class="cx">
</span><span class="cx"> // The renderers inside pseudo elements are anonymous so they don't get notified of recalcStyle and must have
</span><span class="cx"> // the style propagated downward manually similar to RenderObject::propagateStyleToAnonymousChildren.
</span><del>- RenderObject* renderer = this->renderer();
- for (RenderObject* child = renderer->nextInPreOrder(renderer); child; child = child->nextInPreOrder(renderer)) {
</del><ins>+ RenderElement& renderer = *this->renderer();
+ for (RenderObject* child = renderer.nextInPreOrder(&renderer); child; child = child->nextInPreOrder(&renderer)) {
</ins><span class="cx"> // We only manage the style for the generated content which must be images or text.
</span><del>- if (!child->isRenderImage() && !child->isQuote())
</del><ins>+ if (!is<RenderImage>(*child) && !is<RenderQuote>(*child))
</ins><span class="cx"> continue;
</span><del>- PassRef<RenderStyle> createdStyle = RenderStyle::createStyleInheritingFromPseudoStyle(renderer->style());
- toRenderElement(*child).setStyle(WTF::move(createdStyle));
</del><ins>+ PassRef<RenderStyle> createdStyle = RenderStyle::createStyleInheritingFromPseudoStyle(renderer.style());
+ downcast<RenderElement>(*child).setStyle(WTF::move(createdStyle));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -973,7 +973,7 @@
</span><span class="cx"> PassRefPtr<Node> CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary(const Position& pos)
</span><span class="cx"> {
</span><span class="cx"> if (pos.isNull())
</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="lines">@@ -991,7 +991,7 @@
</span><span class="cx"> // If there are no VisiblePositions in the same block as pos then
</span><span class="cx"> // upstreamStart will be outside the paragraph
</span><span class="cx"> if (comparePositions(pos, upstreamStart) < 0)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> // Perform some checks to see if we need to perform work in this function.
</span><span class="cx"> if (isBlock(upstreamStart.deprecatedNode())) {
</span><span class="lines">@@ -1000,22 +1000,22 @@
</span><span class="cx"> if (upstreamStart.deprecatedNode() == editableRootForPosition(upstreamStart)) {
</span><span class="cx"> // If the block is the root editable element and it contains no visible content, create a new
</span><span class="cx"> // block but don't try and move content into it, since there's nothing for moveParagraphs to move.
</span><del>- if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(toRenderElement(*upstreamStart.deprecatedNode()->renderer())))
</del><ins>+ if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(downcast<RenderElement>(*upstreamStart.deprecatedNode()->renderer())))
</ins><span class="cx"> return insertNewDefaultParagraphElementAt(upstreamStart);
</span><span class="cx"> } else if (isBlock(upstreamEnd.deprecatedNode())) {
</span><span class="cx"> if (!upstreamEnd.deprecatedNode()->isDescendantOf(upstreamStart.deprecatedNode())) {
</span><span class="cx"> // If the paragraph end is a descendant of paragraph start, then we need to run
</span><span class="cx"> // the rest of this function. If not, we can bail here.
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> } else if (enclosingBlock(upstreamEnd.deprecatedNode()) != upstreamStart.deprecatedNode()) {
</span><span class="cx"> // The visibleEnd. It must be an ancestor of the paragraph start.
</span><span class="cx"> // We can bail as we have a full block to work with.
</span><span class="cx"> ASSERT(upstreamStart.deprecatedNode()->isDescendantOf(enclosingBlock(upstreamEnd.deprecatedNode())));
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> } else if (isEndOfEditableOrNonEditableContent(visibleEnd)) {
</span><span class="cx"> // At the end of the editable region. We can bail here as well.
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/htmlediting.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/editing/htmlediting.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include "PositionIterator.h"
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderElement.h"
</span><ins>+#include "RenderTableCell.h"
</ins><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextIterator.h"
</span><span class="lines">@@ -849,11 +850,11 @@
</span><span class="cx"> if (!renderer)
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><del>- if (!renderer->isTableCell())
</del><ins>+ if (!is<RenderTableCell>(*renderer))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // Check that the table cell contains no child renderers except for perhaps a single <br>.
</span><del>- RenderObject* childRenderer = toRenderElement(renderer)->firstChild();
</del><ins>+ RenderObject* childRenderer = downcast<RenderTableCell>(*renderer).firstChild();
</ins><span class="cx"> if (!childRenderer)
</span><span class="cx"> return true;
</span><span class="cx"> if (!childRenderer->isBR())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineIterator.h (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.h        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/InlineIterator.h        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -214,22 +214,22 @@
</span><span class="cx"> template <class Observer>
</span><span class="cx"> static inline RenderObject* bidiNextShared(RenderElement& root, RenderObject* current, Observer* observer = 0, EmptyInlineBehavior emptyInlineBehavior = SkipEmptyInlines, bool* endOfInlinePtr = 0)
</span><span class="cx"> {
</span><del>- RenderObject* next = 0;
</del><ins>+ RenderObject* next = nullptr;
</ins><span class="cx"> // oldEndOfInline denotes if when we last stopped iterating if we were at the end of an inline.
</span><span class="cx"> bool oldEndOfInline = endOfInlinePtr ? *endOfInlinePtr : false;
</span><span class="cx"> bool endOfInline = false;
</span><span class="cx">
</span><span class="cx"> while (current) {
</span><del>- next = 0;
</del><ins>+ next = nullptr;
</ins><span class="cx"> if (!oldEndOfInline && !isIteratorTarget(current)) {
</span><del>- next = toRenderElement(current)->firstChild();
</del><ins>+ next = downcast<RenderElement>(*current).firstChild();
</ins><span class="cx"> notifyObserverEnteredObject(observer, next);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // We hit this when either current has no children, or when current is not a renderer we care about.
</span><span class="cx"> if (!next) {
</span><span class="cx"> // If it is a renderer we care about, and we're doing our inline-walk, return it.
</span><del>- if (emptyInlineBehavior == IncludeEmptyInlines && !oldEndOfInline && current->isRenderInline()) {
</del><ins>+ if (emptyInlineBehavior == IncludeEmptyInlines && !oldEndOfInline && is<RenderInline>(*current)) {
</ins><span class="cx"> next = current;
</span><span class="cx"> endOfInline = true;
</span><span class="cx"> break;
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> current = current->parent();
</span><del>- if (emptyInlineBehavior == IncludeEmptyInlines && current && current != &root && current->isRenderInline()) {
</del><ins>+ if (emptyInlineBehavior == IncludeEmptyInlines && current && current != &root && is<RenderInline>(*current)) {
</ins><span class="cx"> next = current;
</span><span class="cx"> endOfInline = true;
</span><span class="cx"> break;
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> if (isIteratorTarget(next)
</span><del>- || (next->isRenderInline() && (emptyInlineBehavior == IncludeEmptyInlines || isEmptyInline(toRenderInline(*next)))))
</del><ins>+ || (is<RenderInline>(*next) && (emptyInlineBehavior == IncludeEmptyInlines || isEmptyInline(downcast<RenderInline>(*next)))))
</ins><span class="cx"> break;
</span><span class="cx"> current = next;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -47,12 +47,15 @@
</span><span class="cx"> #include "PaintInfo.h"
</span><span class="cx"> #include "RenderBlockFlow.h"
</span><span class="cx"> #include "RenderBoxRegionInfo.h"
</span><ins>+#include "RenderButton.h"
</ins><span class="cx"> #include "RenderCombineText.h"
</span><span class="cx"> #include "RenderDeprecatedFlexibleBox.h"
</span><span class="cx"> #include "RenderFlexibleBox.h"
</span><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><ins>+#include "RenderListMarker.h"
+#include "RenderMenuList.h"
</ins><span class="cx"> #include "RenderNamedFlowFragment.h"
</span><span class="cx"> #include "RenderNamedFlowThread.h"
</span><span class="cx"> #include "RenderRegion.h"
</span><span class="lines">@@ -3191,7 +3194,7 @@
</span><span class="cx"> // Drill into inlines looking for our first text descendant.
</span><span class="cx"> firstLetter = firstLetterContainer->firstChild();
</span><span class="cx"> while (firstLetter) {
</span><del>- if (firstLetter->isText()) {
</del><ins>+ if (is<RenderText>(*firstLetter)) {
</ins><span class="cx"> if (firstLetter == skipObject) {
</span><span class="cx"> firstLetter = firstLetter->nextSibling();
</span><span class="cx"> continue;
</span><span class="lines">@@ -3200,8 +3203,8 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RenderElement& current = toRenderElement(*firstLetter);
- if (current.isListMarker())
</del><ins>+ RenderElement& current = downcast<RenderElement>(*firstLetter);
+ if (is<RenderListMarker>(current))
</ins><span class="cx"> firstLetter = current.nextSibling();
</span><span class="cx"> else if (current.isFloatingOrOutOfFlowPositioned()) {
</span><span class="cx"> if (current.style().styleType() == FIRST_LETTER) {
</span><span class="lines">@@ -3209,7 +3212,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> firstLetter = current.nextSibling();
</span><del>- } else if (current.isReplaced() || current.isRenderButton() || current.isMenuList())
</del><ins>+ } else if (current.isReplaced() || is<RenderButton>(current) || is<RenderMenuList>(current))
</ins><span class="cx"> break;
</span><span class="cx"> else if (current.style().hasPseudoStyle(FIRST_LETTER) && current.canHaveGeneratedChildren()) {
</span><span class="cx"> // We found a lower-level node with first-letter, which supersedes the higher-level style
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -501,7 +501,7 @@
</span><span class="cx"> LayoutStateMaintainer statePusher(view(), *this, locationOffset(), style().isFlippedBlocksWritingMode());
</span><span class="cx"> while (child) {
</span><span class="cx"> if (child->needsLayout())
</span><del>- toRenderElement(child)->layout();
</del><ins>+ downcast<RenderElement>(*child).layout();
</ins><span class="cx"> ASSERT(!child->needsLayout());
</span><span class="cx"> child = child->nextSibling();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderCountercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderCounter.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderCounter.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderCounter.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -496,8 +496,8 @@
</span><span class="cx"> if (!currentRenderer)
</span><span class="cx"> currentRenderer = &renderer;
</span><span class="cx"> while (true) {
</span><del>- if (currentRenderer->isRenderElement())
- destroyCounterNodes(toRenderElement(*currentRenderer));
</del><ins>+ if (is<RenderElement>(*currentRenderer))
+ destroyCounterNodes(downcast<RenderElement>(*currentRenderer));
</ins><span class="cx"> if (currentRenderer == &renderer)
</span><span class="cx"> break;
</span><span class="cx"> currentRenderer = currentRenderer->previousInPreOrder();
</span><span class="lines">@@ -551,8 +551,8 @@
</span><span class="cx"> if (element && !element->renderer())
</span><span class="cx"> return; // No need to update if the parent is not attached yet
</span><span class="cx"> for (RenderObject* descendant = &renderer; descendant; descendant = descendant->nextInPreOrder(&renderer)) {
</span><del>- if (descendant->isRenderElement())
- updateCounters(toRenderElement(*descendant));
</del><ins>+ if (is<RenderElement>(*descendant))
+ updateCounters(downcast<RenderElement>(*descendant));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -613,15 +613,15 @@
</span><span class="cx">
</span><span class="cx"> AtomicString identifier(counterName);
</span><span class="cx"> for (const WebCore::RenderObject* current = root; current; current = current->nextInPreOrder()) {
</span><del>- if (!current->isRenderElement())
</del><ins>+ if (!is<WebCore::RenderElement>(*current))
</ins><span class="cx"> continue;
</span><span class="cx"> fprintf(stderr, "%c", (current == renderer) ? '*' : ' ');
</span><span class="cx"> for (const WebCore::RenderObject* parent = current; parent && parent != root; parent = parent->parent())
</span><span class="cx"> fprintf(stderr, " ");
</span><span class="cx"> fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n",
</span><span class="cx"> current, current->node(), current->parent(), current->previousSibling(),
</span><del>- current->nextSibling(), toRenderElement(current)->hasCounterNodeMap() ?
- counterName ? WebCore::counterMaps().get(toRenderElement(current))->get(identifier) : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0);
</del><ins>+ current->nextSibling(), downcast<WebCore::RenderElement>(*current).hasCounterNodeMap() ?
+ counterName ? WebCore::counterMaps().get(downcast<WebCore::RenderElement>(current))->get(identifier) : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0);
</ins><span class="cx"> }
</span><span class="cx"> fflush(stderr);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -569,8 +569,8 @@
</span><span class="cx"> if (!documentBeingDestroyed()) {
</span><span class="cx"> if (notifyChildren == NotifyChildren)
</span><span class="cx"> newChild->insertedIntoTree();
</span><del>- if (newChild->isRenderElement())
- RenderCounter::rendererSubtreeAttached(toRenderElement(*newChild));
</del><ins>+ if (is<RenderElement>(*newChild))
+ RenderCounter::rendererSubtreeAttached(downcast<RenderElement>(*newChild));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> newChild->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="lines">@@ -638,8 +638,8 @@
</span><span class="cx">
</span><span class="cx"> // rendererRemovedFromTree walks the whole subtree. We can improve performance
</span><span class="cx"> // by skipping this step when destroying the entire tree.
</span><del>- if (!documentBeingDestroyed() && oldChild.isRenderElement())
- RenderCounter::rendererRemovedFromTree(toRenderElement(oldChild));
</del><ins>+ if (!documentBeingDestroyed() && is<RenderElement>(oldChild))
+ RenderCounter::rendererRemovedFromTree(downcast<RenderElement>(oldChild));
</ins><span class="cx">
</span><span class="cx"> if (AXObjectCache* cache = document().existingAXObjectCache())
</span><span class="cx"> cache->childrenChanged(this);
</span><span class="lines">@@ -714,7 +714,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // Step 1: If our layer is a child of the desired parent, then return our layer.
</span><del>- RenderLayer* ourLayer = hasLayer() ? toRenderLayerModelObject(this)->layer() : nullptr;
</del><ins>+ RenderLayer* ourLayer = hasLayer() ? downcast<RenderLayerModelObject>(*this).layer() : nullptr;
</ins><span class="cx"> if (ourLayer && ourLayer->parent() == parentLayer)
</span><span class="cx"> return ourLayer;
</span><span class="cx">
</span><span class="lines">@@ -722,9 +722,9 @@
</span><span class="cx"> // into our siblings trying to find the next layer whose parent is the desired parent.
</span><span class="cx"> if (!ourLayer || ourLayer == parentLayer) {
</span><span class="cx"> for (RenderObject* child = startPoint ? startPoint->nextSibling() : firstChild(); child; child = child->nextSibling()) {
</span><del>- if (!child->isRenderElement())
</del><ins>+ if (!is<RenderElement>(*child))
</ins><span class="cx"> continue;
</span><del>- RenderLayer* nextLayer = toRenderElement(child)->findNextLayer(parentLayer, nullptr, false);
</del><ins>+ RenderLayer* nextLayer = downcast<RenderElement>(*child).findNextLayer(parentLayer, nullptr, false);
</ins><span class="cx"> if (nextLayer)
</span><span class="cx"> return nextLayer;
</span><span class="cx"> }
</span><span class="lines">@@ -1109,7 +1109,7 @@
</span><span class="cx"> RenderObject* child = firstChild();
</span><span class="cx"> while (child) {
</span><span class="cx"> if (child->needsLayout())
</span><del>- toRenderElement(child)->layout();
</del><ins>+ downcast<RenderElement>(*child).layout();
</ins><span class="cx"> ASSERT(!child->needsLayout());
</span><span class="cx"> child = child->nextSibling();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -245,8 +245,6 @@
</span><span class="cx"> static bool s_noLongerAffectsParentBlock;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderElement, isRenderElement())
-
</del><span class="cx"> inline void RenderElement::setAnimatableStyle(PassRef<RenderStyle> style)
</span><span class="cx"> {
</span><span class="cx"> setStyle(animation().updateAnimations(*this, WTF::move(style)));
</span><span class="lines">@@ -323,51 +321,51 @@
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isRenderLayerModelObject() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isRenderLayerModelObject();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isRenderLayerModelObject();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isBoxModelObject() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isBoxModelObject();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isBoxModelObject();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isRenderBlock() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isRenderBlock();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isRenderBlock();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isRenderBlockFlow() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isRenderBlockFlow();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isRenderBlockFlow();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isRenderReplaced() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isRenderReplaced();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isRenderReplaced();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool RenderObject::isRenderInline() const
</span><span class="cx"> {
</span><del>- return isRenderElement() && toRenderElement(this)->isRenderInline();
</del><ins>+ return is<RenderElement>(*this) && downcast<RenderElement>(*this).isRenderInline();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline RenderStyle& RenderObject::style() const
</span><span class="cx"> {
</span><span class="cx"> if (isText())
</span><span class="cx"> return m_parent->style();
</span><del>- return toRenderElement(this)->style();
</del><ins>+ return downcast<RenderElement>(*this).style();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline RenderStyle& RenderObject::firstLineStyle() const
</span><span class="cx"> {
</span><span class="cx"> if (isText())
</span><span class="cx"> return m_parent->firstLineStyle();
</span><del>- return toRenderElement(this)->firstLineStyle();
</del><ins>+ return downcast<RenderElement>(*this).firstLineStyle();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline RenderElement* ContainerNode::renderer() const
</span><span class="cx"> {
</span><del>- return toRenderElement(Node::renderer());
</del><ins>+ return downcast<RenderElement>(Node::renderer());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline int adjustForAbsoluteZoom(int value, const RenderElement& renderer)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFrameSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> for (size_t r = 0; r < rows; r++) {
</span><span class="cx"> LayoutUnit xPos = 0;
</span><span class="cx"> for (size_t c = 0; c < cols; c++) {
</span><del>- toRenderElement(child)->paint(paintInfo, adjustedPaintOffset);
</del><ins>+ downcast<RenderElement>(*child).paint(paintInfo, adjustedPaintOffset);
</ins><span class="cx"> xPos += m_cols.m_sizes[c];
</span><span class="cx"> if (borderThickness && m_cols.m_allowBorder[c + 1]) {
</span><span class="cx"> paintColumnBorder(paintInfo, snappedIntRect(LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffset.y() + yPos, borderThickness, height())));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -6297,13 +6297,13 @@
</span><span class="cx">
</span><span class="cx"> const RenderElement& renderElementChild = downcast<RenderElement>(child);
</span><span class="cx">
</span><del>- if (renderElementChild.isRenderLayerModelObject() && toRenderLayerModelObject(renderElementChild).hasSelfPaintingLayer())
</del><ins>+ if (is<RenderLayerModelObject>(renderElementChild) && downcast<RenderLayerModelObject>(renderElementChild).hasSelfPaintingLayer())
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> if (hasBoxDecorationsOrBackground(renderElementChild))
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (renderElementChild.isRenderReplaced())
</del><ins>+ if (is<RenderReplaced>(renderElementChild))
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> if (hasPaintingNonLayerDescendants(renderElementChild, depth + 1))
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderNamedFlowFragmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "RenderFlowThread.h"
</span><span class="cx"> #include "RenderIterator.h"
</span><span class="cx"> #include "RenderNamedFlowThread.h"
</span><ins>+#include "RenderTableCell.h"
</ins><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx">
</span><span class="lines">@@ -371,16 +372,16 @@
</span><span class="cx"> } else {
</span><span class="cx"> if (child.isAnonymous() || child.isInFlowRenderFlowThread())
</span><span class="cx"> childStyleInRegion = RenderStyle::createAnonymousStyleWithDisplay(&renderer.style(), child.style().display());
</span><del>- else if (child.isText())
</del><ins>+ else if (is<RenderText>(child))
</ins><span class="cx"> childStyleInRegion = RenderStyle::clone(&renderer.style());
</span><span class="cx"> else
</span><del>- childStyleInRegion = computeStyleInRegion(toRenderElement(child), renderer.style());
</del><ins>+ childStyleInRegion = computeStyleInRegion(downcast<RenderElement>(child), renderer.style());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> setObjectStyleInRegion(&child, childStyleInRegion, objectRegionStyleCached);
</span><span class="cx">
</span><del>- if (child.isRenderElement())
- computeChildrenStyleInRegion(toRenderElement(child));
</del><ins>+ if (is<RenderElement>(child))
+ computeChildrenStyleInRegion(downcast<RenderElement>(child));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -389,11 +390,11 @@
</span><span class="cx"> ASSERT(object->flowThreadContainingBlock());
</span><span class="cx">
</span><span class="cx"> RefPtr<RenderStyle> objectOriginalStyle = &object->style();
</span><del>- if (object->isRenderElement())
- toRenderElement(object)->setStyleInternal(*styleInRegion);
</del><ins>+ if (is<RenderElement>(*object))
+ downcast<RenderElement>(*object).setStyleInternal(*styleInRegion);
</ins><span class="cx">
</span><del>- if (object->isBoxModelObject() && !object->hasBoxDecorations()) {
- bool hasBoxDecorations = object->isTableCell()
</del><ins>+ if (is<RenderBoxModelObject>(*object) && !object->hasBoxDecorations()) {
+ bool hasBoxDecorations = is<RenderTableCell>(*object)
</ins><span class="cx"> || object->style().hasBackground()
</span><span class="cx"> || object->style().hasBorder()
</span><span class="cx"> || object->style().hasAppearance()
</span><span class="lines">@@ -465,8 +466,8 @@
</span><span class="cx"> RenderObject* object = const_cast<RenderObject*>(objectPair.key);
</span><span class="cx"> RefPtr<RenderStyle> objectRegionStyle = &object->style();
</span><span class="cx"> RefPtr<RenderStyle> objectOriginalStyle = objectPair.value.style;
</span><del>- if (object->isRenderElement())
- toRenderElement(object)->setStyleInternal(*objectOriginalStyle);
</del><ins>+ if (is<RenderElement>(*object))
+ downcast<RenderElement>(*object).setStyleInternal(*objectOriginalStyle);
</ins><span class="cx">
</span><span class="cx"> bool shouldCacheRegionStyle = objectPair.value.cached;
</span><span class="cx"> if (!shouldCacheRegionStyle) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -592,8 +592,8 @@
</span><span class="cx"> setNeedsSimplifiedNormalFlowLayoutBit(false);
</span><span class="cx"> setNormalChildNeedsLayoutBit(false);
</span><span class="cx"> setNeedsPositionedMovementLayoutBit(false);
</span><del>- if (isRenderElement())
- toRenderElement(this)->setAncestorLineBoxDirty(false);
</del><ins>+ if (is<RenderElement>(*this))
+ downcast<RenderElement>(*this).setAncestorLineBoxDirty(false);
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> checkBlockPositionedObjectsNeedLayout();
</span><span class="cx"> #endif
</span><span class="lines">@@ -2025,7 +2025,7 @@
</span><span class="cx">
</span><span class="cx"> removeFromParent();
</span><span class="cx">
</span><del>- ASSERT(documentBeingDestroyed() || !isRenderElement() || !view().frameView().hasSlowRepaintObject(toRenderElement(this)));
</del><ins>+ ASSERT(documentBeingDestroyed() || !is<RenderElement>(*this) || !view().frameView().hasSlowRepaintObject(downcast<RenderElement>(this)));
</ins><span class="cx">
</span><span class="cx"> // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render
</span><span class="cx"> // object for this renderer. So we remove the AX render object now, after the renderer is removed.
</span><span class="lines">@@ -2356,12 +2356,12 @@
</span><span class="cx"> {
</span><span class="cx"> // RenderTexts don't have their own style, they just use their parent's style,
</span><span class="cx"> // so we don't want to include them.
</span><del>- if (isText())
</del><ins>+ if (is<RenderText>(*this))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> addAnnotatedRegions(regions);
</span><del>- for (RenderObject* curr = toRenderElement(this)->firstChild(); curr; curr = curr->nextSibling())
- curr->collectAnnotatedRegions(regions);
</del><ins>+ for (RenderObject* current = downcast<RenderElement>(*this).firstChild(); current; current = current->nextSibling())
+ current->collectAnnotatedRegions(regions);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderVTTCue.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderVTTCue.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/RenderVTTCue.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -77,10 +77,10 @@
</span><span class="cx">
</span><span class="cx"> // firstChild() returns the wrapping (backdrop) <div>. The cue object is
</span><span class="cx"> // the <div>'s first child.
</span><del>- RenderObject* firstChild = this->firstChild();
- RenderElement* backdropElement = toRenderElement(firstChild);
</del><ins>+ RenderObject& firstChild = *this->firstChild();
+ RenderElement& backdropElement = downcast<RenderElement>(firstChild);
</ins><span class="cx">
</span><del>- firstLineBox = toRenderInline(backdropElement->firstChild())->firstLineBox();
</del><ins>+ firstLineBox = downcast<RenderInline>(*backdropElement.firstChild()).firstLineBox();
</ins><span class="cx"> if (!firstLineBox)
</span><span class="cx"> firstLineBox = this->firstRootBox();
</span><span class="cx">
</span><span class="lines">@@ -343,10 +343,10 @@
</span><span class="cx">
</span><span class="cx"> // firstChild() returns the wrapping (backdrop) <div>. The cue object is
</span><span class="cx"> // the <div>'s first child.
</span><del>- RenderObject* firstChild = this->firstChild();
- RenderElement* backdropElement = toRenderElement(firstChild);
</del><ins>+ RenderObject& firstChild = *this->firstChild();
+ RenderElement& backdropElement = downcast<RenderElement>(firstChild);
</ins><span class="cx">
</span><del>- InlineFlowBox* firstLineBox = toRenderInline(backdropElement->firstChild())->firstLineBox();
</del><ins>+ InlineFlowBox* firstLineBox = downcast<RenderInline>(*backdropElement.firstChild()).firstLineBox();
</ins><span class="cx"> if (static_cast<TextTrackCueGeneric*>(m_cue)->useDefaultPosition() && firstLineBox) {
</span><span class="cx"> LayoutUnit parentWidth = containingBlock()->logicalWidth();
</span><span class="cx"> LayoutUnit width = firstLineBox->width();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLFractioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -100,9 +100,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (firstChild()->isEmpty())
</span><del>- toRenderElement(firstChild())->addChild(child);
</del><ins>+ downcast<RenderElement>(*firstChild()).addChild(child);
</ins><span class="cx"> else
</span><del>- toRenderElement(lastChild())->addChild(child);
</del><ins>+ downcast<RenderElement>(*lastChild()).addChild(child);
</ins><span class="cx">
</span><span class="cx"> updateFromElement();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLMenclosecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">
</span><span class="cx"> if (newChild) {
</span><span class="cx"> if (firstChild() && menclose->isRadical())
</span><del>- toRenderElement(firstChild())->addChild(newChild, beforeChild && beforeChild->parent() == firstChild() ? beforeChild : nullptr);
</del><ins>+ downcast<RenderElement>(*firstChild()).addChild(newChild, beforeChild && beforeChild->parent() == firstChild() ? beforeChild : nullptr);
</ins><span class="cx"> else
</span><span class="cx"> RenderMathMLBlock::addChild(newChild, beforeChild);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1379,10 +1379,10 @@
</span><span class="cx"> // We destroy the wrapper and rebuild it.
</span><span class="cx"> // FIXME: Using this RenderText make the text inaccessible to the dumpAsText/selection code (https://bugs.webkit.org/show_bug.cgi?id=125597).
</span><span class="cx"> if (firstChild())
</span><del>- toRenderElement(firstChild())->destroy();
</del><ins>+ downcast<RenderElement>(*firstChild()).destroy();
</ins><span class="cx"> createWrapperIfNeeded();
</span><span class="cx"> RenderPtr<RenderText> text = createRenderer<RenderText>(document(), textContent);
</span><del>- toRenderElement(firstChild())->addChild(text.leakPtr());
</del><ins>+ downcast<RenderElement>(*firstChild()).addChild(text.leakPtr());
</ins><span class="cx">
</span><span class="cx"> // We verify whether the operator text can be represented by a single UChar.
</span><span class="cx"> // FIXME: This does not handle surrogate pairs (https://bugs.webkit.org/show_bug.cgi?id=122296).
</span><span class="lines">@@ -1654,7 +1654,7 @@
</span><span class="cx"> // We add spacing around the operator.
</span><span class="cx"> // FIXME: The spacing should be added to the whole embellished operator (https://bugs.webkit.org/show_bug.cgi?id=124831).
</span><span class="cx"> // FIXME: The spacing should only be added inside (perhaps inferred) mrow (http://www.w3.org/TR/MathML/chapter3.html#presm.opspacing).
</span><del>- const auto& wrapper = toRenderElement(firstChild());
</del><ins>+ const auto& wrapper = downcast<RenderElement>(firstChild());
</ins><span class="cx"> auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX);
</span><span class="cx"> newStyle.get().setMarginStart(Length(m_leadingSpace, Fixed));
</span><span class="cx"> newStyle.get().setMarginEnd(Length(m_trailingSpace, Fixed));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -158,18 +158,18 @@
</span><span class="cx"> auto index = indexWrapper();
</span><span class="cx"> RenderElement* actualParent;
</span><span class="cx"> RenderElement* actualBeforeChild;
</span><del>- if (isRenderMathMLSquareRoot()) {
</del><ins>+ if (is<RenderMathMLSquareRoot>(*this)) {
</ins><span class="cx"> // For square root, we always insert the child into the base wrapper.
</span><span class="cx"> actualParent = base;
</span><span class="cx"> if (beforeChild && beforeChild->parent() == base)
</span><del>- actualBeforeChild = toRenderElement(beforeChild);
</del><ins>+ actualBeforeChild = downcast<RenderElement>(beforeChild);
</ins><span class="cx"> else
</span><span class="cx"> actualBeforeChild = nullptr;
</span><span class="cx"> } else {
</span><span class="cx"> // For mroot, we insert the child into the parent of beforeChild, or at the end of the index. The wrapper structure is reorganize below.
</span><span class="cx"> actualParent = beforeChild ? beforeChild->parent() : nullptr;
</span><span class="cx"> if (actualParent == base || actualParent == index)
</span><del>- actualBeforeChild = toRenderElement(beforeChild);
</del><ins>+ actualBeforeChild = downcast<RenderElement>(beforeChild);
</ins><span class="cx"> else {
</span><span class="cx"> actualParent = index;
</span><span class="cx"> actualBeforeChild = nullptr;
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> // We layout the children.
</span><span class="cx"> for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
</span><span class="cx"> if (child->needsLayout())
</span><del>- toRenderElement(child)->layout();
</del><ins>+ downcast<RenderElement>(*child).layout();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> auto radical = radicalOperator();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> void RenderMathMLToken::addChild(RenderObject* newChild, RenderObject* beforeChild)
</span><span class="cx"> {
</span><span class="cx"> createWrapperIfNeeded();
</span><del>- toRenderElement(firstChild())->addChild(newChild, beforeChild);
</del><ins>+ downcast<RenderElement>(*firstChild()).addChild(newChild, beforeChild);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderMathMLToken::createWrapperIfNeeded()
</span><span class="lines">@@ -69,8 +69,8 @@
</span><span class="cx"> // The renderers corresponding to the children of the token element are wrapped inside an anonymous RenderMathMLBlock.
</span><span class="cx"> // When one of these renderers is a RenderElement, we handle the RenderMathMLToken differently.
</span><span class="cx"> // For some reason, an additional anonymous RenderBlock is created as a child of the RenderMathMLToken and the renderers are actually inserted into that RenderBlock so we need to dig down one additional level here.
</span><del>- const auto& wrapper = toRenderElement(firstChild());
- if (const auto& block = toRenderElement(wrapper->firstChild()))
</del><ins>+ const auto& wrapper = downcast<RenderElement>(firstChild());
+ if (const auto& block = downcast<RenderElement>(wrapper->firstChild()))
</ins><span class="cx"> m_containsElement = childrenOfType<RenderElement>(*block).first();
</span><span class="cx"> updateStyle();
</span><span class="cx"> }
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> {
</span><span class="cx"> const auto& tokenElement = element();
</span><span class="cx">
</span><del>- const auto& wrapper = toRenderElement(firstChild());
</del><ins>+ const auto& wrapper = downcast<RenderElement>(firstChild());
</ins><span class="cx"> auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), FLEX);
</span><span class="cx">
</span><span class="cx"> if (tokenElement.hasTagName(MathMLNames::miTag)) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLUnderOvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- toRenderElement(child)->layout();
</del><ins>+ downcast<RenderElement>(*child).layout();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Skipping the embellished op does not work for nested structures like
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -185,17 +185,17 @@
</span><span class="cx"> if (needsLayout && !object.documentBeingDestroyed())
</span><span class="cx"> object.setNeedsLayout();
</span><span class="cx">
</span><del>- if (object.isRenderElement())
- removeFromCacheAndInvalidateDependencies(toRenderElement(object), needsLayout);
</del><ins>+ if (is<RenderElement>(object))
+ removeFromCacheAndInvalidateDependencies(downcast<RenderElement>(object), needsLayout);
</ins><span class="cx">
</span><span class="cx"> // Invalidate resources in ancestor chain, if needed.
</span><span class="cx"> auto current = object.parent();
</span><span class="cx"> while (current) {
</span><span class="cx"> removeFromCacheAndInvalidateDependencies(*current, needsLayout);
</span><span class="cx">
</span><del>- if (current->isSVGResourceContainer()) {
</del><ins>+ if (is<RenderSVGResourceContainer>(*current)) {
</ins><span class="cx"> // This will process the rest of the ancestors.
</span><del>- toRenderSVGResourceContainer(*current).removeAllClientsFromCache();
</del><ins>+ downcast<RenderSVGResourceContainer>(*current).removeAllClientsFromCache();
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGText.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "LayoutRepainter.h"
</span><span class="cx"> #include "PointerEventsHitRules.h"
</span><span class="cx"> #include "RenderIterator.h"
</span><ins>+#include "RenderSVGInline.h"
</ins><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderSVGResource.h"
</span><span class="cx"> #include "RenderSVGRoot.h"
</span><span class="lines">@@ -127,15 +128,15 @@
</span><span class="cx"> ASSERT(locateElement);
</span><span class="cx"> // FIXME: Make this iterative.
</span><span class="cx"> for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
</span><del>- if (child->isSVGInlineText()) {
- RenderSVGInlineText* text = toRenderSVGInlineText(child);
- if (locateElement != text) {
</del><ins>+ if (is<RenderSVGInlineText>(*child)) {
+ RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
+ if (locateElement != &text) {
</ins><span class="cx"> if (stopAfterNext) {
</span><del>- next = text->layoutAttributes();
</del><ins>+ next = text.layoutAttributes();
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- previous = text->layoutAttributes();
</del><ins>+ previous = text.layoutAttributes();
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -143,10 +144,10 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!child->isSVGInline())
</del><ins>+ if (!is<RenderSVGInline>(*child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- if (findPreviousAndNextAttributes(toRenderElement(child), locateElement, stopAfterNext, previous, next))
</del><ins>+ if (findPreviousAndNextAttributes(downcast<RenderElement>(child), locateElement, stopAfterNext, previous, next))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -296,8 +297,8 @@
</span><span class="cx"> // nor the layout attributes cached in the leaf #text renderers.
</span><span class="cx"> FontCachePurgePreventer fontCachePurgePreventer;
</span><span class="cx"> for (RenderObject* descendant = text; descendant; descendant = descendant->nextInPreOrder(text)) {
</span><del>- if (descendant->isSVGInlineText())
- m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(toRenderSVGInlineText(descendant));
</del><ins>+ if (is<RenderSVGInlineText>(*descendant))
+ m_layoutAttributesBuilder.rebuildMetricsForTextRenderer(downcast<RenderSVGInlineText>(*descendant));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -338,7 +339,7 @@
</span><span class="cx"> RenderSVGInlineText& text = toRenderSVGInlineText(*descendant);
</span><span class="cx"> text.updateScaledFont();
</span><span class="cx"> if (builder)
</span><del>- builder->rebuildMetricsForTextRenderer(&text);
</del><ins>+ builder->rebuildMetricsForTextRenderer(text);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -246,21 +246,22 @@
</span><span class="cx">
</span><span class="cx"> if (transformChanged) {
</span><span class="cx"> // If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
</span><del>- if (child->isSVGText())
- toRenderSVGText(child)->setNeedsTextMetricsUpdate();
</del><ins>+ if (is<RenderSVGText>(*child))
+ downcast<RenderSVGText>(*child).setNeedsTextMetricsUpdate();
</ins><span class="cx"> needsLayout = true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (layoutSizeChanged) {
</span><span class="cx"> // When selfNeedsLayout is false and the layout size changed, we have to check whether this child uses relative lengths
</span><del>- if (SVGElement* element = child->node()->isSVGElement() ? downcast<SVGElement>(child->node()) : nullptr) {
</del><ins>+ if (SVGElement* element = is<SVGElement>(*child->node()) ? downcast<SVGElement>(child->node()) : nullptr) {
</ins><span class="cx"> if (element->hasRelativeLengths()) {
</span><span class="cx"> // When the layout size changed and when using relative values tell the RenderSVGShape to update its shape object
</span><del>- if (child->isSVGShape())
- toRenderSVGShape(child)->setNeedsShapeUpdate();
- else if (child->isSVGText()) {
- toRenderSVGText(child)->setNeedsTextMetricsUpdate();
- toRenderSVGText(child)->setNeedsPositioningValuesUpdate();
</del><ins>+ if (is<RenderSVGShape>(*child))
+ downcast<RenderSVGShape>(*child).setNeedsShapeUpdate();
+ else if (is<RenderSVGText>(*child)) {
+ RenderSVGText& svgText = downcast<RenderSVGText>(*child);
+ svgText.setNeedsTextMetricsUpdate();
+ svgText.setNeedsPositioningValuesUpdate();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> needsLayout = true;
</span><span class="lines">@@ -272,15 +273,15 @@
</span><span class="cx"> child->setNeedsLayout(MarkOnlyThis);
</span><span class="cx">
</span><span class="cx"> if (child->needsLayout()) {
</span><del>- toRenderElement(child)->layout();
</del><ins>+ downcast<RenderElement>(*child).layout();
</ins><span class="cx"> // Renderers are responsible for repainting themselves when changing, except
</span><span class="cx"> // for the initial paint to avoid potential double-painting caused by non-sensical "old" bounds.
</span><span class="cx"> // We could handle this in the individual objects, but for now it's easier to have
</span><span class="cx"> // parent containers call repaint(). (RenderBlock::layout* has similar logic.)
</span><span class="cx"> if (!childEverHadLayout)
</span><span class="cx"> child->repaint();
</span><del>- } else if (layoutSizeChanged && child->isRenderElement())
- elementsThatDidNotReceiveLayout.add(toRenderElement(child));
</del><ins>+ } else if (layoutSizeChanged && is<RenderElement>(*child))
+ elementsThatDidNotReceiveLayout.add(downcast<RenderElement>(child));
</ins><span class="cx">
</span><span class="cx"> ASSERT(!child->needsLayout());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGResourcesCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">
</span><span class="cx"> if (!rendererCanHaveResources(renderer))
</span><span class="cx"> return;
</span><del>- RenderElement& elementRenderer = toRenderElement(renderer);
</del><ins>+ RenderElement& elementRenderer = downcast<RenderElement>(renderer);
</ins><span class="cx"> resourcesCacheFromRenderer(elementRenderer).addResourcesFromRenderer(elementRenderer, elementRenderer.style());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">
</span><span class="cx"> if (!rendererCanHaveResources(renderer))
</span><span class="cx"> return;
</span><del>- RenderElement& elementRenderer = toRenderElement(renderer);
</del><ins>+ RenderElement& elementRenderer = downcast<RenderElement>(renderer);
</ins><span class="cx"> resourcesCacheFromRenderer(elementRenderer).removeResourcesFromRenderer(elementRenderer);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> buildCharacterDataMap(*textRoot);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, &text, m_characterDataMap);
</del><ins>+ m_metricsBuilder.buildMetricsAndLayoutAttributes(*textRoot, &text, m_characterDataMap);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree(RenderSVGText& textRoot)
</span><span class="lines">@@ -68,13 +68,12 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> buildCharacterDataMap(textRoot);
</span><del>- m_metricsBuilder.buildMetricsAndLayoutAttributes(&textRoot, nullptr, m_characterDataMap);
</del><ins>+ m_metricsBuilder.buildMetricsAndLayoutAttributes(textRoot, nullptr, m_characterDataMap);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer(RenderSVGInlineText* text)
</del><ins>+void SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer(RenderSVGInlineText& text)
</ins><span class="cx"> {
</span><del>- ASSERT(text);
</del><span class="cx"> m_metricsBuilder.measureTextRenderer(text);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextLayoutAttributesBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> bool buildLayoutAttributesForForSubtree(RenderSVGText&);
</span><span class="cx"> void buildLayoutAttributesForTextRenderer(RenderSVGInlineText&);
</span><span class="cx">
</span><del>- void rebuildMetricsForTextRenderer(RenderSVGInlineText*);
</del><ins>+ void rebuildMetricsForTextRenderer(RenderSVGInlineText&);
</ins><span class="cx">
</span><span class="cx"> // Invoked whenever the underlying DOM tree changes, so that m_textPositions is rebuild.
</span><span class="cx"> void clearTextPositioningElements() { m_textPositions.clear(); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextMetricsBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -20,6 +20,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "SVGTextMetricsBuilder.h"
</span><span class="cx">
</span><ins>+#include "RenderSVGInline.h"
</ins><span class="cx"> #include "RenderSVGInlineText.h"
</span><span class="cx"> #include "RenderSVGText.h"
</span><span class="cx"> #include "SVGTextRunRenderingContext.h"
</span><span class="lines">@@ -91,16 +92,16 @@
</span><span class="cx"> m_totalWidth = m_complexStartToCurrentMetrics.width();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer(RenderSVGInlineText* text)
</del><ins>+void SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer(RenderSVGInlineText& text)
</ins><span class="cx"> {
</span><del>- m_text = text;
</del><ins>+ m_text = &text;
</ins><span class="cx"> m_textPosition = 0;
</span><span class="cx"> m_currentMetrics = SVGTextMetrics();
</span><span class="cx"> m_complexStartToCurrentMetrics = SVGTextMetrics();
</span><span class="cx"> m_totalWidth = 0;
</span><span class="cx">
</span><del>- const Font& scaledFont = text->scaledFont();
- m_run = SVGTextMetrics::constructTextRun(*text);
</del><ins>+ const Font& scaledFont = text.scaledFont();
+ m_run = SVGTextMetrics::constructTextRun(text);
</ins><span class="cx"> m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
</span><span class="cx">
</span><span class="cx"> if (m_isComplexText)
</span><span class="lines">@@ -126,11 +127,9 @@
</span><span class="cx"> unsigned skippedCharacters;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-void SVGTextMetricsBuilder::measureTextRenderer(RenderSVGInlineText* text, MeasureTextData* data)
</del><ins>+void SVGTextMetricsBuilder::measureTextRenderer(RenderSVGInlineText& text, MeasureTextData* data)
</ins><span class="cx"> {
</span><del>- ASSERT(text);
-
- SVGTextLayoutAttributes* attributes = text->layoutAttributes();
</del><ins>+ SVGTextLayoutAttributes* attributes = text.layoutAttributes();
</ins><span class="cx"> Vector<SVGTextMetrics>* textMetricsValues = &attributes->textMetricsValues();
</span><span class="cx"> if (data->processRenderer) {
</span><span class="cx"> if (data->allCharactersMap)
</span><span class="lines">@@ -140,7 +139,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> initializeMeasurementWithTextRenderer(text);
</span><del>- bool preserveWhiteSpace = text->style().whiteSpace() == PRE;
</del><ins>+ bool preserveWhiteSpace = text.style().whiteSpace() == PRE;
</ins><span class="cx"> int surrogatePairCharacters = 0;
</span><span class="cx">
</span><span class="cx"> while (advance()) {
</span><span class="lines">@@ -178,9 +177,9 @@
</span><span class="cx"> void SVGTextMetricsBuilder::walkTree(RenderElement& start, RenderSVGInlineText* stopAtLeaf, MeasureTextData* data)
</span><span class="cx"> {
</span><span class="cx"> for (auto child = start.firstChild(); child; child = child->nextSibling()) {
</span><del>- if (child->isSVGInlineText()) {
- RenderSVGInlineText* text = toRenderSVGInlineText(child);
- if (stopAtLeaf && stopAtLeaf != text) {
</del><ins>+ if (is<RenderSVGInlineText>(*child)) {
+ RenderSVGInlineText& text = downcast<RenderSVGInlineText>(*child);
+ if (stopAtLeaf && stopAtLeaf != &text) {
</ins><span class="cx"> data->processRenderer = false;
</span><span class="cx"> measureTextRenderer(text, data);
</span><span class="cx"> continue;
</span><span class="lines">@@ -194,30 +193,27 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!child->isSVGInline())
</del><ins>+ if (!is<RenderSVGInline>(*child))
</ins><span class="cx"> continue;
</span><span class="cx">
</span><del>- walkTree(toRenderElement(*child), stopAtLeaf, data);
</del><ins>+ walkTree(downcast<RenderSVGInline>(*child), stopAtLeaf, data);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTextMetricsBuilder::measureTextRenderer(RenderSVGInlineText* text)
</del><ins>+void SVGTextMetricsBuilder::measureTextRenderer(RenderSVGInlineText& text)
</ins><span class="cx"> {
</span><del>- ASSERT(text);
-
- auto* textRoot = RenderSVGText::locateRenderSVGTextAncestor(*text);
</del><ins>+ auto* textRoot = RenderSVGText::locateRenderSVGTextAncestor(text);
</ins><span class="cx"> if (!textRoot)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- MeasureTextData data(0);
- walkTree(*textRoot, text, &data);
</del><ins>+ MeasureTextData data(nullptr);
+ walkTree(*textRoot, &text, &data);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textRoot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap)
</del><ins>+void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText& textRoot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap)
</ins><span class="cx"> {
</span><del>- ASSERT(textRoot);
</del><span class="cx"> MeasureTextData data(&allCharactersMap);
</span><del>- walkTree(*textRoot, stopAtLeaf, &data);
</del><ins>+ walkTree(textRoot, stopAtLeaf, &data);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextMetricsBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.h        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(SVGTextMetricsBuilder);
</span><span class="cx"> public:
</span><span class="cx"> SVGTextMetricsBuilder();
</span><del>- void measureTextRenderer(RenderSVGInlineText*);
- void buildMetricsAndLayoutAttributes(RenderSVGText*, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap);
</del><ins>+ void measureTextRenderer(RenderSVGInlineText&);
+ void buildMetricsAndLayoutAttributes(RenderSVGText&, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> bool advance();
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx"> void advanceComplexText();
</span><span class="cx"> bool currentCharacterStartsSurrogatePair() const;
</span><span class="cx">
</span><del>- void initializeMeasurementWithTextRenderer(RenderSVGInlineText*);
</del><ins>+ void initializeMeasurementWithTextRenderer(RenderSVGInlineText&);
</ins><span class="cx"> void walkTree(RenderElement&, RenderSVGInlineText* stopAtLeaf, MeasureTextData*);
</span><del>- void measureTextRenderer(RenderSVGInlineText*, MeasureTextData*);
</del><ins>+ void measureTextRenderer(RenderSVGInlineText&, MeasureTextData*);
</ins><span class="cx">
</span><span class="cx"> RenderSVGInlineText* m_text;
</span><span class="cx"> TextRun m_run;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextRunRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -246,14 +246,14 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<GlyphToPathTranslator> SVGTextRunRenderingContext::createGlyphToPathTranslator(const SimpleFontData& fontData, const TextRun* textRun, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& point) const
</span><span class="cx"> {
</span><del>- SVGFontElement* fontElement = 0;
- SVGFontFaceElement* fontFaceElement = 0;
</del><ins>+ SVGFontElement* fontElement = nullptr;
+ SVGFontFaceElement* fontFaceElement = nullptr;
</ins><span class="cx">
</span><span class="cx"> const SVGFontData* svgFontData = svgFontAndFontFaceElementForFontData(&fontData, fontFaceElement, fontElement);
</span><span class="cx"> if (!fontElement || !fontFaceElement)
</span><span class="cx"> return std::make_unique<DummyGlyphToPathTranslator>();
</span><span class="cx">
</span><del>- auto& elementRenderer = renderer().isRenderElement() ? toRenderElement(renderer()) : *renderer().parent();
</del><ins>+ auto& elementRenderer = is<RenderElement>(renderer()) ? downcast<RenderElement>(renderer()) : *renderer().parent();
</ins><span class="cx"> RenderStyle& style = elementRenderer.style();
</span><span class="cx"> bool isVerticalText = style.svgStyle().isVerticalWritingMode();
</span><span class="cx">
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx"> activePaintingResource = solidPaintingResource;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto& elementRenderer = renderer().isRenderElement() ? toRenderElement(renderer()) : *renderer().parent();
</del><ins>+ auto& elementRenderer = is<RenderElement>(renderer()) ? downcast<RenderElement>(renderer()) : *renderer().parent();
</ins><span class="cx"> RenderStyle& style = elementRenderer.style();
</span><span class="cx">
</span><span class="cx"> ASSERT(activePaintingResource);
</span><span class="lines">@@ -282,9 +282,9 @@
</span><span class="cx"> Path glyphPath = translator->path();
</span><span class="cx"> if (activePaintingResource->applyResource(elementRenderer, style, context, resourceMode)) {
</span><span class="cx"> float strokeThickness = context->strokeThickness();
</span><del>- if (renderer().isSVGInlineText())
- context->setStrokeThickness(strokeThickness * toRenderSVGInlineText(renderer()).scalingFactor());
- activePaintingResource->postApplyResource(elementRenderer, context, resourceMode, &glyphPath, 0);
</del><ins>+ if (is<RenderSVGInlineText>(renderer()))
+ context->setStrokeThickness(strokeThickness * downcast<RenderSVGInlineText>(renderer()).scalingFactor());
+ activePaintingResource->postApplyResource(elementRenderer, context, resourceMode, &glyphPath, nullptr);
</ins><span class="cx"> context->setStrokeThickness(strokeThickness);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -314,9 +314,9 @@
</span><span class="cx"> // Characters enclosed by an <altGlyph> element, may not be registered in the GlyphPage.
</span><span class="cx"> const SimpleFontData* originalFontData = glyphData.fontData;
</span><span class="cx"> if (glyphData.fontData && !glyphData.fontData->isSVGFont()) {
</span><del>- auto& elementRenderer = renderer().isRenderElement() ? toRenderElement(renderer()) : *renderer().parent();
</del><ins>+ auto& elementRenderer = is<RenderElement>(renderer()) ? downcast<RenderElement>(renderer()) : *renderer().parent();
</ins><span class="cx"> if (Element* parentRendererElement = elementRenderer.element()) {
</span><del>- if (parentRendererElement->hasTagName(SVGNames::altGlyphTag))
</del><ins>+ if (is<SVGAltGlyphElement>(*parentRendererElement))
</ins><span class="cx"> glyphData.fontData = primaryFont;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -326,8 +326,8 @@
</span><span class="cx"> if (!fontData->isSVGFont())
</span><span class="cx"> return glyphData;
</span><span class="cx">
</span><del>- SVGFontElement* fontElement = 0;
- SVGFontFaceElement* fontFaceElement = 0;
</del><ins>+ SVGFontElement* fontElement = nullptr;
+ SVGFontFaceElement* fontFaceElement = nullptr;
</ins><span class="cx">
</span><span class="cx"> const SVGFontData* svgFontData = svgFontAndFontFaceElementForFontData(fontData, fontFaceElement, fontElement);
</span><span class="cx"> if (!fontElement || !fontFaceElement)
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx"> // No suitable glyph found that is compatible with the requirments (same language, arabic-form, orientation etc.)
</span><span class="cx"> // Even though our GlyphPage contains an entry for eg. glyph "a", it's not compatible. So we have to temporarily
</span><span class="cx"> // remove the glyph data information from the GlyphPage, and retry the lookup, which handles font fallbacks correctly.
</span><del>- page->setGlyphDataForCharacter(character, 0, 0);
</del><ins>+ page->setGlyphDataForCharacter(character, 0, nullptr);
</ins><span class="cx">
</span><span class="cx"> // Assure that the font fallback glyph selection worked, aka. the fallbackGlyphData font data is not the same as before.
</span><span class="cx"> GlyphData fallbackGlyphData = font.glyphDataForCharacter(character, mirror);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontData.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontData.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebCore/svg/SVGFontData.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> SVGFontElement* associatedFontElement = svgFontFaceElement->associatedFontElement();
</span><span class="cx"> ASSERT(associatedFontElement);
</span><span class="cx">
</span><del>- RenderObject* renderObject = 0;
</del><ins>+ RenderObject* renderObject = nullptr;
</ins><span class="cx"> if (TextRun::RenderingContext* renderingContext = run.renderingContext())
</span><span class="cx"> renderObject = &static_cast<SVGTextRunRenderingContext*>(renderingContext)->renderer();
</span><span class="cx">
</span><span class="lines">@@ -152,11 +152,10 @@
</span><span class="cx"> Vector<String> altGlyphNames;
</span><span class="cx">
</span><span class="cx"> if (renderObject) {
</span><del>- RenderElement* parentRenderer = renderObject->isRenderElement() ? toRenderElement(renderObject) : renderObject->parent();
- ASSERT(parentRenderer);
</del><ins>+ RenderElement& parentRenderer = is<RenderElement>(*renderObject) ? downcast<RenderElement>(*renderObject) : *renderObject->parent();
</ins><span class="cx">
</span><del>- isVerticalText = parentRenderer->style().svgStyle().isVerticalWritingMode();
- if (Element* parentRendererElement = parentRenderer->element()) {
</del><ins>+ isVerticalText = parentRenderer.style().svgStyle().isVerticalWritingMode();
+ if (Element* parentRendererElement = parentRenderer.element()) {
</ins><span class="cx"> language = parentRendererElement->getAttribute(XMLNames::langAttr);
</span><span class="cx">
</span><span class="cx"> if (is<SVGAltGlyphElement>(*parentRendererElement)) {
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-10-10 Chris Dumez <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for RenderElement
+ https://bugs.webkit.org/show_bug.cgi?id=137622
+
+ Reviewed by Benjamin Poulain.
+
+ Use is<>() / downcast<>() for RenderElement and clean up the
+ surrounding code.
+
+ * WebFrame.cpp:
+ (WebFrame::pauseAnimation):
+ (WebFrame::pauseTransition):
+
</ins><span class="cx"> 2014-10-09 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Use is<>() / downcast<>() for Widget subclasses
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebFrame.cpp (174618 => 174619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebFrame.cpp        2014-10-10 23:04:22 UTC (rev 174618)
+++ trunk/Source/WebKit/win/WebFrame.cpp        2014-10-10 23:06:32 UTC (rev 174619)
</span><span class="lines">@@ -1181,7 +1181,7 @@
</span><span class="cx"> if (!domNode)
</span><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- *animationWasRunning = frame->animation().pauseAnimationAtTime(toRenderElement(domNode->node()->renderer()), String(animationName, SysStringLen(animationName)), secondsFromNow);
</del><ins>+ *animationWasRunning = frame->animation().pauseAnimationAtTime(downcast<RenderElement>(domNode->node()->renderer()), String(animationName, SysStringLen(animationName)), secondsFromNow);
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx"> if (!domNode)
</span><span class="cx"> return E_FAIL;
</span><span class="cx">
</span><del>- *transitionWasRunning = frame->animation().pauseTransitionAtTime(toRenderElement(domNode->node()->renderer()), String(propertyName, SysStringLen(propertyName)), secondsFromNow);
</del><ins>+ *transitionWasRunning = frame->animation().pauseTransitionAtTime(downcast<RenderElement>(domNode->node()->renderer()), String(propertyName, SysStringLen(propertyName)), secondsFromNow);
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>