<!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<>() / downcast<>() for list-related render objects
https://bugs.webkit.org/show_bug.cgi?id=137764
Reviewed by Benjamin Poulain.
Use is<>() / downcast<>() 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 <cdumez@apple.com>
+
+ Use is<>() / downcast<>() for list-related render objects
+ https://bugs.webkit.org/show_bug.cgi?id=137764
+
+ Reviewed by Benjamin Poulain.
+
+ Use is<>() / downcast<>() 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 <gyuyoung.kim@samsung.com>
</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 < length; i++) {
</span><del>- if (toRenderListBox(m_renderer)->listIndexIsVisible(i))
</del><ins>+ if (downcast<RenderListBox>(*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 < length; i++) {
- LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(parentRect.location(), i);
</del><ins>+ for (unsigned i = 0; i < length; ++i) {
+ LayoutRect rect = downcast<RenderListBox>(*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->renderer();
</del><ins>+ RenderElement* listBoxRenderer = listBoxParentNode->renderer();
</ins><span class="cx"> if (!listBoxRenderer)
</span><span class="cx"> return rect;
</span><span class="cx">
</span><span class="cx"> LayoutRect parentRect = listBoxRenderer->document().axObjectCache()->getOrCreate(listBoxRenderer)->boundingBoxRect();
</span><span class="cx"> int index = listBoxOptionIndex();
</span><span class="cx"> if (index != -1)
</span><del>- rect = toRenderListBox(listBoxRenderer)->itemBoundingBoxRect(parentRect.location(), index);
</del><ins>+ rect = downcast<RenderListBox>(*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->parentNode()) {
</span><span class="cx"> RenderBoxModelObject* renderer = node->renderBoxModelObject();
</span><del>- if (renderer && renderer->isListItem())
- return toRenderListItem(renderer);
</del><ins>+ if (is<RenderListItem>(renderer))
+ return downcast<RenderListItem>(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->renderer();
</span><del>- if (!renderer || !renderer->isListMarker())
</del><ins>+ if (!is<RenderListMarker>(renderer))
</ins><span class="cx"> return baseLength;
</span><span class="cx">
</span><del>- RenderListMarker& marker = toRenderListMarker(*renderer);
</del><ins>+ auto& marker = downcast<RenderListMarker>(*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->renderer();
</span><del>- if (renderer && renderer->isListMarker()) {
- RenderListMarker& marker = toRenderListMarker(*renderer);
</del><ins>+ if (is<RenderListMarker>(renderer)) {
+ auto& marker = downcast<RenderListMarker>(*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->renderer();
</span><del>- if (renderer && renderer->isListItem() && renderer->style().direction() == LTR)
- return toRenderListItem(renderer)->markerTextWithSuffix().length();
</del><ins>+ if (is<RenderListItem>(renderer) && renderer->style().direction() == LTR)
+ return downcast<RenderListItem>(*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->roleValue() == ListItemRole) {
</span><span class="cx"> RenderObject* objRenderer = coreObject->renderer();
</span><del>- if (objRenderer && objRenderer->isListItem()) {
- String markerText = toRenderListItem(objRenderer)->markerTextWithSuffix();
</del><ins>+ if (is<RenderListItem>(objRenderer)) {
+ String markerText = downcast<RenderListItem>(*objRenderer).markerTextWithSuffix();
</ins><span class="cx"> ret = objRenderer->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 && !listChildNode->hasTagName(liTag))
</span><span class="cx"> listChildNode = listChildNode->nextSibling();
</span><del>- if (listChildNode && listChildNode->renderer() && listChildNode->renderer()->isListItem())
- setNodeAttribute(clonedChild, startAttr, AtomicString::number(toRenderListItem(listChildNode->renderer())->value()));
</del><ins>+ if (listChildNode && is<RenderListItem>(listChildNode->renderer()))
+ setNodeAttribute(clonedChild, startAttr, AtomicString::number(downcast<RenderListItem>(*listChildNode->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 "Attribute.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "CSSValueKeywords.h"
</span><ins>+#include "ElementAncestorIterator.h"
</ins><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "RenderListItem.h"
</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()->isListItem())
</del><ins>+ if (!is<RenderListItem>(renderer()))
</ins><span class="cx"> return;
</span><del>- RenderListItem* listItemRenderer = toRenderListItem(renderer());
</del><ins>+ auto& listItemRenderer = downcast<RenderListItem>(*renderer());
</ins><span class="cx">
</span><del>- // Find the enclosing list node.
- Element* listNode = 0;
- Element* current = this;
- while (!listNode) {
- current = current->parentElement();
- if (!current)
</del><ins>+ // Check if there is an enclosing list.
+ bool isInList = false;
+ for (auto& ancestor : ancestorsOfType<HTMLElement>(*this)) {
+ if (is<HTMLUListElement>(ancestor) || is<HTMLOListElement>(ancestor)) {
+ isInList = true;
</ins><span class="cx"> break;
</span><del>- if (current->hasTagName(ulTag) || current->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 "inside" since that would affect nested nodes.
</span><del>- if (!listNode)
- listItemRenderer->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& value)
</span><span class="cx"> {
</span><del>- ASSERT(renderer() && renderer()->isListItem());
</del><ins>+ ASSERT(renderer());
</ins><span class="cx">
</span><span class="cx"> bool valueOK;
</span><span class="cx"> int requestedValue = value.toInt(&valueOK);
</span><span class="cx"> if (valueOK)
</span><del>- toRenderListItem(renderer())->setExplicitValue(requestedValue);
</del><ins>+ downcast<RenderListItem>(*renderer()).setExplicitValue(requestedValue);
</ins><span class="cx"> else
</span><del>- toRenderListItem(renderer())->clearExplicitValue();
</del><ins>+ downcast<RenderListItem>(*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<HTMLElement*>& 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()->isListBox())
- pageSize = toRenderListBox(renderer())->size() - 1; // -1 so we still show context.
</del><ins>+ if (is<RenderListBox>(*renderer()))
+ pageSize = downcast<RenderListBox>(*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->renderer();
- if (!renderer || !renderer->isListBox())
</del><ins>+ auto* renderer = this->renderer();
+ if (!is<RenderListBox>(renderer))
</ins><span class="cx"> return;
</span><del>- toRenderListBox(renderer)->selectionChanged();
</del><ins>+ downcast<RenderListBox>(*renderer).selectionChanged();
</ins><span class="cx"> #else
</span><del>- if (auto renderer = this->renderer())
</del><ins>+ if (auto* renderer = this->renderer())
</ins><span class="cx"> renderer->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->renderer()) {
</del><ins>+ if (auto* renderer = this->renderer()) {
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><del>- if (renderer->isMenuList())
- toRenderMenuList(renderer)->setOptionsChanged(true);
</del><ins>+ if (is<RenderMenuList>(*renderer))
+ downcast<RenderMenuList>(*renderer).setOptionsChanged(true);
</ins><span class="cx"> else
</span><del>- toRenderListBox(renderer)->setOptionsChanged(true);
</del><ins>+ downcast<RenderListBox>(*renderer).setOptionsChanged(true);
</ins><span class="cx"> #else
</span><del>- toRenderMenuList(renderer)->setOptionsChanged(true);
</del><ins>+ downcast<RenderMenuList>(*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->renderer())
</del><ins>+ if (auto* renderer = this->renderer())
</ins><span class="cx"> renderer->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 & UserDriven;
</span><span class="cx"> if (flags & DispatchChangeEvent)
</span><span class="cx"> dispatchChangeEventForMenuList();
</span><del>- if (auto renderer = this->renderer()) {
- if (renderer->isMenuList())
- toRenderMenuList(renderer)->didSetSelectedIndex(listIndex);
</del><ins>+ if (auto* renderer = this->renderer()) {
+ if (is<RenderMenuList>(*renderer))
+ downcast<RenderMenuList>(*renderer).didSetSelectedIndex(listIndex);
</ins><span class="cx"> else
</span><del>- toRenderListBox(renderer)->selectionChanged();
</del><ins>+ downcast<RenderListBox>(*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()->isMenuList())
</del><ins>+ if (!is<RenderMenuList>(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())->showPopup();
</del><ins>+ downcast<RenderMenuList>(*renderer()).showPopup();
</ins><span class="cx"> event->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()->isMenuList())
</del><ins>+ if (!is<RenderMenuList>(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())->showPopup();
</del><ins>+ downcast<RenderMenuList>(*renderer()).showPopup();
</ins><span class="cx"> handled = true;
</span><span class="cx"> }
</span><span class="cx"> } else if (renderTheme->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()->isMenuList())
</del><ins>+ if (!is<RenderMenuList>(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())->showPopup();
</del><ins>+ downcast<RenderMenuList>(*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->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*event).button() == LeftButton) {
</span><span class="cx"> focus();
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>- if (renderer() && renderer()->isMenuList()) {
- auto& menuList = toRenderMenuList(*renderer());
</del><ins>+ if (is<RenderMenuList>(renderer())) {
+ auto& menuList = downcast<RenderMenuList>(*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->type() == eventNames().blurEvent && !focused()) {
</span><del>- auto& menuList = toRenderMenuList(*renderer());
</del><ins>+ auto& menuList = downcast<RenderMenuList>(*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->type() == eventNames().mousedownEvent && is<MouseEvent>(*event) && downcast<MouseEvent>(*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()->isListBox())
</del><ins>+ if (!is<RenderListBox>(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& mouseEvent = downcast<MouseEvent>(*event);
</span><span class="cx"> IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
</span><del>- int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toIntSize(localOffset));
</del><ins>+ int listIndex = downcast<RenderListBox>(*renderer()).listIndexAtOffset(toIntSize(localOffset));
</ins><span class="cx"> if (listIndex >= 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()->absoluteToLocal(mouseEvent.absoluteLocation(), UseTransforms));
</span><del>- int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toIntSize(localOffset));
</del><ins>+ int listIndex = downcast<RenderListBox>(*renderer()).listIndexAtOffset(toIntSize(localOffset));
</ins><span class="cx"> if (listIndex >= 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())->scrollToRevealElementAtListIndex(endIndex);
</del><ins>+ downcast<RenderListBox>(*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<RenderMenuList>(renderer()))
</ins><span class="cx"> menuList->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->renderBox()) {
</span><del>- if (box->isListBox())
- scrollableArea = toRenderListBox(box);
</del><ins>+ if (is<RenderListBox>(*box))
+ scrollableArea = downcast<RenderListBox>(box);
</ins><span class="cx"> else
</span><span class="cx"> scrollableArea = box->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->clearKnownToHaveNoOverflow();
</span><span class="cx"> } else if (!child->renderer().isLineBreak() && (childStyle.boxShadow() || child->boxModelObject()->hasSelfPaintingLayer()
</span><del>- || (child->renderer().isListMarker() && !toRenderListMarker(child->renderer()).isInside())
</del><ins>+ || (is<RenderListMarker>(child->renderer()) && !downcast<RenderListMarker>(child->renderer()).isInside())
</ins><span class="cx"> || childStyle.hasBorderImageOutsets()))
</span><span class="cx"> child->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->renderer().isListMarker() || toRenderListMarker(child->renderer()).isInside()) {
</del><ins>+ } else if (!is<RenderListMarker>(child->renderer()) || downcast<RenderListMarker>(child->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->boxModelObject()->marginLeft() : child->boxModelObject()->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 == "list-item") {
</span><del>- if (renderer.isListItem()) {
- if (toRenderListItem(renderer).hasExplicitValue()) {
- value = toRenderListItem(renderer).explicitValue();
</del><ins>+ if (is<RenderListItem>(renderer)) {
+ if (downcast<RenderListItem>(renderer).hasExplicitValue()) {
+ value = downcast<RenderListItem>(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<Scrollbar> 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 ? &item->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->renderer();
- if (renderer && renderer->isListItem())
- return toRenderListItem(renderer);
</del><ins>+ RenderElement* renderer = current->renderer();
+ if (is<RenderListItem>(renderer))
+ return downcast<RenderListItem>(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 = &item->element();
</span><span class="cx"> for (current = ElementTraversal::previousIncludingPseudo(current, listNode); current; current = ElementTraversal::previousIncludingPseudo(current, listNode)) {
</span><del>- RenderObject* renderer = current->renderer();
- if (!renderer || (renderer && !renderer->isListItem()))
</del><ins>+ RenderElement* renderer = current->renderer();
+ if (!is<RenderListItem>(renderer))
</ins><span class="cx"> continue;
</span><del>- Node* otherList = enclosingList(toRenderListItem(renderer));
</del><ins>+ Element* otherList = enclosingList(downcast<RenderListItem>(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<RenderListItem>(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& 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<Element> elementRef(element);
</span><span class="cx"> element->document().updateLayout();
</span><span class="cx">
</span><del>- RenderObject* renderer = element->renderer();
- if (!renderer || !renderer->isListItem())
</del><ins>+ RenderElement* renderer = element->renderer();
+ if (!is<RenderListItem>(renderer))
</ins><span class="cx"> return String();
</span><span class="cx">
</span><del>- return toRenderListItem(renderer)->markerText();
</del><ins>+ return downcast<RenderListItem>(*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<RenderStyle> style = cloneRenderStyleWithState(listMarkerRenderer->style());
</span><span class="cx"> style->setFontDescription(fontDescription);
</span><span class="cx"> style->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
</span><del>- toRenderListMarker(*listMarkerRenderer).setStyle(style.releaseNonNull());
</del><ins>+ downcast<RenderListMarker>(*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()->isListMarker()) {
</del><ins>+ if (is<RenderListMarker>(*m_current.renderer())) {
</ins><span class="cx"> if (m_blockStyle.collapseWhiteSpace() && 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<RenderListMarker>(*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()->isRubyRun())
- m_width.applyOverhang(toRenderRubyRun(m_current.renderer()), m_lastObject, m_nextObject);
</del><ins>+ if (is<RenderRubyRun>(*m_current.renderer()))
+ m_width.applyOverhang(downcast<RenderRubyRun>(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()->isFloatingOrOutOfFlowPositioned()) {
</span><span class="cx"> m_lastObject = m_current.renderer();
</span><del>- if (m_lastObject->isReplaced() && m_autoWrap && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!m_lastObject->isListMarker() || toRenderListMarker(*m_lastObject).isInside())) {
</del><ins>+ if (m_lastObject->isReplaced() && m_autoWrap && (!m_lastObject->isImage() || m_allowImagesToBreak) && (!is<RenderListMarker>(*m_lastObject) || downcast<RenderListMarker>(*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& select = downcast<HTMLSelectElement>(*node);
</span><span class="cx">
</span><del>- auto renderer = select.renderer();
- if (!renderer->isMenuList())
</del><ins>+ auto* renderer = select.renderer();
+ ASSERT(renderer);
+ if (!is<RenderMenuList>(*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->popupIsVisible();
</del><ins>+ return downcast<RenderMenuList>(*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>