<!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>[174759] trunk/Source/WebCore</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/174759">174759</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-15 23:04:36 -0700 (Wed, 15 Oct 2014)</dd>
</dl>

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

Reviewed by Benjamin Poulain.

Use is&lt;&gt;() / downcast&lt;&gt;() for list-related render objects and clean up
the surrounding code.

No new tests, no behavior change.

* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::visibleChildren):
(WebCore::AccessibilityListBox::elementAccessibilityHitTest):
* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::elementRect):
* accessibility/AccessibilityObject.cpp:
(WebCore::renderListItemContainerForNode):
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(getRangeLengthForObject):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(accessibilityObjectLength):
(offsetAdjustmentForListItem):
(webkitAccessibleTextGetText):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::didAttachRenderers):
(WebCore::HTMLLIElement::parseValue):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::nextSelectableListIndexPageAway):
(WebCore::HTMLSelectElement::scrollToSelection):
(WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
(WebCore::HTMLSelectElement::selectOption):
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/HTMLSelectElementWin.cpp:
(WebCore::HTMLSelectElement::platformHandleKeydownEvent):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
* rendering/RenderListBox.h:
* rendering/RenderListItem.cpp:
(WebCore::nextListItem):
(WebCore::previousListItem):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.h:
* rendering/RenderMenuList.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::markerTextForListItem):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustNodeSizes):
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleReplaced):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
* testing/Internals.cpp:
(WebCore::Internals::isSelectPopupVisible):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp">trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxOptioncpp">trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingBreakBlockquoteCommandcpp">trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLIElementcpp">trunk/Source/WebCore/html/HTMLLIElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementcpp">trunk/Source/WebCore/html/HTMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementWincpp">trunk/Source/WebCore/html/HTMLSelectElementWin.cpp</a></li>
<li><a href="#trunkSourceWebCorepagemacEventHandlerMacmm">trunk/Source/WebCore/page/mac/EventHandlerMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineFlowBoxcpp">trunk/Source/WebCore/rendering/InlineFlowBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderCountercpp">trunk/Source/WebCore/rendering/RenderCounter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxh">trunk/Source/WebCore/rendering/RenderListBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemcpp">trunk/Source/WebCore/rendering/RenderListItem.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListItemh">trunk/Source/WebCore/rendering/RenderListItem.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListMarkerh">trunk/Source/WebCore/rendering/RenderListMarker.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListh">trunk/Source/WebCore/rendering/RenderMenuList.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingTextAutoSizingcpp">trunk/Source/WebCore/rendering/TextAutoSizing.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh">trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/ChangeLog        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2014-10-15  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for list-related render objects
+        https://bugs.webkit.org/show_bug.cgi?id=137764
+
+        Reviewed by Benjamin Poulain.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for list-related render objects and clean up
+        the surrounding code.
+
+        No new tests, no behavior change.
+
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore::AccessibilityListBox::visibleChildren):
+        (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
+        * accessibility/AccessibilityListBoxOption.cpp:
+        (WebCore::AccessibilityListBoxOption::elementRect):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::renderListItemContainerForNode):
+        * accessibility/atk/WebKitAccessibleHyperlink.cpp:
+        (getRangeLengthForObject):
+        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+        (accessibilityObjectLength):
+        (offsetAdjustmentForListItem):
+        (webkitAccessibleTextGetText):
+        * editing/BreakBlockquoteCommand.cpp:
+        (WebCore::BreakBlockquoteCommand::doApply):
+        * html/HTMLLIElement.cpp:
+        (WebCore::HTMLLIElement::didAttachRenderers):
+        (WebCore::HTMLLIElement::parseValue):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::nextSelectableListIndexPageAway):
+        (WebCore::HTMLSelectElement::scrollToSelection):
+        (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
+        (WebCore::HTMLSelectElement::selectOption):
+        (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        * html/HTMLSelectElementWin.cpp:
+        (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformPrepareForWheelEvents):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::addToLine):
+        (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
+        * rendering/RenderCounter.cpp:
+        (WebCore::planCounter):
+        * rendering/RenderListBox.h:
+        * rendering/RenderListItem.cpp:
+        (WebCore::nextListItem):
+        (WebCore::previousListItem):
+        * rendering/RenderListItem.h:
+        * rendering/RenderListMarker.h:
+        * rendering/RenderMenuList.h:
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::markerTextForListItem):
+        * rendering/TextAutoSizing.cpp:
+        (WebCore::TextAutoSizingValue::adjustNodeSizes):
+        * rendering/line/BreakingContextInlineHeaders.h:
+        (WebCore::BreakingContext::handleReplaced):
+        (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
+        * testing/Internals.cpp:
+        (WebCore::Internals::isSelectPopupVisible):
+
</ins><span class="cx"> 2014-10-15  Gyuyoung Kim  &lt;gyuyoung.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use std::unique_ptr for CachedResource
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     
</span><span class="cx">     unsigned length = m_children.size();
</span><span class="cx">     for (unsigned i = 0; i &lt; length; i++) {
</span><del>-        if (toRenderListBox(m_renderer)-&gt;listIndexIsVisible(i))
</del><ins>+        if (downcast&lt;RenderListBox&gt;(*m_renderer).listIndexIsVisible(i))
</ins><span class="cx">             result.append(m_children[i]);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -159,8 +159,8 @@
</span><span class="cx">     
</span><span class="cx">     AccessibilityObject* listBoxOption = nullptr;
</span><span class="cx">     unsigned length = m_children.size();
</span><del>-    for (unsigned i = 0; i &lt; length; i++) {
-        LayoutRect rect = toRenderListBox(m_renderer)-&gt;itemBoundingBoxRect(parentRect.location(), i);
</del><ins>+    for (unsigned i = 0; i &lt; length; ++i) {
+        LayoutRect rect = downcast&lt;RenderListBox&gt;(*m_renderer).itemBoundingBoxRect(parentRect.location(), i);
</ins><span class="cx">         // The cast to HTMLElement below is safe because the only other possible listItem type
</span><span class="cx">         // would be a WMLElement, but WML builds don't use accessibility features at all.
</span><span class="cx">         if (rect.contains(point)) {
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxOptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -100,14 +100,14 @@
</span><span class="cx">     if (!listBoxParentNode)
</span><span class="cx">         return rect;
</span><span class="cx">     
</span><del>-    RenderObject* listBoxRenderer = listBoxParentNode-&gt;renderer();
</del><ins>+    RenderElement* listBoxRenderer = listBoxParentNode-&gt;renderer();
</ins><span class="cx">     if (!listBoxRenderer)
</span><span class="cx">         return rect;
</span><span class="cx">     
</span><span class="cx">     LayoutRect parentRect = listBoxRenderer-&gt;document().axObjectCache()-&gt;getOrCreate(listBoxRenderer)-&gt;boundingBoxRect();
</span><span class="cx">     int index = listBoxOptionIndex();
</span><span class="cx">     if (index != -1)
</span><del>-        rect = toRenderListBox(listBoxRenderer)-&gt;itemBoundingBoxRect(parentRect.location(), index);
</del><ins>+        rect = downcast&lt;RenderListBox&gt;(*listBoxRenderer).itemBoundingBoxRect(parentRect.location(), index);
</ins><span class="cx">     
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -1160,8 +1160,8 @@
</span><span class="cx"> {
</span><span class="cx">     for (; node; node = node-&gt;parentNode()) {
</span><span class="cx">         RenderBoxModelObject* renderer = node-&gt;renderBoxModelObject();
</span><del>-        if (renderer &amp;&amp; renderer-&gt;isListItem())
-            return toRenderListItem(renderer);
</del><ins>+        if (is&lt;RenderListItem&gt;(renderer))
+            return downcast&lt;RenderListItem&gt;(renderer);
</ins><span class="cx">     }
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleHyperlinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleHyperlink.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -231,10 +231,10 @@
</span><span class="cx">         return baseLength;
</span><span class="cx"> 
</span><span class="cx">     RenderObject* renderer = markerObj-&gt;renderer();
</span><del>-    if (!renderer || !renderer-&gt;isListMarker())
</del><ins>+    if (!is&lt;RenderListMarker&gt;(renderer))
</ins><span class="cx">         return baseLength;
</span><span class="cx"> 
</span><del>-    RenderListMarker&amp; marker = toRenderListMarker(*renderer);
</del><ins>+    auto&amp; marker = downcast&lt;RenderListMarker&gt;(*renderer);
</ins><span class="cx">     return baseLength + marker.text().length() + marker.suffix().length();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -270,8 +270,8 @@
</span><span class="cx">     // for those cases when it's needed to take it into account
</span><span class="cx">     // separately (as in getAccessibilityObjectForOffset)
</span><span class="cx">     RenderObject* renderer = object-&gt;renderer();
</span><del>-    if (renderer &amp;&amp; renderer-&gt;isListMarker()) {
-        RenderListMarker&amp; marker = toRenderListMarker(*renderer);
</del><ins>+    if (is&lt;RenderListMarker&gt;(renderer)) {
+        auto&amp; marker = downcast&lt;RenderListMarker&gt;(*renderer);
</ins><span class="cx">         return marker.text().length() + marker.suffix().length();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -363,8 +363,8 @@
</span><span class="cx">     // We need to adjust the offsets for the list item marker in
</span><span class="cx">     // Left-To-Right text, since we expose it together with the text.
</span><span class="cx">     RenderObject* renderer = object-&gt;renderer();
</span><del>-    if (renderer &amp;&amp; renderer-&gt;isListItem() &amp;&amp; renderer-&gt;style().direction() == LTR)
-        return toRenderListItem(renderer)-&gt;markerTextWithSuffix().length();
</del><ins>+    if (is&lt;RenderListItem&gt;(renderer) &amp;&amp; renderer-&gt;style().direction() == LTR)
+        return downcast&lt;RenderListItem&gt;(*renderer).markerTextWithSuffix().length();
</ins><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -495,8 +495,8 @@
</span><span class="cx">     int actualEndOffset = endOffset == -1 ? ret.length() : endOffset;
</span><span class="cx">     if (coreObject-&gt;roleValue() == ListItemRole) {
</span><span class="cx">         RenderObject* objRenderer = coreObject-&gt;renderer();
</span><del>-        if (objRenderer &amp;&amp; objRenderer-&gt;isListItem()) {
-            String markerText = toRenderListItem(objRenderer)-&gt;markerTextWithSuffix();
</del><ins>+        if (is&lt;RenderListItem&gt;(objRenderer)) {
+            String markerText = downcast&lt;RenderListItem&gt;(*objRenderer).markerTextWithSuffix();
</ins><span class="cx">             ret = objRenderer-&gt;style().direction() == LTR ? markerText + ret : ret + markerText;
</span><span class="cx">             if (endOffset == -1)
</span><span class="cx">                 actualEndOffset = ret.length() + markerText.length();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingBreakBlockquoteCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/editing/BreakBlockquoteCommand.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -148,8 +148,8 @@
</span><span class="cx">             // find the first one so that we know where to start numbering.
</span><span class="cx">             while (listChildNode &amp;&amp; !listChildNode-&gt;hasTagName(liTag))
</span><span class="cx">                 listChildNode = listChildNode-&gt;nextSibling();
</span><del>-            if (listChildNode &amp;&amp; listChildNode-&gt;renderer() &amp;&amp; listChildNode-&gt;renderer()-&gt;isListItem())
-                setNodeAttribute(clonedChild, startAttr, AtomicString::number(toRenderListItem(listChildNode-&gt;renderer())-&gt;value()));
</del><ins>+            if (listChildNode &amp;&amp; is&lt;RenderListItem&gt;(listChildNode-&gt;renderer()))
+                setNodeAttribute(clonedChild, startAttr, AtomicString::number(downcast&lt;RenderListItem&gt;(*listChildNode-&gt;renderer()).value()));
</ins><span class="cx">         }
</span><span class="cx">             
</span><span class="cx">         appendNode(clonedChild.get(), clonedAncestor.get());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLIElement.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLIElement.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/html/HTMLLIElement.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><ins>+#include &quot;ElementAncestorIterator.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderListItem.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -87,39 +88,37 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLLIElement::didAttachRenderers()
</span><span class="cx"> {
</span><del>-    if (!renderer() || !renderer()-&gt;isListItem())
</del><ins>+    if (!is&lt;RenderListItem&gt;(renderer()))
</ins><span class="cx">         return;
</span><del>-    RenderListItem* listItemRenderer = toRenderListItem(renderer());
</del><ins>+    auto&amp; listItemRenderer = downcast&lt;RenderListItem&gt;(*renderer());
</ins><span class="cx"> 
</span><del>-    // Find the enclosing list node.
-    Element* listNode = 0;
-    Element* current = this;
-    while (!listNode) {
-        current = current-&gt;parentElement();
-        if (!current)
</del><ins>+    // Check if there is an enclosing list.
+    bool isInList = false;
+    for (auto&amp; ancestor : ancestorsOfType&lt;HTMLElement&gt;(*this)) {
+        if (is&lt;HTMLUListElement&gt;(ancestor) || is&lt;HTMLOListElement&gt;(ancestor)) {
+            isInList = true;
</ins><span class="cx">             break;
</span><del>-        if (current-&gt;hasTagName(ulTag) || current-&gt;hasTagName(olTag))
-            listNode = current;
</del><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If we are not in a list, tell the renderer so it can position us inside.
</span><span class="cx">     // We don't want to change our style to say &quot;inside&quot; since that would affect nested nodes.
</span><del>-    if (!listNode)
-        listItemRenderer-&gt;setNotInList(true);
</del><ins>+    if (!isInList)
+        listItemRenderer.setNotInList(true);
</ins><span class="cx"> 
</span><span class="cx">     parseValue(fastGetAttribute(valueAttr));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void HTMLLIElement::parseValue(const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    ASSERT(renderer() &amp;&amp; renderer()-&gt;isListItem());
</del><ins>+    ASSERT(renderer());
</ins><span class="cx"> 
</span><span class="cx">     bool valueOK;
</span><span class="cx">     int requestedValue = value.toInt(&amp;valueOK);
</span><span class="cx">     if (valueOK)
</span><del>-        toRenderListItem(renderer())-&gt;setExplicitValue(requestedValue);
</del><ins>+        downcast&lt;RenderListItem&gt;(*renderer()).setExplicitValue(requestedValue);
</ins><span class="cx">     else
</span><del>-        toRenderListItem(renderer())-&gt;clearExplicitValue();
</del><ins>+        downcast&lt;RenderListItem&gt;(*renderer()).clearExplicitValue();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -562,14 +562,14 @@
</span><span class="cx">     const Vector&lt;HTMLElement*&gt;&amp; items = listItems();
</span><span class="cx">     // Can't use m_size because renderer forces a minimum size.
</span><span class="cx">     int pageSize = 0;
</span><del>-    if (renderer()-&gt;isListBox())
-        pageSize = toRenderListBox(renderer())-&gt;size() - 1; // -1 so we still show context.
</del><ins>+    if (is&lt;RenderListBox&gt;(*renderer()))
+        pageSize = downcast&lt;RenderListBox&gt;(*renderer()).size() - 1; // -1 so we still show context.
</ins><span class="cx"> 
</span><span class="cx">     // One page away, but not outside valid bounds.
</span><span class="cx">     // If there is a valid option item one page away, the index is chosen.
</span><span class="cx">     // If there is no exact one page away valid option, returns startIndex or the most far index.
</span><del>-    int edgeIndex = (direction == SkipForwards) ? 0 : (items.size() - 1);
-    int skipAmount = pageSize + ((direction == SkipForwards) ? startIndex : (edgeIndex - startIndex));
</del><ins>+    int edgeIndex = direction == SkipForwards ? 0 : items.size() - 1;
+    int skipAmount = pageSize + (direction == SkipForwards ? startIndex : edgeIndex - startIndex);
</ins><span class="cx">     return nextValidIndex(edgeIndex, direction, skipAmount);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -707,26 +707,26 @@
</span><span class="cx">     if (usesMenuList())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto renderer = this-&gt;renderer();
-    if (!renderer || !renderer-&gt;isListBox())
</del><ins>+    auto* renderer = this-&gt;renderer();
+    if (!is&lt;RenderListBox&gt;(renderer))
</ins><span class="cx">         return;
</span><del>-    toRenderListBox(renderer)-&gt;selectionChanged();
</del><ins>+    downcast&lt;RenderListBox&gt;(*renderer).selectionChanged();
</ins><span class="cx"> #else
</span><del>-    if (auto renderer = this-&gt;renderer())
</del><ins>+    if (auto* renderer = this-&gt;renderer())
</ins><span class="cx">         renderer-&gt;repaint();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLSelectElement::setOptionsChangedOnRenderer()
</span><span class="cx"> {
</span><del>-    if (auto renderer = this-&gt;renderer()) {
</del><ins>+    if (auto* renderer = this-&gt;renderer()) {
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><del>-        if (renderer-&gt;isMenuList())
-            toRenderMenuList(renderer)-&gt;setOptionsChanged(true);
</del><ins>+        if (is&lt;RenderMenuList&gt;(*renderer))
+            downcast&lt;RenderMenuList&gt;(*renderer).setOptionsChanged(true);
</ins><span class="cx">         else
</span><del>-            toRenderListBox(renderer)-&gt;setOptionsChanged(true);
</del><ins>+            downcast&lt;RenderListBox&gt;(*renderer).setOptionsChanged(true);
</ins><span class="cx"> #else
</span><del>-        toRenderMenuList(renderer)-&gt;setOptionsChanged(true);
</del><ins>+        downcast&lt;RenderMenuList&gt;(*renderer).setOptionsChanged(true);
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -889,7 +889,7 @@
</span><span class="cx">         deselectItemsWithoutValidation(element);
</span><span class="cx"> 
</span><span class="cx">     // For the menu list case, this is what makes the selected element appear.
</span><del>-    if (auto renderer = this-&gt;renderer())
</del><ins>+    if (auto* renderer = this-&gt;renderer())
</ins><span class="cx">         renderer-&gt;updateFromElement();
</span><span class="cx"> 
</span><span class="cx">     scrollToSelection();
</span><span class="lines">@@ -898,11 +898,11 @@
</span><span class="cx">         m_isProcessingUserDrivenChange = flags &amp; UserDriven;
</span><span class="cx">         if (flags &amp; DispatchChangeEvent)
</span><span class="cx">             dispatchChangeEventForMenuList();
</span><del>-        if (auto renderer = this-&gt;renderer()) {
-            if (renderer-&gt;isMenuList())
-                toRenderMenuList(renderer)-&gt;didSetSelectedIndex(listIndex);
</del><ins>+        if (auto* renderer = this-&gt;renderer()) {
+            if (is&lt;RenderMenuList&gt;(*renderer))
+                downcast&lt;RenderMenuList&gt;(*renderer).didSetSelectedIndex(listIndex);
</ins><span class="cx">             else
</span><del>-                toRenderListBox(renderer)-&gt;selectionChanged();
</del><ins>+                downcast&lt;RenderListBox&gt;(*renderer).selectionChanged();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1120,7 +1120,7 @@
</span><span class="cx">             // Calling focus() may cause us to lose our renderer. Return true so
</span><span class="cx">             // that our caller doesn't process the event further, but don't set
</span><span class="cx">             // the event as handled.
</span><del>-            if (!renderer() || !renderer()-&gt;isMenuList())
</del><ins>+            if (!is&lt;RenderMenuList&gt;(renderer()))
</ins><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">             // Save the selection so it can be compared to the new selection
</span><span class="lines">@@ -1128,7 +1128,7 @@
</span><span class="cx">             // gets called from RenderMenuList::valueChanged, which gets called
</span><span class="cx">             // after the user makes a selection from the menu.
</span><span class="cx">             saveLastSelection();
</span><del>-            toRenderMenuList(renderer())-&gt;showPopup();
</del><ins>+            downcast&lt;RenderMenuList&gt;(*renderer()).showPopup();
</ins><span class="cx">             event-&gt;setDefaultHandled();
</span><span class="cx">         }
</span><span class="cx">         return true;
</span><span class="lines">@@ -1219,7 +1219,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // Calling focus() may remove the renderer or change the
</span><span class="cx">                 // renderer type.
</span><del>-                if (!renderer() || !renderer()-&gt;isMenuList())
</del><ins>+                if (!is&lt;RenderMenuList&gt;(renderer()))
</ins><span class="cx">                     return;
</span><span class="cx"> 
</span><span class="cx">                 // Save the selection so it can be compared to the new selection
</span><span class="lines">@@ -1227,7 +1227,7 @@
</span><span class="cx">                 // gets called from RenderMenuList::valueChanged, which gets called
</span><span class="cx">                 // after the user makes a selection from the menu.
</span><span class="cx">                 saveLastSelection();
</span><del>-                toRenderMenuList(renderer())-&gt;showPopup();
</del><ins>+                downcast&lt;RenderMenuList&gt;(*renderer()).showPopup();
</ins><span class="cx">                 handled = true;
</span><span class="cx">             }
</span><span class="cx">         } else if (renderTheme-&gt;popsMenuByArrowKeys()) {
</span><span class="lines">@@ -1236,7 +1236,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // Calling focus() may remove the renderer or change the
</span><span class="cx">                 // renderer type.
</span><del>-                if (!renderer() || !renderer()-&gt;isMenuList())
</del><ins>+                if (!is&lt;RenderMenuList&gt;(renderer()))
</ins><span class="cx">                     return;
</span><span class="cx"> 
</span><span class="cx">                 // Save the selection so it can be compared to the new selection
</span><span class="lines">@@ -1244,7 +1244,7 @@
</span><span class="cx">                 // gets called from RenderMenuList::valueChanged, which gets called
</span><span class="cx">                 // after the user makes a selection from the menu.
</span><span class="cx">                 saveLastSelection();
</span><del>-                toRenderMenuList(renderer())-&gt;showPopup();
</del><ins>+                downcast&lt;RenderMenuList&gt;(*renderer()).showPopup();
</ins><span class="cx">                 handled = true;
</span><span class="cx">             } else if (keyCode == '\r') {
</span><span class="cx">                 if (form())
</span><span class="lines">@@ -1261,8 +1261,8 @@
</span><span class="cx">     if (event-&gt;type() == eventNames().mousedownEvent &amp;&amp; is&lt;MouseEvent&gt;(*event) &amp;&amp; downcast&lt;MouseEvent&gt;(*event).button() == LeftButton) {
</span><span class="cx">         focus();
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isMenuList()) {
-            auto&amp; menuList = toRenderMenuList(*renderer());
</del><ins>+        if (is&lt;RenderMenuList&gt;(renderer())) {
+            auto&amp; menuList = downcast&lt;RenderMenuList&gt;(*renderer());
</ins><span class="cx">             ASSERT(!menuList.popupIsVisible());
</span><span class="cx">             // Save the selection so it can be compared to the new
</span><span class="cx">             // selection when we call onChange during selectOption,
</span><span class="lines">@@ -1278,7 +1278,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (event-&gt;type() == eventNames().blurEvent &amp;&amp; !focused()) {
</span><del>-        auto&amp; menuList = toRenderMenuList(*renderer());
</del><ins>+        auto&amp; menuList = downcast&lt;RenderMenuList&gt;(*renderer());
</ins><span class="cx">         if (menuList.popupIsVisible())
</span><span class="cx">             menuList.hidePopup();
</span><span class="cx">     }
</span><span class="lines">@@ -1341,13 +1341,13 @@
</span><span class="cx">     if (event-&gt;type() == eventNames().mousedownEvent &amp;&amp; is&lt;MouseEvent&gt;(*event) &amp;&amp; downcast&lt;MouseEvent&gt;(*event).button() == LeftButton) {
</span><span class="cx">         focus();
</span><span class="cx">         // Calling focus() may remove or change our renderer, in which case we don't want to handle the event further.
</span><del>-        if (!renderer() || !renderer()-&gt;isListBox())
</del><ins>+        if (!is&lt;RenderListBox&gt;(renderer()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         // Convert to coords relative to the list box if needed.
</span><span class="cx">         MouseEvent&amp; mouseEvent = downcast&lt;MouseEvent&gt;(*event);
</span><span class="cx">         IntPoint localOffset = roundedIntPoint(renderer()-&gt;absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
</span><del>-        int listIndex = toRenderListBox(renderer())-&gt;listIndexAtOffset(toIntSize(localOffset));
</del><ins>+        int listIndex = downcast&lt;RenderListBox&gt;(*renderer()).listIndexAtOffset(toIntSize(localOffset));
</ins><span class="cx">         if (listIndex &gt;= 0) {
</span><span class="cx">             if (!isDisabledFormControl()) {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -1367,7 +1367,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         IntPoint localOffset = roundedIntPoint(renderer()-&gt;absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
</span><del>-        int listIndex = toRenderListBox(renderer())-&gt;listIndexAtOffset(toIntSize(localOffset));
</del><ins>+        int listIndex = downcast&lt;RenderListBox&gt;(*renderer()).listIndexAtOffset(toIntSize(localOffset));
</ins><span class="cx">         if (listIndex &gt;= 0) {
</span><span class="cx">             if (!isDisabledFormControl()) {
</span><span class="cx">                 if (m_multiple) {
</span><span class="lines">@@ -1475,7 +1475,7 @@
</span><span class="cx">                 setActiveSelectionAnchorIndex(m_activeSelectionEndIndex);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            toRenderListBox(renderer())-&gt;scrollToRevealElementAtListIndex(endIndex);
</del><ins>+            downcast&lt;RenderListBox&gt;(*renderer()).scrollToRevealElementAtListIndex(endIndex);
</ins><span class="cx">             if (selectNewItem) {
</span><span class="cx">                 updateListBoxSelection(deselectOthers);
</span><span class="cx">                 listBoxOnChange();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElementWin.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElementWin.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/html/HTMLSelectElementWin.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     // Save the selection so it can be compared to the new selection when dispatching change events during setSelectedIndex,
</span><span class="cx">     // which gets called from RenderMenuList::valueChanged, which gets called after the user makes a selection from the menu.
</span><span class="cx">     saveLastSelection();
</span><del>-    if (RenderMenuList* menuList = toRenderMenuList(renderer()))
</del><ins>+    if (auto* menuList = downcast&lt;RenderMenuList&gt;(renderer()))
</ins><span class="cx">         menuList-&gt;showPopup();
</span><span class="cx"> 
</span><span class="cx">     int index = selectedIndex();
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -842,8 +842,8 @@
</span><span class="cx">             scrollableContainer = findEnclosingScrollableContainer(*wheelEventTarget);
</span><span class="cx">             if (scrollableContainer) {
</span><span class="cx">                 if (RenderBox* box = scrollableContainer-&gt;renderBox()) {
</span><del>-                    if (box-&gt;isListBox())
-                        scrollableArea = toRenderListBox(box);
</del><ins>+                    if (is&lt;RenderListBox&gt;(*box))
+                        scrollableArea = downcast&lt;RenderListBox&gt;(box);
</ins><span class="cx">                     else
</span><span class="cx">                         scrollableArea = box-&gt;layer();
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineFlowBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineFlowBox.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">             if (box.hasRenderOverflow() || box.hasSelfPaintingLayer())
</span><span class="cx">                 child-&gt;clearKnownToHaveNoOverflow();
</span><span class="cx">         } else if (!child-&gt;renderer().isLineBreak() &amp;&amp; (childStyle.boxShadow() || child-&gt;boxModelObject()-&gt;hasSelfPaintingLayer()
</span><del>-            || (child-&gt;renderer().isListMarker() &amp;&amp; !toRenderListMarker(child-&gt;renderer()).isInside())
</del><ins>+            || (is&lt;RenderListMarker&gt;(child-&gt;renderer()) &amp;&amp; !downcast&lt;RenderListMarker&gt;(child-&gt;renderer()).isInside())
</ins><span class="cx">             || childStyle.hasBorderImageOutsets()))
</span><span class="cx">             child-&gt;clearKnownToHaveNoOverflow();
</span><span class="cx">         
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">                 if (knownToHaveNoOverflow())
</span><span class="cx">                     maxLogicalRight = std::max(logicalLeft, maxLogicalRight);
</span><span class="cx">                 logicalLeft += flow.marginLogicalRight();
</span><del>-            } else if (!child-&gt;renderer().isListMarker() || toRenderListMarker(child-&gt;renderer()).isInside()) {
</del><ins>+            } else if (!is&lt;RenderListMarker&gt;(child-&gt;renderer()) || downcast&lt;RenderListMarker&gt;(child-&gt;renderer()).isInside()) {
</ins><span class="cx">                 // The box can have a different writing-mode than the overall line, so this is a bit complicated.
</span><span class="cx">                 // Just get all the physical margin and overflow values by hand based off |isVertical|.
</span><span class="cx">                 LayoutUnit logicalLeftMargin = isHorizontal() ? child-&gt;boxModelObject()-&gt;marginLeft() : child-&gt;boxModelObject()-&gt;marginTop();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderCountercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderCounter.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderCounter.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderCounter.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -131,9 +131,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (identifier == &quot;list-item&quot;) {
</span><del>-        if (renderer.isListItem()) {
-            if (toRenderListItem(renderer).hasExplicitValue()) {
-                value = toRenderListItem(renderer).explicitValue();
</del><ins>+        if (is&lt;RenderListItem&gt;(renderer)) {
+            if (downcast&lt;RenderListItem&gt;(renderer).hasExplicitValue()) {
+                value = downcast&lt;RenderListItem&gt;(renderer).explicitValue();
</ins><span class="cx">                 isReset = true;
</span><span class="cx">                 return true;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.h (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.h        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderListBox.h        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -161,8 +161,6 @@
</span><span class="cx">     RefPtr&lt;Scrollbar&gt; m_vBar;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderListBox, isListBox())
-
</del><span class="cx"> } // namepace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderListBox, isListBox())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -118,10 +118,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Returns the next list item with respect to the DOM order.
</span><del>-static RenderListItem* nextListItem(const Element* listNode, const RenderListItem* item = 0)
</del><ins>+static RenderListItem* nextListItem(const Element* listNode, const RenderListItem* item = nullptr)
</ins><span class="cx"> {
</span><span class="cx">     if (!listNode)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     const Element* current = item ? &amp;item-&gt;element() : listNode;
</span><span class="cx">     current = ElementTraversal::nextIncludingPseudo(current, listNode);
</span><span class="lines">@@ -133,15 +133,15 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RenderObject* renderer = current-&gt;renderer();
-        if (renderer &amp;&amp; renderer-&gt;isListItem())
-            return toRenderListItem(renderer);
</del><ins>+        RenderElement* renderer = current-&gt;renderer();
+        if (is&lt;RenderListItem&gt;(renderer))
+            return downcast&lt;RenderListItem&gt;(renderer);
</ins><span class="cx"> 
</span><span class="cx">         // FIXME: Can this be optimized to skip the children of the elements without a renderer?
</span><span class="cx">         current = ElementTraversal::nextIncludingPseudo(current, listNode);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Returns the previous list item with respect to the DOM order.
</span><span class="lines">@@ -149,13 +149,13 @@
</span><span class="cx"> {
</span><span class="cx">     Element* current = &amp;item-&gt;element();
</span><span class="cx">     for (current = ElementTraversal::previousIncludingPseudo(current, listNode); current; current = ElementTraversal::previousIncludingPseudo(current, listNode)) {
</span><del>-        RenderObject* renderer = current-&gt;renderer();
-        if (!renderer || (renderer &amp;&amp; !renderer-&gt;isListItem()))
</del><ins>+        RenderElement* renderer = current-&gt;renderer();
+        if (!is&lt;RenderListItem&gt;(renderer))
</ins><span class="cx">             continue;
</span><del>-        Node* otherList = enclosingList(toRenderListItem(renderer));
</del><ins>+        Element* otherList = enclosingList(downcast&lt;RenderListItem&gt;(renderer));
</ins><span class="cx">         // This item is part of our current list, so it's what we're looking for.
</span><span class="cx">         if (listNode == otherList)
</span><del>-            return toRenderListItem(renderer);
</del><ins>+            return downcast&lt;RenderListItem&gt;(renderer);
</ins><span class="cx">         // We found ourself inside another list; lets skip the rest of it.
</span><span class="cx">         // Use nextIncludingPseudo() here because the other list itself may actually
</span><span class="cx">         // be a list item itself. We need to examine it, so we do this to counteract
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">         if (otherList)
</span><span class="cx">             current = ElementTraversal::nextIncludingPseudo(otherList);
</span><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderListItem::updateItemValuesForOrderedList(const HTMLOListElement* listNode)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListItemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListItem.h (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListItem.h        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderListItem.h        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -93,8 +93,6 @@
</span><span class="cx">     bool m_notInList : 1;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderListItem, isListItem())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderListItem, isListItem())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListMarkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListMarker.h (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListMarker.h        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderListMarker.h        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -85,8 +85,6 @@
</span><span class="cx">     RenderListItem&amp; m_listItem;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderListMarker, isListMarker())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderListMarker, isListMarker())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.h        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -152,8 +152,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderMenuList, isMenuList())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMenuList, isMenuList())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -934,11 +934,11 @@
</span><span class="cx">     RefPtr&lt;Element&gt; elementRef(element);
</span><span class="cx">     element-&gt;document().updateLayout();
</span><span class="cx"> 
</span><del>-    RenderObject* renderer = element-&gt;renderer();
-    if (!renderer || !renderer-&gt;isListItem())
</del><ins>+    RenderElement* renderer = element-&gt;renderer();
+    if (!is&lt;RenderListItem&gt;(renderer))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    return toRenderListItem(renderer)-&gt;markerText();
</del><ins>+    return downcast&lt;RenderListItem&gt;(*renderer).markerText();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingTextAutoSizingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/TextAutoSizing.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/TextAutoSizing.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">                 RefPtr&lt;RenderStyle&gt; style = cloneRenderStyleWithState(listMarkerRenderer-&gt;style());
</span><span class="cx">                 style-&gt;setFontDescription(fontDescription);
</span><span class="cx">                 style-&gt;font().update(autoSizingNode-&gt;document().ensureStyleResolver().fontSelector());
</span><del>-                toRenderListMarker(*listMarkerRenderer).setStyle(style.releaseNonNull());
</del><ins>+                downcast&lt;RenderListMarker&gt;(*listMarkerRenderer).setStyle(style.releaseNonNull());
</ins><span class="cx">             }
</span><span class="cx">             
</span><span class="cx">             // Resize the line height of the parent.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx">     // Optimize for a common case. If we can't find whitespace after the list
</span><span class="cx">     // item, then this is all moot.
</span><span class="cx">     LayoutUnit replacedLogicalWidth = m_block.logicalWidthForChild(replacedBox) + m_block.marginStartForChild(replacedBox) + m_block.marginEndForChild(replacedBox) + inlineLogicalWidth(m_current.renderer());
</span><del>-    if (m_current.renderer()-&gt;isListMarker()) {
</del><ins>+    if (is&lt;RenderListMarker&gt;(*m_current.renderer())) {
</ins><span class="cx">         if (m_blockStyle.collapseWhiteSpace() &amp;&amp; shouldSkipWhitespaceAfterStartObject(m_block, m_current.renderer(), m_lineMidpointState)) {
</span><span class="cx">             // Like with inline flows, we start ignoring spaces to make sure that any
</span><span class="cx">             // additional spaces we see will be discarded.
</span><span class="lines">@@ -438,12 +438,12 @@
</span><span class="cx">             m_currentCharacterIsWS = false;
</span><span class="cx">             m_ignoringSpaces = true;
</span><span class="cx">         }
</span><del>-        if (toRenderListMarker(*m_current.renderer()).isInside())
</del><ins>+        if (downcast&lt;RenderListMarker&gt;(*m_current.renderer()).isInside())
</ins><span class="cx">             m_width.addUncommittedWidth(replacedLogicalWidth);
</span><span class="cx">     } else
</span><span class="cx">         m_width.addUncommittedWidth(replacedLogicalWidth);
</span><del>-    if (m_current.renderer()-&gt;isRubyRun())
-        m_width.applyOverhang(toRenderRubyRun(m_current.renderer()), m_lastObject, m_nextObject);
</del><ins>+    if (is&lt;RenderRubyRun&gt;(*m_current.renderer()))
+        m_width.applyOverhang(downcast&lt;RenderRubyRun&gt;(m_current.renderer()), m_lastObject, m_nextObject);
</ins><span class="cx">     // Update prior line break context characters, using U+FFFD (OBJECT REPLACEMENT CHARACTER) for replaced element.
</span><span class="cx">     m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
</span><span class="cx"> }
</span><span class="lines">@@ -995,7 +995,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_current.renderer()-&gt;isFloatingOrOutOfFlowPositioned()) {
</span><span class="cx">         m_lastObject = m_current.renderer();
</span><del>-        if (m_lastObject-&gt;isReplaced() &amp;&amp; m_autoWrap &amp;&amp; (!m_lastObject-&gt;isImage() || m_allowImagesToBreak) &amp;&amp; (!m_lastObject-&gt;isListMarker() || toRenderListMarker(*m_lastObject).isInside())) {
</del><ins>+        if (m_lastObject-&gt;isReplaced() &amp;&amp; m_autoWrap &amp;&amp; (!m_lastObject-&gt;isImage() || m_allowImagesToBreak) &amp;&amp; (!is&lt;RenderListMarker&gt;(*m_lastObject) || downcast&lt;RenderListMarker&gt;(*m_lastObject).isInside())) {
</ins><span class="cx">             m_width.commit();
</span><span class="cx">             m_lineBreak.moveToStartOf(m_nextObject);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (174758 => 174759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-10-16 03:57:28 UTC (rev 174758)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-10-16 06:04:36 UTC (rev 174759)
</span><span class="lines">@@ -2092,13 +2092,13 @@
</span><span class="cx"> 
</span><span class="cx">     HTMLSelectElement&amp; select = downcast&lt;HTMLSelectElement&gt;(*node);
</span><span class="cx"> 
</span><del>-    auto renderer = select.renderer();
-    if (!renderer-&gt;isMenuList())
</del><ins>+    auto* renderer = select.renderer();
+    ASSERT(renderer);
+    if (!is&lt;RenderMenuList&gt;(*renderer))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-    RenderMenuList* menuList = toRenderMenuList(renderer);
-    return menuList-&gt;popupIsVisible();
</del><ins>+    return downcast&lt;RenderMenuList&gt;(*renderer).popupIsVisible();
</ins><span class="cx"> #else
</span><span class="cx">     return false;
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span></span></pre>
</div>
</div>

</body>
</html>