<!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>[174898] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174898">174898</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-20 12:08:40 -0700 (Mon, 20 Oct 2014)</dd>
</dl>

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

Reviewed by Darin Adler.

Source/WebCore:

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

No new tests, no behavior change.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedImageMapUIElement):
(WebCore::AXObjectCache::notificationPostTimerFired):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addTableCellChild):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::parentTable):
(WebCore::AccessibilityARIAGridCell::rowIndexRange):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::disclosedRows):
(WebCore::AccessibilityARIAGridRow::disclosedByRow):
(WebCore::AccessibilityARIAGridRow::parentTable):
* accessibility/AccessibilityARIAGridRow.h:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
* accessibility/AccessibilityImageMapLink.h:
* accessibility/AccessibilityList.h:
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::setSelectedChildren):
(WebCore::AccessibilityListBox::selectedChildren):
(WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject):
* accessibility/AccessibilityListBox.h:
* accessibility/AccessibilityListBoxOption.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::addChildren):
(WebCore::AccessibilityMenuList::didUpdateActiveOption):
* accessibility/AccessibilityMenuList.h:
* accessibility/AccessibilityMenuListOption.h:
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
* accessibility/AccessibilityMenuListPopup.h:
* accessibility/AccessibilityMockObject.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::appendChildrenToArray):
(WebCore::AccessibilityObject::scrollViewAncestor):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
(WebCore::AccessibilityRenderObject::addImageMapChildren):
(WebCore::AccessibilityRenderObject::addTextFieldChildren):
(WebCore::AccessibilityRenderObject::remoteSVGRootElement):
(WebCore::AccessibilityRenderObject::ariaSelectedRows):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySVGRoot.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::addChildScrollbar):
* accessibility/AccessibilityScrollView.h:
* accessibility/AccessibilityScrollbar.h:
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::addChildren):
* accessibility/AccessibilitySlider.h:
* accessibility/AccessibilitySpinButton.cpp:
(WebCore::AccessibilitySpinButton::addChildren):
(WebCore::AccessibilitySpinButtonPart::press):
* accessibility/AccessibilitySpinButton.h:
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::addChildrenFromSection):
(WebCore::AccessibilityTable::headerContainer):
(WebCore::AccessibilityTable::columnHeaders):
(WebCore::AccessibilityTable::rowHeaders):
(WebCore::AccessibilityTable::cellForColumnAndRow):
* accessibility/AccessibilityTable.h:
Make isAccessibilityTable() public and mark as final so that callers
can benefit from tighter typing, as isAccessibilityTable() is
stricter than isTable(). isTable() indicates that the object is an
AccessibilityTable and is equivalent to is&lt;AccessibilityTable&gt;(object).
isAccessibilityTable() is equivalent to &quot;isTable() &amp;&amp; renderer()&quot;.

* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable):
* accessibility/AccessibilityTableCell.h:
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
(WebCore::AccessibilityTableColumn::addChildren):
* accessibility/AccessibilityTableColumn.h:
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::addChildren):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::parentTable):
(WebCore::AccessibilityTableRow::headerObject):
* accessibility/AccessibilityTableRow.h:
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(webkitAccessibleSelectionClearSelection):
(webkitAccessibleSelectionSelectAllSelection):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(core):
(cell):
(cellAtIndex):
(webkitAccessibleTableGetIndexAt):
(webkitAccessibleTableGetNColumns):
(webkitAccessibleTableGetNRows):
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(webkitAccessibleTableCellGetColumnHeaderCells):
(webkitAccessibleTableCellGetRowHeaderCells):
(webkitAccessibleTableCellGetColumnSpan):
(webkitAccessibleTableCellGetRowSpan):
(webkitAccessibleTableCellGetPosition):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetElement):
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper scrollViewParent]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
(-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* rendering/RenderMenuList.cpp:
(RenderMenuList::didUpdateActiveOption):

Source/WebKit/win:

Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects.

* AccessibleBase.cpp:
(AccessibleBase::accSelect):
* AccessibleImage.cpp:
(AccessibleImage::name):

Source/WTF:

Remove the legacy TYPE_CASTS_BASE() macro now that it is no longer
used.

* wtf/Assertions.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfAssertionsh">trunk/Source/WTF/wtf/Assertions.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridCellcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowh">trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkcpp">trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkh">trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListh">trunk/Source/WebCore/accessibility/AccessibilityList.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp">trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxh">trunk/Source/WebCore/accessibility/AccessibilityListBox.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListBoxOptionh">trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListh">trunk/Source/WebCore/accessibility/AccessibilityMenuList.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListOptionh">trunk/Source/WebCore/accessibility/AccessibilityMenuListOption.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListPopupcpp">trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMenuListPopuph">trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityMockObjecth">trunk/Source/WebCore/accessibility/AccessibilityMockObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth">trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjecth">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySVGRooth">trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityScrollViewcpp">trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityScrollViewh">trunk/Source/WebCore/accessibility/AccessibilityScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityScrollbarh">trunk/Source/WebCore/accessibility/AccessibilityScrollbar.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySlidercpp">trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySliderh">trunk/Source/WebCore/accessibility/AccessibilitySlider.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySpinButtoncpp">trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySpinButtonh">trunk/Source/WebCore/accessibility/AccessibilitySpinButton.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTablecpp">trunk/Source/WebCore/accessibility/AccessibilityTable.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableh">trunk/Source/WebCore/accessibility/AccessibilityTable.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp">trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableCellh">trunk/Source/WebCore/accessibility/AccessibilityTableCell.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp">trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableColumnh">trunk/Source/WebCore/accessibility/AccessibilityTableColumn.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableHeaderContainercpp">trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp">trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableRowh">trunk/Source/WebCore/accessibility/AccessibilityTableRow.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceSelectioncpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTablecpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTableCellcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityiosAccessibilityObjectIOSmm">trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm">trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkSourceWebKitwinAccessibleBasecpp">trunk/Source/WebKit/win/AccessibleBase.cpp</a></li>
<li><a href="#trunkSourceWebKitwinAccessibleImagecpp">trunk/Source/WebKit/win/AccessibleImage.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WTF/ChangeLog        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-10-20  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects
+        https://bugs.webkit.org/show_bug.cgi?id=137286
+
+        Reviewed by Darin Adler.
+
+        Remove the legacy TYPE_CASTS_BASE() macro now that it is no longer
+        used.
+
+        * wtf/Assertions.h:
+
</ins><span class="cx"> 2014-10-18  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WorkQueue dispatches functions but isn’t a FunctionDispatcher
</span></span></pre></div>
<a id="trunkSourceWTFwtfAssertionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Assertions.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Assertions.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WTF/wtf/Assertions.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -382,32 +382,4 @@
</span><span class="cx"> #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-/* TYPE CAST */
-
-// FIXME: This macro should be removed once the code base is ported to using
-// the new SPECIALIZE_TYPE_TRAITS_*() macro.
-#define TYPE_CASTS_BASE(ToClassName, argumentType, argumentName, pointerPredicate, referencePredicate) \
-inline ToClassName* to##ToClassName(argumentType* argumentName) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \
-    return static_cast&lt;ToClassName*&gt;(argumentName); \
-} \
-inline const ToClassName* to##ToClassName(const argumentType* argumentName) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \
-    return static_cast&lt;const ToClassName*&gt;(argumentName); \
-} \
-inline ToClassName&amp; to##ToClassName(argumentType&amp; argumentName) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
-    return static_cast&lt;ToClassName&amp;&gt;(argumentName); \
-} \
-inline const ToClassName&amp; to##ToClassName(const argumentType&amp; argumentName) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
-    return static_cast&lt;const ToClassName&amp;&gt;(argumentName); \
-} \
-void to##ToClassName(const ToClassName*); \
-void to##ToClassName(const ToClassName&amp;);
-
</del><span class="cx"> #endif /* WTF_Assertions_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/ChangeLog        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1,3 +1,142 @@
</span><ins>+2014-10-20  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects
+        https://bugs.webkit.org/show_bug.cgi?id=137286
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects and clean up the
+        surrounding code.
+
+        No new tests, no behavior change.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::focusedImageMapUIElement):
+        (WebCore::AXObjectCache::notificationPostTimerFired):
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addTableCellChild):
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityARIAGridCell.cpp:
+        (WebCore::AccessibilityARIAGridCell::parentTable):
+        (WebCore::AccessibilityARIAGridCell::rowIndexRange):
+        * accessibility/AccessibilityARIAGridRow.cpp:
+        (WebCore::AccessibilityARIAGridRow::disclosedRows):
+        (WebCore::AccessibilityARIAGridRow::disclosedByRow):
+        (WebCore::AccessibilityARIAGridRow::parentTable):
+        * accessibility/AccessibilityARIAGridRow.h:
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
+        * accessibility/AccessibilityImageMapLink.h:
+        * accessibility/AccessibilityList.h:
+        * accessibility/AccessibilityListBox.cpp:
+        (WebCore::AccessibilityListBox::setSelectedChildren):
+        (WebCore::AccessibilityListBox::selectedChildren):
+        (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject):
+        * accessibility/AccessibilityListBox.h:
+        * accessibility/AccessibilityListBoxOption.h:
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::addChildren):
+        (WebCore::AccessibilityMenuList::didUpdateActiveOption):
+        * accessibility/AccessibilityMenuList.h:
+        * accessibility/AccessibilityMenuListOption.h:
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
+        * accessibility/AccessibilityMenuListPopup.h:
+        * accessibility/AccessibilityMockObject.h:
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::textUnderElement):
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::appendChildrenToArray):
+        (WebCore::AccessibilityObject::scrollViewAncestor):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::getDocumentLinks):
+        (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
+        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
+        (WebCore::AccessibilityRenderObject::addImageMapChildren):
+        (WebCore::AccessibilityRenderObject::addTextFieldChildren):
+        (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
+        (WebCore::AccessibilityRenderObject::ariaSelectedRows):
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/AccessibilitySVGRoot.h:
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::addChildScrollbar):
+        * accessibility/AccessibilityScrollView.h:
+        * accessibility/AccessibilityScrollbar.h:
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore::AccessibilitySlider::addChildren):
+        * accessibility/AccessibilitySlider.h:
+        * accessibility/AccessibilitySpinButton.cpp:
+        (WebCore::AccessibilitySpinButton::addChildren):
+        (WebCore::AccessibilitySpinButtonPart::press):
+        * accessibility/AccessibilitySpinButton.h:
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::addChildren):
+        (WebCore::AccessibilityTable::addChildrenFromSection):
+        (WebCore::AccessibilityTable::headerContainer):
+        (WebCore::AccessibilityTable::columnHeaders):
+        (WebCore::AccessibilityTable::rowHeaders):
+        (WebCore::AccessibilityTable::cellForColumnAndRow):
+        * accessibility/AccessibilityTable.h:
+        Make isAccessibilityTable() public and mark as final so that callers
+        can benefit from tighter typing, as isAccessibilityTable() is
+        stricter than isTable(). isTable() indicates that the object is an
+        AccessibilityTable and is equivalent to is&lt;AccessibilityTable&gt;(object).
+        isAccessibilityTable() is equivalent to &quot;isTable() &amp;&amp; renderer()&quot;.
+
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::parentTable):
+        * accessibility/AccessibilityTableCell.h:
+        * accessibility/AccessibilityTableColumn.cpp:
+        (WebCore::AccessibilityTableColumn::headerObject):
+        (WebCore::AccessibilityTableColumn::addChildren):
+        * accessibility/AccessibilityTableColumn.h:
+        * accessibility/AccessibilityTableHeaderContainer.cpp:
+        (WebCore::AccessibilityTableHeaderContainer::addChildren):
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::parentTable):
+        (WebCore::AccessibilityTableRow::headerObject):
+        * accessibility/AccessibilityTableRow.h:
+        * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
+        (webkitAccessibleSelectionClearSelection):
+        (webkitAccessibleSelectionSelectAllSelection):
+        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
+        (core):
+        (cell):
+        (cellAtIndex):
+        (webkitAccessibleTableGetIndexAt):
+        (webkitAccessibleTableGetNColumns):
+        (webkitAccessibleTableGetNRows):
+        (webkitAccessibleTableGetColumnHeader):
+        (webkitAccessibleTableGetRowHeader):
+        * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
+        (webkitAccessibleTableCellGetColumnHeaderCells):
+        (webkitAccessibleTableCellGetRowHeaderCells):
+        (webkitAccessibleTableCellGetColumnSpan):
+        (webkitAccessibleTableCellGetRowSpan):
+        (webkitAccessibleTableCellGetPosition):
+        * accessibility/ios/AccessibilityObjectIOS.mm:
+        (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
+        (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (AXAttributeStringSetElement):
+        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
+        (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
+        (-[WebAccessibilityObjectWrapper subrole]):
+        (-[WebAccessibilityObjectWrapper roleDescription]):
+        (-[WebAccessibilityObjectWrapper scrollViewParent]):
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+        (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
+        (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::didUpdateActiveOption):
+
</ins><span class="cx"> 2014-10-20  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Generate all Inspector domains together in JavaScriptCore
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -159,10 +159,10 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="cx">     for (const auto&amp; child : axRenderImage-&gt;children()) {
</span><del>-        if (!child-&gt;isImageMapLink())
</del><ins>+        if (!is&lt;AccessibilityImageMapLink&gt;(*child))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        if (toAccessibilityImageMapLink(child.get())-&gt;areaElement() == areaElement)
</del><ins>+        if (downcast&lt;AccessibilityImageMapLink&gt;(*child).areaElement() == areaElement)
</ins><span class="cx">             return child.get();
</span><span class="cx">     }    
</span><span class="cx">     
</span><span class="lines">@@ -720,10 +720,8 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         // Make sure none of the render views are in the process of being layed out.
</span><span class="cx">         // Notifications should only be sent after the renderer has finished
</span><del>-        if (obj-&gt;isAccessibilityRenderObject()) {
-            AccessibilityRenderObject* renderObj = toAccessibilityRenderObject(obj);
-            RenderObject* renderer = renderObj-&gt;renderer();
-            if (renderer)
</del><ins>+        if (is&lt;AccessibilityRenderObject&gt;(*obj)) {
+            if (auto* renderer = downcast&lt;AccessibilityRenderObject&gt;(*obj).renderer())
</ins><span class="cx">                 ASSERT(!renderer-&gt;view().layoutState());
</span><span class="cx">         }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -55,29 +55,29 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityARIAGrid::addTableCellChild(AccessibilityObject* child, HashSet&lt;AccessibilityObject*&gt;&amp; appendedRows, unsigned&amp; columnCount)
</span><span class="cx"> {
</span><del>-    if (!child || (!child-&gt;isTableRow() &amp;&amp; child-&gt;ariaRoleAttribute() != RowRole))
</del><ins>+    if (!child || (!is&lt;AccessibilityTableRow&gt;(*child) &amp;&amp; !is&lt;AccessibilityARIAGridRow&gt;(*child)))
</ins><span class="cx">         return false;
</span><span class="cx">         
</span><del>-    AccessibilityTableRow* row = toAccessibilityTableRow(child);
-    if (appendedRows.contains(row))
</del><ins>+    auto&amp; row = downcast&lt;AccessibilityTableRow&gt;(*child);
+    if (appendedRows.contains(&amp;row))
</ins><span class="cx">         return false;
</span><span class="cx">         
</span><span class="cx">     // store the maximum number of columns
</span><del>-    unsigned rowCellCount = row-&gt;children().size();
</del><ins>+    unsigned rowCellCount = row.children().size();
</ins><span class="cx">     if (rowCellCount &gt; columnCount)
</span><span class="cx">         columnCount = rowCellCount;
</span><span class="cx">     
</span><del>-    row-&gt;setRowIndex((int)m_rows.size());        
-    m_rows.append(row);
</del><ins>+    row.setRowIndex((int)m_rows.size());
+    m_rows.append(&amp;row);
</ins><span class="cx"> 
</span><span class="cx">     // Try adding the row if it's not ignoring accessibility,
</span><span class="cx">     // otherwise add its children (the cells) as the grid's children.
</span><del>-    if (!row-&gt;accessibilityIsIgnored())
-        m_children.append(row);
</del><ins>+    if (!row.accessibilityIsIgnored())
+        m_children.append(&amp;row);
</ins><span class="cx">     else
</span><del>-        m_children.appendVector(row-&gt;children());
</del><ins>+        m_children.appendVector(row.children());
</ins><span class="cx"> 
</span><del>-    appendedRows.add(row);
</del><ins>+    appendedRows.add(&amp;row);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -134,12 +134,12 @@
</span><span class="cx">     
</span><span class="cx">     // make the columns based on the number of columns in the first body
</span><span class="cx">     for (unsigned i = 0; i &lt; columnCount; ++i) {
</span><del>-        AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache-&gt;getOrCreate(ColumnRole));
-        column-&gt;setColumnIndex((int)i);
-        column-&gt;setParent(this);
-        m_columns.append(column);
-        if (!column-&gt;accessibilityIsIgnored())
-            m_children.append(column);
</del><ins>+        auto&amp; column = downcast&lt;AccessibilityTableColumn&gt;(*axCache-&gt;getOrCreate(ColumnRole));
+        column.setColumnIndex(static_cast&lt;int&gt;(i));
+        column.setParent(this);
+        m_columns.append(&amp;column);
+        if (!column.accessibilityIsIgnored())
+            m_children.append(&amp;column);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     AccessibilityObject* headerContainerObject = headerContainer();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="cx">     if (parent-&gt;isAccessibilityTable())
</span><del>-        return toAccessibilityTable(parent);
</del><ins>+        return downcast&lt;AccessibilityTable&gt;(parent);
</ins><span class="cx"> 
</span><span class="cx">     // It could happen that we hadn't reached the parent table yet (in
</span><span class="cx">     // case objects for rows were not ignoring accessibility) so for
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     if (!parent || !parent-&gt;isAccessibilityTable())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    return toAccessibilityTable(parent);
</del><ins>+    return downcast&lt;AccessibilityTable&gt;(parent);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void AccessibilityARIAGridCell::rowIndexRange(std::pair&lt;unsigned, unsigned&gt;&amp; rowRange)
</span><span class="lines">@@ -74,13 +74,13 @@
</span><span class="cx">     if (!parent)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (parent-&gt;isTableRow()) {
</del><ins>+    if (is&lt;AccessibilityTableRow&gt;(*parent)) {
</ins><span class="cx">         // We already got a table row, use its API.
</span><del>-        rowRange.first = toAccessibilityTableRow(parent)-&gt;rowIndex();
</del><ins>+        rowRange.first = downcast&lt;AccessibilityTableRow&gt;(*parent).rowIndex();
</ins><span class="cx">     } else if (parent-&gt;isAccessibilityTable()) {
</span><span class="cx">         // We reached the parent table, so we need to inspect its
</span><span class="cx">         // children to determine the row index for the cell in it.
</span><del>-        unsigned columnCount = toAccessibilityTable(parent)-&gt;columnCount();
</del><ins>+        unsigned columnCount = downcast&lt;AccessibilityTable&gt;(*parent).columnCount();
</ins><span class="cx">         if (!columnCount)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     unsigned level = hierarchicalLevel();
</span><del>-    auto&amp; allRows = toAccessibilityTable(parent)-&gt;rows();
</del><ins>+    auto&amp; allRows = downcast&lt;AccessibilityTable&gt;(*parent).rows();
</ins><span class="cx">     int rowCount = allRows.size();
</span><span class="cx">     for (int k = index + 1; k &lt; rowCount; ++k) {
</span><span class="cx">         AccessibilityObject* row = allRows[k].get();
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     
</span><span class="cx">     // Search for the previous row that matches the correct level.
</span><span class="cx">     int index = rowIndex();
</span><del>-    auto&amp; allRows = toAccessibilityTable(parent)-&gt;rows();
</del><ins>+    auto&amp; allRows = downcast&lt;AccessibilityTable&gt;(parent)-&gt;rows();
</ins><span class="cx">     int rowCount = allRows.size();
</span><span class="cx">     if (index &gt;= rowCount)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -120,8 +120,8 @@
</span><span class="cx">     // only have &quot;row&quot; elements, but if not, we still should handle it gracefully by finding the right table.
</span><span class="cx">     for (AccessibilityObject* parent = parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><span class="cx">         // The parent table for an ARIA grid row should be an ARIA table.
</span><del>-        if (parent-&gt;isTable() &amp;&amp; parent-&gt;isAccessibilityTable() &amp;&amp; toAccessibilityTable(parent)-&gt;isAriaTable())
-            return toAccessibilityTable(parent);
</del><ins>+        if (parent-&gt;isAccessibilityTable() &amp;&amp; downcast&lt;AccessibilityTable&gt;(*parent).isAriaTable())
+            return downcast&lt;AccessibilityTable&gt;(parent);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -53,8 +53,8 @@
</span><span class="cx">     virtual AccessibilityTable* parentTable() const override;
</span><span class="cx"> }; 
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityARIAGridRow, isARIATreeGridRow())
-
</del><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityARIAGridRow, isARIATreeGridRow())
+
</ins><span class="cx"> #endif // AccessibilityARIAGridRow_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -140,8 +140,8 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RenderElement* renderer = nullptr;
</span><del>-    if (m_parent &amp;&amp; m_parent-&gt;isAccessibilityRenderObject())
-        renderer = downcast&lt;RenderElement&gt;(toAccessibilityRenderObject(m_parent)-&gt;renderer());
</del><ins>+    if (is&lt;AccessibilityRenderObject&gt;(m_parent))
+        renderer = downcast&lt;RenderElement&gt;(downcast&lt;AccessibilityRenderObject&gt;(*m_parent).renderer());
</ins><span class="cx">     else
</span><span class="cx">         renderer = m_mapElement-&gt;renderer();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityImageMapLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityImageMapLink.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -80,9 +80,9 @@
</span><span class="cx">     virtual bool isImageMapLink() const override { return true; }
</span><span class="cx">     virtual bool supportsPath() const override { return true; }
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityImageMapLink, isImageMapLink())
</del><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityImageMapLink, isImageMapLink())
+
</ins><span class="cx"> #endif // AccessibilityImageMapLink_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityList.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityList.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityList.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx">     virtual AccessibilityRole determineAccessibilityRole() override;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityList, isList())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityList, isList())
+
</ins><span class="cx"> #endif // AccessibilityList_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -92,16 +92,16 @@
</span><span class="cx">     
</span><span class="cx">     // disable any selected options
</span><span class="cx">     for (const auto&amp; child : m_children) {
</span><del>-        AccessibilityListBoxOption* listBoxOption = toAccessibilityListBoxOption(child.get());
-        if (listBoxOption-&gt;isSelected())
-            listBoxOption-&gt;setSelected(false);
</del><ins>+        auto&amp; listBoxOption = downcast&lt;AccessibilityListBoxOption&gt;(*child);
+        if (listBoxOption.isSelected())
+            listBoxOption.setSelected(false);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     for (const auto&amp; obj : children) {
</span><span class="cx">         if (obj-&gt;roleValue() != ListBoxOptionRole)
</span><span class="cx">             continue;
</span><span class="cx">                 
</span><del>-        toAccessibilityListBoxOption(obj.get())-&gt;setSelected(true);
</del><ins>+        downcast&lt;AccessibilityListBoxOption&gt;(*obj).setSelected(true);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">         addChildren();
</span><span class="cx">         
</span><span class="cx">     for (const auto&amp; child : m_children) {
</span><del>-        if (toAccessibilityListBoxOption(child.get())-&gt;isSelected())
</del><ins>+        if (downcast&lt;AccessibilityListBoxOption&gt;(*child).isSelected())
</ins><span class="cx">             result.append(child.get());
</span><span class="cx">     }    
</span><span class="cx"> }
</span><span class="lines">@@ -138,10 +138,10 @@
</span><span class="cx">     if (!element || element-&gt;hasTagName(hrTag))
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    AccessibilityObject* listBoxObject = m_renderer-&gt;document().axObjectCache()-&gt;getOrCreate(ListBoxOptionRole);
-    toAccessibilityListBoxOption(listBoxObject)-&gt;setHTMLElement(element);
</del><ins>+    AccessibilityObject&amp; listBoxObject = *m_renderer-&gt;document().axObjectCache()-&gt;getOrCreate(ListBoxOptionRole);
+    downcast&lt;AccessibilityListBoxOption&gt;(listBoxObject).setHTMLElement(element);
</ins><span class="cx">     
</span><del>-    return listBoxObject;
</del><ins>+    return &amp;listBoxObject;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> AccessibilityObject* AccessibilityListBox::elementAccessibilityHitTest(const IntPoint&amp; point) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBox.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBox.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBox.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -56,9 +56,9 @@
</span><span class="cx">     AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
</span><span class="cx">     virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&amp;) const override;
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityListBox, isListBox())
</del><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityListBox, isListBox())
+
</ins><span class="cx"> #endif // AccessibilityListBox_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListBoxOptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx">     AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
</span><span class="cx">     virtual bool computeAccessibilityIsIgnored() const override;
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityListBoxOption, isListBoxOption())
</del><span class="cx">     
</span><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityListBoxOption, isListBoxOption())
+
</ins><span class="cx"> #endif // AccessibilityListBoxOption_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     if (!list)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    toAccessibilityMockObject(list)-&gt;setParent(this);
</del><ins>+    downcast&lt;AccessibilityMockObject&gt;(*list).setParent(this);
</ins><span class="cx">     if (list-&gt;accessibilityIsIgnored()) {
</span><span class="cx">         cache-&gt;remove(list-&gt;axObjectID());
</span><span class="cx">         return;
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     const auto&amp; childObjects = children();
</span><span class="cx">     if (!childObjects.isEmpty()) {
</span><span class="cx">         ASSERT(childObjects.size() == 1);
</span><del>-        ASSERT(childObjects[0]-&gt;isMenuListPopup());
</del><ins>+        ASSERT(is&lt;AccessibilityMenuListPopup&gt;(*childObjects[0]));
</ins><span class="cx"> 
</span><span class="cx">         // We might be calling this method in situations where the renderers for list items
</span><span class="cx">         // associated to the menu list have not been created (e.g. they might be rendered
</span><span class="lines">@@ -121,10 +121,8 @@
</span><span class="cx">         // You can reproduce the issue in the GTK+ port by removing this check and running
</span><span class="cx">         // accessibility/insert-selected-option-into-select-causes-crash.html (will crash).
</span><span class="cx">         int popupChildrenSize = static_cast&lt;int&gt;(childObjects[0]-&gt;children().size());
</span><del>-        if (childObjects[0]-&gt;isMenuListPopup() &amp;&amp; optionIndex &gt;= 0 &amp;&amp; optionIndex &lt; popupChildrenSize) {
-            if (AccessibilityMenuListPopup* popup = toAccessibilityMenuListPopup(childObjects[0].get()))
-                popup-&gt;didUpdateActiveOption(optionIndex);
-        }
</del><ins>+        if (is&lt;AccessibilityMenuListPopup&gt;(*childObjects[0]) &amp;&amp; optionIndex &gt;= 0 &amp;&amp; optionIndex &lt; popupChildrenSize)
+            downcast&lt;AccessibilityMenuListPopup&gt;(*childObjects[0]).didUpdateActiveOption(optionIndex);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     cache-&gt;postNotification(this, &amp;document.get(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostSynchronously);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -55,8 +55,8 @@
</span><span class="cx">     virtual void childrenChanged() override;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityMenuList, isMenuList())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityMenuList, isMenuList())
+
</ins><span class="cx"> #endif // AccessibilityMenuList_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListOptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListOption.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuListOption.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListOption.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">     RefPtr&lt;HTMLElement&gt; m_element;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityMenuListOption, isMenuListOption())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityMenuListOption, isMenuListOption())
+
</ins><span class="cx"> #endif // AccessibilityMenuListOption_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListPopupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -73,13 +73,10 @@
</span><span class="cx">     if (!is&lt;HTMLOptionElement&gt;(element) || !element-&gt;inRenderedDocument())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    AccessibilityObject* object = document()-&gt;axObjectCache()-&gt;getOrCreate(MenuListOptionRole);
-    ASSERT_WITH_SECURITY_IMPLICATION(object-&gt;isMenuListOption());
</del><ins>+    auto&amp; option = downcast&lt;AccessibilityMenuListOption&gt;(*document()-&gt;axObjectCache()-&gt;getOrCreate(MenuListOptionRole));
+    option.setElement(element);
</ins><span class="cx"> 
</span><del>-    AccessibilityMenuListOption* option = toAccessibilityMenuListOption(object);
-    option-&gt;setElement(element);
-
-    return option;
</del><ins>+    return &amp;option;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityMenuListPopup::press()
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMenuListPopuph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">     AccessibilityMenuListOption* menuListOptionAccessibilityObject(HTMLElement*) const;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityMenuListPopup, isMenuListPopup())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityMenuListPopup, isMenuListPopup())
+
</ins><span class="cx"> #endif // AccessibilityMenuListPopup_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityMockObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityMockObject.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityMockObject.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityMockObject.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -51,10 +51,10 @@
</span><span class="cx">     virtual bool isMockObject() const override { return true; }
</span><span class="cx"> 
</span><span class="cx">     virtual bool computeAccessibilityIsIgnored() const override;
</span><del>-}; 
</del><ins>+};
</ins><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityMockObject, isMockObject())
-    
</del><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityMockObject, isMockObject())
+
</ins><span class="cx"> #endif // AccessibilityMockObject_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1669,9 +1669,9 @@
</span><span class="cx">         if (!shouldUseAccessiblityObjectInnerText(child, mode))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (child-&gt;isAccessibilityNodeObject()) {
</del><ins>+        if (is&lt;AccessibilityNodeObject&gt;(*child)) {
</ins><span class="cx">             Vector&lt;AccessibilityText&gt; textOrder;
</span><del>-            toAccessibilityNodeObject(child)-&gt;alternativeText(textOrder);
</del><ins>+            downcast&lt;AccessibilityNodeObject&gt;(*child).alternativeText(textOrder);
</ins><span class="cx">             if (textOrder.size() &gt; 0 &amp;&amp; textOrder[0].text.length()) {
</span><span class="cx">                 appendNameToStringBuilder(builder, textOrder[0].text);
</span><span class="cx">                 continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityNodeObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -207,8 +207,8 @@
</span><span class="cx">     bool usesAltTagForTextComputation() const;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityNodeObject, isAccessibilityNodeObject())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityNodeObject, isAccessibilityNodeObject())
+
</ins><span class="cx"> #endif // AccessibilityNodeObject_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx"> {
</span><span class="cx">     // A table's children includes elements whose own children are also the table's children (due to the way the Mac exposes tables).
</span><span class="cx">     // The rows from the table should be queried, since those are direct descendants of the table, and they contain content.
</span><del>-    const auto&amp; searchChildren = object-&gt;isAccessibilityTable() ? toAccessibilityTable(object)-&gt;rows() : object-&gt;children();
</del><ins>+    const auto&amp; searchChildren = object-&gt;isAccessibilityTable() ? downcast&lt;AccessibilityTable&gt;(*object).rows() : object-&gt;children();
</ins><span class="cx"> 
</span><span class="cx">     size_t childrenSize = searchChildren.size();
</span><span class="cx"> 
</span><span class="lines">@@ -1536,8 +1536,8 @@
</span><span class="cx"> ScrollView* AccessibilityObject::scrollViewAncestor() const
</span><span class="cx"> {
</span><span class="cx">     for (const AccessibilityObject* scrollParent = this; scrollParent; scrollParent = scrollParent-&gt;parentObject()) {
</span><del>-        if (scrollParent-&gt;isAccessibilityScrollView())
-            return toAccessibilityScrollView(scrollParent)-&gt;scrollView();
</del><ins>+        if (is&lt;AccessibilityScrollView&gt;(*scrollParent))
+            return downcast&lt;AccessibilityScrollView&gt;(*scrollParent).scrollView();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1005,9 +1005,11 @@
</span><span class="cx"> inline void AccessibilityObject::updateBackingStore() { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#define ACCESSIBILITY_OBJECT_TYPE_CASTS(ToValueTypeName, predicate) \
-    TYPE_CASTS_BASE(ToValueTypeName, AccessibilityObject, object, object-&gt;predicate, object.predicate)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#define SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+    static bool isType(const WebCore::AccessibilityObject&amp; object) { return object.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // AccessibilityObject_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1738,13 +1738,13 @@
</span><span class="cx">         } else {
</span><span class="cx">             Node* parent = curr-&gt;parentNode();
</span><span class="cx">             if (is&lt;HTMLAreaElement&gt;(*curr) &amp;&amp; is&lt;HTMLMapElement&gt;(parent)) {
</span><del>-                AccessibilityImageMapLink* areaObject = toAccessibilityImageMapLink(axObjectCache()-&gt;getOrCreate(ImageMapLinkRole));
</del><ins>+                auto&amp; areaObject = downcast&lt;AccessibilityImageMapLink&gt;(*axObjectCache()-&gt;getOrCreate(ImageMapLinkRole));
</ins><span class="cx">                 HTMLMapElement&amp; map = downcast&lt;HTMLMapElement&gt;(*parent);
</span><del>-                areaObject-&gt;setHTMLAreaElement(downcast&lt;HTMLAreaElement&gt;(curr));
-                areaObject-&gt;setHTMLMapElement(&amp;map);
-                areaObject-&gt;setParent(accessibilityParentForImageMap(&amp;map));
</del><ins>+                areaObject.setHTMLAreaElement(downcast&lt;HTMLAreaElement&gt;(curr));
+                areaObject.setHTMLMapElement(&amp;map);
+                areaObject.setParent(accessibilityParentForImageMap(&amp;map));
</ins><span class="cx"> 
</span><del>-                result.append(areaObject);
</del><ins>+                result.append(&amp;areaObject);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2328,7 +2328,7 @@
</span><span class="cx">     if (!renderer()-&gt;frame().selection().isFocusedAndActive() || renderer()-&gt;document().focusedElement() != element)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (toAccessibilityRenderObject(activeDescendant()) &amp;&amp; shouldNotifyActiveDescendant())
</del><ins>+    if (activeDescendant() &amp;&amp; shouldNotifyActiveDescendant())
</ins><span class="cx">         renderer()-&gt;document().axObjectCache()-&gt;postNotification(m_renderer, AXObjectCache::AXActiveDescendantChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2685,10 +2685,10 @@
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     for (AccessibilityObject* parent = parentObject(); parent; parent = parent-&gt;parentObject()) { 
</span><del>-        if (!parent-&gt;isAccessibilityRenderObject())
</del><ins>+        if (!is&lt;AccessibilityRenderObject&gt;(*parent))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        Node* node = toAccessibilityRenderObject(parent)-&gt;node();
</del><ins>+        Node* node = downcast&lt;AccessibilityRenderObject&gt;(*parent).node();
</ins><span class="cx">         if (!is&lt;Element&gt;(node))
</span><span class="cx">             continue;
</span><span class="cx">         
</span><span class="lines">@@ -2807,14 +2807,14 @@
</span><span class="cx">         // add an &lt;area&gt; element for this child if it has a link
</span><span class="cx">         if (!area.isLink())
</span><span class="cx">             continue;
</span><del>-        AccessibilityImageMapLink* areaObject = toAccessibilityImageMapLink(axObjectCache()-&gt;getOrCreate(ImageMapLinkRole));
-        areaObject-&gt;setHTMLAreaElement(&amp;area);
-        areaObject-&gt;setHTMLMapElement(map);
-        areaObject-&gt;setParent(this);
-        if (!areaObject-&gt;accessibilityIsIgnored())
-            m_children.append(areaObject);
</del><ins>+        auto&amp; areaObject = downcast&lt;AccessibilityImageMapLink&gt;(*axObjectCache()-&gt;getOrCreate(ImageMapLinkRole));
+        areaObject.setHTMLAreaElement(&amp;area);
+        areaObject.setHTMLMapElement(map);
+        areaObject.setParent(this);
+        if (!areaObject.accessibilityIsIgnored())
+            m_children.append(&amp;areaObject);
</ins><span class="cx">         else
</span><del>-            axObjectCache()-&gt;remove(areaObject-&gt;axObjectID());
</del><ins>+            axObjectCache()-&gt;remove(areaObject.axObjectID());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2837,10 +2837,11 @@
</span><span class="cx">     if (!spinButtonElement || !spinButtonElement-&gt;isSpinButtonElement())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    AccessibilitySpinButton* axSpinButton = toAccessibilitySpinButton(axObjectCache()-&gt;getOrCreate(SpinButtonRole));
-    axSpinButton-&gt;setSpinButtonElement(static_cast&lt;SpinButtonElement*&gt;(spinButtonElement));
-    axSpinButton-&gt;setParent(this);
-    m_children.append(axSpinButton);
</del><ins>+    auto&amp; axSpinButton = downcast&lt;AccessibilitySpinButton&gt;(*axObjectCache()-&gt;getOrCreate(SpinButtonRole));
+    // FIXME: We should use is&lt;&gt;() / downcast&lt;&gt;() for SpinButtonElement.
+    axSpinButton.setSpinButtonElement(static_cast&lt;SpinButtonElement*&gt;(spinButtonElement));
+    axSpinButton.setParent(this);
+    m_children.append(&amp;axSpinButton);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityRenderObject::isSVGImage() const
</span><span class="lines">@@ -2890,11 +2891,11 @@
</span><span class="cx"> 
</span><span class="cx">     // In order to connect the AX hierarchy from the SVG root element from the loaded resource
</span><span class="cx">     // the parent must be set, because there's no other way to get back to who created the image.
</span><del>-    ASSERT(rootSVGObject &amp;&amp; rootSVGObject-&gt;isAccessibilitySVGRoot());
-    if (!rootSVGObject-&gt;isAccessibilitySVGRoot())
</del><ins>+    ASSERT(rootSVGObject);
+    if (!is&lt;AccessibilitySVGRoot&gt;(*rootSVGObject))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    return toAccessibilitySVGRoot(rootSVGObject);
</del><ins>+    return downcast&lt;AccessibilitySVGRoot&gt;(rootSVGObject);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void AccessibilityRenderObject::addRemoteSVGChildren()
</span><span class="lines">@@ -3134,8 +3135,8 @@
</span><span class="cx">         AccessibilityChildrenVector allRows;
</span><span class="cx">         ariaTreeRows(allRows);
</span><span class="cx">         rowsIteration(allRows);
</span><del>-    } else if (isAccessibilityTable() &amp;&amp; toAccessibilityTable(this)-&gt;supportsSelectedRows())
-        rowsIteration(toAccessibilityTable(this)-&gt;rows());
</del><ins>+    } else if (isAccessibilityTable() &amp;&amp; downcast&lt;AccessibilityTable&gt;(*this).supportsSelectedRows())
+        rowsIteration(downcast&lt;AccessibilityTable&gt;(*this).rows());
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void AccessibilityRenderObject::ariaListboxSelectedChildren(AccessibilityChildrenVector&amp; result)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -338,8 +338,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityRenderObject, isAccessibilityRenderObject())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityRenderObject, isAccessibilityRenderObject())
+
</ins><span class="cx"> #endif // AccessibilityRenderObject_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySVGRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -49,9 +49,9 @@
</span><span class="cx">     virtual AccessibilityObject* parentObject() const override;
</span><span class="cx">     virtual bool isAccessibilitySVGRoot() const override { return true; }
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilitySVGRoot, isAccessibilitySVGRoot())
</del><span class="cx">     
</span><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilitySVGRoot, isAccessibilitySVGRoot())
+
</ins><span class="cx"> #endif // AccessibilitySVGRoot_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -151,10 +151,10 @@
</span><span class="cx">     if (!cache)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    AccessibilityScrollbar* scrollBarObject = toAccessibilityScrollbar(cache-&gt;getOrCreate(scrollbar));
-    scrollBarObject-&gt;setParent(this);
-    m_children.append(scrollBarObject);
-    return scrollBarObject;
</del><ins>+    auto&amp; scrollBarObject = downcast&lt;AccessibilityScrollbar&gt;(*cache-&gt;getOrCreate(scrollbar));
+    scrollBarObject.setParent(this);
+    m_children.append(&amp;scrollBarObject);
+    return &amp;scrollBarObject;
</ins><span class="cx"> }
</span><span class="cx">         
</span><span class="cx"> void AccessibilityScrollView::clearChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollView.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityScrollView.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollView.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx">     RefPtr&lt;AccessibilityObject&gt; m_verticalScrollbar;
</span><span class="cx">     bool m_childrenDirty;
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityScrollView, isAccessibilityScrollView())
</del><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityScrollView, isAccessibilityScrollView())
+
</ins><span class="cx"> #endif // AccessibilityScrollView_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityScrollbarh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityScrollbar.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityScrollbar.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityScrollbar.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">     RefPtr&lt;Scrollbar&gt; m_scrollbar;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityScrollbar, isAccessibilityScrollbar())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityScrollbar, isAccessibilityScrollbar())
+
</ins><span class="cx"> #endif // AccessibilityScrollbar_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySlidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -84,15 +84,15 @@
</span><span class="cx"> 
</span><span class="cx">     AXObjectCache* cache = m_renderer-&gt;document().axObjectCache();
</span><span class="cx"> 
</span><del>-    AccessibilitySliderThumb* thumb = toAccessibilitySliderThumb(cache-&gt;getOrCreate(SliderThumbRole));
-    thumb-&gt;setParent(this);
</del><ins>+    auto&amp; thumb = downcast&lt;AccessibilitySliderThumb&gt;(*cache-&gt;getOrCreate(SliderThumbRole));
+    thumb.setParent(this);
</ins><span class="cx"> 
</span><span class="cx">     // Before actually adding the value indicator to the hierarchy,
</span><span class="cx">     // allow the platform to make a final decision about it.
</span><del>-    if (thumb-&gt;accessibilityIsIgnored())
-        cache-&gt;remove(thumb-&gt;axObjectID());
</del><ins>+    if (thumb.accessibilityIsIgnored())
+        cache-&gt;remove(thumb.axObjectID());
</ins><span class="cx">     else
</span><del>-        m_children.append(thumb);
</del><ins>+        m_children.append(&amp;thumb);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; AccessibilitySlider::getAttribute(const QualifiedName&amp; attribute) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySliderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySlider.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -84,8 +84,8 @@
</span><span class="cx">     virtual bool computeAccessibilityIsIgnored() const override;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilitySliderThumb, isSliderThumb())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilitySliderThumb, isSliderThumb())
+
</ins><span class="cx"> #endif // AccessibilitySlider_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySpinButtoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -82,15 +82,15 @@
</span><span class="cx"> {
</span><span class="cx">     m_haveChildren = true;
</span><span class="cx">     
</span><del>-    AccessibilitySpinButtonPart* incrementor = toAccessibilitySpinButtonPart(axObjectCache()-&gt;getOrCreate(SpinButtonPartRole));
-    incrementor-&gt;setIsIncrementor(true);
-    incrementor-&gt;setParent(this);
-    m_children.append(incrementor);
</del><ins>+    auto&amp; incrementor = downcast&lt;AccessibilitySpinButtonPart&gt;(*axObjectCache()-&gt;getOrCreate(SpinButtonPartRole));
+    incrementor.setIsIncrementor(true);
+    incrementor.setParent(this);
+    m_children.append(&amp;incrementor);
</ins><span class="cx"> 
</span><del>-    AccessibilitySpinButtonPart* decrementor = toAccessibilitySpinButtonPart(axObjectCache()-&gt;getOrCreate(SpinButtonPartRole));
-    decrementor-&gt;setIsIncrementor(false);
-    decrementor-&gt;setParent(this);
-    m_children.append(decrementor);
</del><ins>+    auto&amp; decrementor = downcast&lt;AccessibilitySpinButtonPart&gt;(*axObjectCache()-&gt;getOrCreate(SpinButtonPartRole));
+    decrementor.setIsIncrementor(false);
+    decrementor.setParent(this);
+    m_children.append(&amp;decrementor);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void AccessibilitySpinButton::step(int amount)
</span><span class="lines">@@ -132,14 +132,14 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilitySpinButtonPart::press()
</span><span class="cx"> {
</span><del>-    if (!m_parent || !m_parent-&gt;isSpinButton())
</del><ins>+    if (!is&lt;AccessibilitySpinButton&gt;(m_parent))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    AccessibilitySpinButton* spinButton = toAccessibilitySpinButton(parentObject());
</del><ins>+    auto&amp; spinButton = downcast&lt;AccessibilitySpinButton&gt;(*m_parent);
</ins><span class="cx">     if (m_isIncrementor)
</span><del>-        spinButton-&gt;step(1);
</del><ins>+        spinButton.step(1);
</ins><span class="cx">     else
</span><del>-        spinButton-&gt;step(-1);
</del><ins>+        spinButton.step(-1);
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySpinButtonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySpinButton.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySpinButton.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilitySpinButton.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -73,10 +73,10 @@
</span><span class="cx">     virtual bool isSpinButtonPart() const override { return true; }
</span><span class="cx">     virtual LayoutRect elementRect() const override;
</span><span class="cx"> };
</span><del>-
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilitySpinButton, isNativeSpinButton())
-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilitySpinButtonPart, isSpinButtonPart())
</del><span class="cx">     
</span><del>-} // namespace WebCore 
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilitySpinButton, isNativeSpinButton())
+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilitySpinButtonPart, isSpinButtonPart())
+
</ins><span class="cx"> #endif // AccessibilitySpinButton_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -379,12 +379,12 @@
</span><span class="cx">     // make the columns based on the number of columns in the first body
</span><span class="cx">     unsigned length = maxColumnCount;
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><del>-        AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache-&gt;getOrCreate(ColumnRole));
-        column-&gt;setColumnIndex((int)i);
-        column-&gt;setParent(this);
-        m_columns.append(column);
-        if (!column-&gt;accessibilityIsIgnored())
-            m_children.append(column);
</del><ins>+        auto&amp; column = downcast&lt;AccessibilityTableColumn&gt;(*axCache-&gt;getOrCreate(ColumnRole));
+        column.setColumnIndex((int)i);
+        column.setParent(this);
+        m_columns.append(&amp;column);
+        if (!column.accessibilityIsIgnored())
+            m_children.append(&amp;column);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     AccessibilityObject* headerContainerObject = headerContainer();
</span><span class="lines">@@ -407,25 +407,25 @@
</span><span class="cx">         if (!renderRow)
</span><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        AccessibilityObject* rowObject = axCache-&gt;getOrCreate(renderRow);
-        if (!rowObject-&gt;isTableRow())
</del><ins>+        AccessibilityObject&amp; rowObject = *axCache-&gt;getOrCreate(renderRow);
+        if (!is&lt;AccessibilityTableRow&gt;(rowObject))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        AccessibilityTableRow* row = toAccessibilityTableRow(rowObject);
</del><ins>+        auto&amp; row = downcast&lt;AccessibilityTableRow&gt;(rowObject);
</ins><span class="cx">         // We need to check every cell for a new row, because cell spans
</span><span class="cx">         // can cause us to miss rows if we just check the first column.
</span><del>-        if (appendedRows.contains(row))
</del><ins>+        if (appendedRows.contains(&amp;row))
</ins><span class="cx">             continue;
</span><span class="cx">         
</span><del>-        row-&gt;setRowIndex(static_cast&lt;int&gt;(m_rows.size()));
-        m_rows.append(row);
-        if (!row-&gt;accessibilityIsIgnored())
-            m_children.append(row);
</del><ins>+        row.setRowIndex(static_cast&lt;int&gt;(m_rows.size()));
+        m_rows.append(&amp;row);
+        if (!row.accessibilityIsIgnored())
+            m_children.append(&amp;row);
</ins><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL)
</span><span class="cx">         else
</span><del>-            m_children.appendVector(row-&gt;children());
</del><ins>+            m_children.appendVector(row.children());
</ins><span class="cx"> #endif
</span><del>-        appendedRows.add(row);
</del><ins>+        appendedRows.add(&amp;row);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     maxColumnCount = std::max(tableSection-&gt;numColumns(), maxColumnCount);
</span><span class="lines">@@ -436,10 +436,10 @@
</span><span class="cx">     if (m_headerContainer)
</span><span class="cx">         return m_headerContainer.get();
</span><span class="cx">     
</span><del>-    AccessibilityMockObject* tableHeader = toAccessibilityMockObject(axObjectCache()-&gt;getOrCreate(TableHeaderContainerRole));
-    tableHeader-&gt;setParent(this);
</del><ins>+    auto&amp; tableHeader = downcast&lt;AccessibilityMockObject&gt;(*axObjectCache()-&gt;getOrCreate(TableHeaderContainerRole));
+    tableHeader.setParent(this);
</ins><span class="cx"> 
</span><del>-    m_headerContainer = tableHeader;
</del><ins>+    m_headerContainer = &amp;tableHeader;
</ins><span class="cx">     return m_headerContainer.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -465,7 +465,7 @@
</span><span class="cx">     updateChildrenIfNecessary();
</span><span class="cx">     
</span><span class="cx">     for (const auto&amp; column : m_columns) {
</span><del>-        if (AccessibilityObject* header = toAccessibilityTableColumn(column.get())-&gt;headerObject())
</del><ins>+        if (AccessibilityObject* header = downcast&lt;AccessibilityTableColumn&gt;(*column).headerObject())
</ins><span class="cx">             headers.append(header);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -478,7 +478,7 @@
</span><span class="cx">     updateChildrenIfNecessary();
</span><span class="cx">     
</span><span class="cx">     for (const auto&amp; row : m_rows) {
</span><del>-        if (AccessibilityObject* header = toAccessibilityTableRow(row.get())-&gt;headerObject())
</del><ins>+        if (AccessibilityObject* header = downcast&lt;AccessibilityTableRow&gt;(*row).headerObject())
</ins><span class="cx">             headers.append(header);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -547,19 +547,19 @@
</span><span class="cx">         for (unsigned colIndexCounter = std::min(static_cast&lt;unsigned&gt;(children.size()), column + 1); colIndexCounter &gt; 0; --colIndexCounter) {
</span><span class="cx">             unsigned colIndex = colIndexCounter - 1;
</span><span class="cx">             AccessibilityObject* child = children[colIndex].get();
</span><del>-            ASSERT(child-&gt;isTableCell());
-            if (!child-&gt;isTableCell())
</del><ins>+            ASSERT(is&lt;AccessibilityTableCell&gt;(*child));
+            if (!is&lt;AccessibilityTableCell&gt;(*child))
</ins><span class="cx">                 continue;
</span><span class="cx">             
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; columnRange;
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; rowRange;
</span><del>-            AccessibilityTableCell* tableCellChild = toAccessibilityTableCell(child);
-            tableCellChild-&gt;columnIndexRange(columnRange);
-            tableCellChild-&gt;rowIndexRange(rowRange);
</del><ins>+            auto&amp; tableCellChild = downcast&lt;AccessibilityTableCell&gt;(*child);
+            tableCellChild.columnIndexRange(columnRange);
+            tableCellChild.rowIndexRange(rowRange);
</ins><span class="cx">             
</span><span class="cx">             if ((column &gt;= columnRange.first &amp;&amp; column &lt; (columnRange.first + columnRange.second))
</span><span class="cx">                 &amp;&amp; (row &gt;= rowRange.first &amp;&amp; row &lt; (rowRange.first + rowRange.second)))
</span><del>-                return tableCellChild;
</del><ins>+                return &amp;tableCellChild;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -75,6 +75,9 @@
</span><span class="cx">     // an object that contains, as children, all the objects that act as headers
</span><span class="cx">     AccessibilityObject* headerContainer();
</span><span class="cx"> 
</span><ins>+    // isAccessibilityTable is whether it is exposed as an AccessibilityTable to the platform.
+    virtual bool isAccessibilityTable() const override final;
+
</ins><span class="cx"> protected:
</span><span class="cx">     AccessibilityChildrenVector m_rows;
</span><span class="cx">     AccessibilityChildrenVector m_columns;
</span><span class="lines">@@ -86,8 +89,6 @@
</span><span class="cx"> 
</span><span class="cx">     // isTable is whether it's an AccessibilityTable object.
</span><span class="cx">     virtual bool isTable() const override { return true; }
</span><del>-    // isAccessibilityTable is whether it is exposed as an AccessibilityTable to the platform.
-    virtual bool isAccessibilityTable() const override;
</del><span class="cx">     // isDataTable is whether it is exposed as an AccessibilityTable because the heuristic
</span><span class="cx">     // think this &quot;looks&quot; like a data-based table (instead of a table used for layout).
</span><span class="cx">     virtual bool isDataTable() const override;
</span><span class="lines">@@ -101,8 +102,8 @@
</span><span class="cx">     void addChildrenFromSection(RenderTableSection*, unsigned&amp; maxColumnCount);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityTable, isTable())
-
</del><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTable, isTable())
+
</ins><span class="cx"> #endif // AccessibilityTable_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -89,9 +89,9 @@
</span><span class="cx">     // always be the case when AT clients access a table.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=42652
</span><span class="cx">     AccessibilityObject* parentTable = axObjectCache()-&gt;get(downcast&lt;RenderTableCell&gt;(*m_renderer).table());
</span><del>-    if (!parentTable || !parentTable-&gt;isTable())
</del><ins>+    if (!is&lt;AccessibilityTable&gt;(parentTable))
</ins><span class="cx">         return nullptr;
</span><del>-    return toAccessibilityTable(parentTable);
</del><ins>+    return downcast&lt;AccessibilityTable&gt;(parentTable);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityTableCell::isTableCell() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableCellh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -73,8 +73,8 @@
</span><span class="cx">     bool isTableCellInSameColGroup(AccessibilityTableCell*);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityTableCell, isTableCell())
-
</del><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTableCell, isTableCell())
+
</ins><span class="cx"> #endif // AccessibilityTableCell_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -79,8 +79,8 @@
</span><span class="cx">     if (!m_parent-&gt;isAccessibilityTable())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    AccessibilityTable* parentTable = toAccessibilityTable(m_parent);
-    if (parentTable-&gt;isAriaTable()) {
</del><ins>+    auto&amp; parentTable = downcast&lt;AccessibilityTable&gt;(*m_parent);
+    if (parentTable.isAriaTable()) {
</ins><span class="cx">         for (const auto&amp; cell : children()) {
</span><span class="cx">             if (cell-&gt;ariaRoleAttribute() == ColumnHeaderRole)
</span><span class="cx">                 return cell.get();
</span><span class="lines">@@ -173,11 +173,11 @@
</span><span class="cx">     if (!m_parent || !m_parent-&gt;isAccessibilityTable())
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    AccessibilityTable* parentTable = toAccessibilityTable(m_parent);
-    int numRows = parentTable-&gt;rowCount();
</del><ins>+    AccessibilityTable&amp; parentTable = downcast&lt;AccessibilityTable&gt;(*m_parent);
+    int numRows = parentTable.rowCount();
</ins><span class="cx">     
</span><del>-    for (int i = 0; i &lt; numRows; i++) {
-        AccessibilityTableCell* cell = parentTable-&gt;cellForColumnAndRow(m_columnIndex, i);
</del><ins>+    for (int i = 0; i &lt; numRows; ++i) {
+        AccessibilityTableCell* cell = parentTable.cellForColumnAndRow(m_columnIndex, i);
</ins><span class="cx">         if (!cell)
</span><span class="cx">             continue;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableColumnh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableColumn.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableColumn.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableColumn.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -66,8 +66,8 @@
</span><span class="cx">     virtual bool computeAccessibilityIsIgnored() const override;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityTableColumn, isTableColumn())
-
</del><span class="cx"> } // namespace WebCore 
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTableColumn, isTableColumn())
+
</ins><span class="cx"> #endif // AccessibilityTableColumn_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableHeaderContainercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     if (!m_parent || !m_parent-&gt;isAccessibilityTable())
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    toAccessibilityTable(m_parent)-&gt;columnHeaders(m_children);
</del><ins>+    downcast&lt;AccessibilityTable&gt;(*m_parent).columnHeaders(m_children);
</ins><span class="cx">     
</span><span class="cx">     for (const auto&amp; child : m_children)
</span><span class="cx">         m_headerRect.unite(child-&gt;elementRect());
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -106,8 +106,8 @@
</span><span class="cx">     for (AccessibilityObject* parent = parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><span class="cx">         // If this is a table object, but not an accessibility table, we should stop because we don't want to
</span><span class="cx">         // choose another ancestor table as this row's table.
</span><del>-        if (parent-&gt;isTable())
-            return parent-&gt;isAccessibilityTable() ? toAccessibilityTable(parent) : 0;
</del><ins>+        if (is&lt;AccessibilityTable&gt;(*parent))
+            return downcast&lt;AccessibilityTable&gt;(*parent).isAccessibilityTable() ? downcast&lt;AccessibilityTable&gt;(parent) : nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -124,10 +124,10 @@
</span><span class="cx">     
</span><span class="cx">     // check the first element in the row to see if it is a TH element
</span><span class="cx">     AccessibilityObject* cell = rowChildren[0].get();
</span><del>-    if (!cell-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(*cell))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderObject* cellRenderer = toAccessibilityTableCell(cell)-&gt;renderer();
</del><ins>+    RenderObject* cellRenderer = downcast&lt;AccessibilityTableCell&gt;(*cell).renderer();
</ins><span class="cx">     if (!cellRenderer)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableRowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableRow.h (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableRow.h        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableRow.h        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -64,10 +64,10 @@
</span><span class="cx">     
</span><span class="cx">     virtual AccessibilityObject* observableObject() const override;
</span><span class="cx">     virtual bool computeAccessibilityIsIgnored() const override;
</span><del>-}; 
</del><ins>+};
</ins><span class="cx"> 
</span><del>-ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityTableRow, isTableRow())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace WebCore 
</del><ins>+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTableRow, isTableRow())
</ins><span class="cx"> 
</span><span class="cx"> #endif // AccessibilityTableRow_h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -150,12 +150,12 @@
</span><span class="cx">         return FALSE;
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject::AccessibilityChildrenVector selectedItems;
</span><del>-    if (coreSelection-&gt;isListBox() || coreSelection-&gt;isMenuList()) {
</del><ins>+    if (is&lt;AccessibilityListBox&gt;(*coreSelection)) {
</ins><span class="cx">         // Set the list of selected items to an empty list; then verify that it worked.
</span><del>-        AccessibilityListBox* listBox = toAccessibilityListBox(coreSelection);
-        listBox-&gt;setSelectedChildren(selectedItems);
-        listBox-&gt;selectedChildren(selectedItems);
-        return !selectedItems.size();
</del><ins>+        auto&amp; listBox = downcast&lt;AccessibilityListBox&gt;(*coreSelection);
+        listBox.setSelectedChildren(selectedItems);
+        listBox.selectedChildren(selectedItems);
+        return selectedItems.isEmpty();
</ins><span class="cx">     }
</span><span class="cx">     return FALSE;
</span><span class="cx"> }
</span><span class="lines">@@ -246,12 +246,12 @@
</span><span class="cx">     if (!coreSelection || !coreSelection-&gt;isMultiSelectable())
</span><span class="cx">         return FALSE;
</span><span class="cx"> 
</span><del>-    if (coreSelection-&gt;isListBox()) {
</del><ins>+    if (is&lt;AccessibilityListBox&gt;(*coreSelection)) {
</ins><span class="cx">         const AccessibilityObject::AccessibilityChildrenVector&amp; children = coreSelection-&gt;children();
</span><del>-        AccessibilityListBox* listBox = toAccessibilityListBox(coreSelection);
-        listBox-&gt;setSelectedChildren(children);
</del><ins>+        AccessibilityListBox&amp; listBox = downcast&lt;AccessibilityListBox&gt;(*coreSelection);
+        listBox.setSelectedChildren(children);
</ins><span class="cx">         AccessibilityObject::AccessibilityChildrenVector selectedItems;
</span><del>-        listBox-&gt;selectedChildren(selectedItems);
</del><ins>+        listBox.selectedChildren(selectedItems);
</ins><span class="cx">         return selectedItems.size() == children.size();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> static AccessibilityObject* core(AtkTable* table)
</span><span class="cx"> {
</span><span class="cx">     if (!WEBKIT_IS_ACCESSIBLE(table))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(table));
</span><span class="cx"> }
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx"> static AccessibilityTableCell* cell(AtkTable* table, guint row, guint column)
</span><span class="cx"> {
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject())
-        return toAccessibilityTable(accTable)-&gt;cellForColumnAndRow(column, row);
-    return 0;
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable))
+        return downcast&lt;AccessibilityTable&gt;(*accTable).cellForColumnAndRow(column, row);
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static gint cellIndex(AccessibilityTableCell* axCell, AccessibilityTable* axTable)
</span><span class="lines">@@ -79,15 +79,13 @@
</span><span class="cx"> static AccessibilityTableCell* cellAtIndex(AtkTable* table, gint index)
</span><span class="cx"> {
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject()) {
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable)) {
</ins><span class="cx">         AccessibilityObject::AccessibilityChildrenVector allCells;
</span><del>-        toAccessibilityTable(accTable)-&gt;cells(allCells);
-        if (0 &lt;= index &amp;&amp; static_cast&lt;unsigned&gt;(index) &lt; allCells.size()) {
-            AccessibilityObject* accCell = allCells.at(index).get();
-            return toAccessibilityTableCell(accCell);
-        }
</del><ins>+        downcast&lt;AccessibilityTable&gt;(*accTable).cells(allCells);
+        if (0 &lt;= index &amp;&amp; static_cast&lt;unsigned&gt;(index) &lt; allCells.size())
+            return downcast&lt;AccessibilityTableCell&gt;(allCells[index].get());
</ins><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static AtkObject* webkitAccessibleTableRefAt(AtkTable* table, gint row, gint column)
</span><span class="lines">@@ -114,7 +112,7 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), -1);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityTableCell* axCell = cell(table, row, column);
</span><del>-    AccessibilityTable* axTable = toAccessibilityTable(core(table));
</del><ins>+    AccessibilityTable* axTable = downcast&lt;AccessibilityTable&gt;(core(table));
</ins><span class="cx">     return cellIndex(axCell, axTable);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -152,8 +150,8 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject())
-        return toAccessibilityTable(accTable)-&gt;columnCount();
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable))
+        return downcast&lt;AccessibilityTable&gt;(*accTable).columnCount();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -163,8 +161,8 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject())
-        return toAccessibilityTable(accTable)-&gt;rowCount();
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable))
+        return downcast&lt;AccessibilityTable&gt;(*accTable).rowCount();
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -202,18 +200,18 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject()) {
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable)) {
</ins><span class="cx">         AccessibilityObject::AccessibilityChildrenVector columnHeaders;
</span><del>-        toAccessibilityTable(accTable)-&gt;columnHeaders(columnHeaders);
</del><ins>+        downcast&lt;AccessibilityTable&gt;(*accTable).columnHeaders(columnHeaders);
</ins><span class="cx"> 
</span><span class="cx">         for (const auto&amp; columnHeader : columnHeaders) {
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; columnRange;
</span><del>-            toAccessibilityTableCell(columnHeader.get())-&gt;columnIndexRange(columnRange);
</del><ins>+            downcast&lt;AccessibilityTableCell&gt;(*columnHeader).columnIndexRange(columnRange);
</ins><span class="cx">             if (columnRange.first &lt;= static_cast&lt;unsigned&gt;(column) &amp;&amp; static_cast&lt;unsigned&gt;(column) &lt; columnRange.first + columnRange.second)
</span><span class="cx">                 return columnHeader-&gt;wrapper();
</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"> static AtkObject* webkitAccessibleTableGetRowHeader(AtkTable* table, gint row)
</span><span class="lines">@@ -222,18 +220,18 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(table), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* accTable = core(table);
</span><del>-    if (accTable-&gt;isAccessibilityRenderObject()) {
</del><ins>+    if (is&lt;AccessibilityTable&gt;(*accTable)) {
</ins><span class="cx">         AccessibilityObject::AccessibilityChildrenVector rowHeaders;
</span><del>-        toAccessibilityTable(accTable)-&gt;rowHeaders(rowHeaders);
</del><ins>+        downcast&lt;AccessibilityTable&gt;(*accTable).rowHeaders(rowHeaders);
</ins><span class="cx"> 
</span><span class="cx">         for (const auto&amp; rowHeader : rowHeaders) {
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; rowRange;
</span><del>-            toAccessibilityTableCell(rowHeader.get())-&gt;rowIndexRange(rowRange);
</del><ins>+            downcast&lt;AccessibilityTableCell&gt;(*rowHeader).rowIndexRange(rowRange);
</ins><span class="cx">             if (rowRange.first &lt;= static_cast&lt;unsigned&gt;(row) &amp;&amp; static_cast&lt;unsigned&gt;(row) &lt; rowRange.first + rowRange.second)
</span><span class="cx">                 return rowHeader-&gt;wrapper();
</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"> static AtkObject* webkitAccessibleTableGetCaption(AtkTable* table)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleInterfaceTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -54,11 +54,11 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(cell), nullptr);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* axObject = core(cell);
</span><del>-    if (!axObject || !axObject-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(axObject))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject::AccessibilityChildrenVector columnHeaders;
</span><del>-    toAccessibilityTableCell(axObject)-&gt;columnHeaders(columnHeaders);
</del><ins>+    downcast&lt;AccessibilityTableCell&gt;(*axObject).columnHeaders(columnHeaders);
</ins><span class="cx"> 
</span><span class="cx">     return convertToGPtrArray(columnHeaders);
</span><span class="cx"> }
</span><span class="lines">@@ -69,11 +69,11 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(cell), nullptr);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* axObject = core(cell);
</span><del>-    if (!axObject || !axObject-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(axObject))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject::AccessibilityChildrenVector rowHeaders;
</span><del>-    toAccessibilityTableCell(axObject)-&gt;rowHeaders(rowHeaders);
</del><ins>+    downcast&lt;AccessibilityTableCell&gt;(*axObject).rowHeaders(rowHeaders);
</ins><span class="cx"> 
</span><span class="cx">     return convertToGPtrArray(rowHeaders);
</span><span class="cx"> }
</span><span class="lines">@@ -84,11 +84,11 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(cell), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* axObject = core(cell);
</span><del>-    if (!axObject || !axObject-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(axObject))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     std::pair&lt;unsigned, unsigned&gt; columnRange;
</span><del>-    toAccessibilityTableCell(axObject)-&gt;columnIndexRange(columnRange);
</del><ins>+    downcast&lt;AccessibilityTableCell&gt;(*axObject).columnIndexRange(columnRange);
</ins><span class="cx"> 
</span><span class="cx">     return columnRange.second;
</span><span class="cx"> }
</span><span class="lines">@@ -99,11 +99,11 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(cell), 0);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* axObject = core(cell);
</span><del>-    if (!axObject || !axObject-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(axObject))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     std::pair&lt;unsigned, unsigned&gt; rowRange;
</span><del>-    toAccessibilityTableCell(axObject)-&gt;rowIndexRange(rowRange);
</del><ins>+    downcast&lt;AccessibilityTableCell&gt;(*axObject).rowIndexRange(rowRange);
</ins><span class="cx"> 
</span><span class="cx">     return rowRange.second;
</span><span class="cx"> }
</span><span class="lines">@@ -114,16 +114,16 @@
</span><span class="cx">     returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(cell), false);
</span><span class="cx"> 
</span><span class="cx">     AccessibilityObject* axObject = core(cell);
</span><del>-    if (!axObject || !axObject-&gt;isTableCell())
</del><ins>+    if (!is&lt;AccessibilityTableCell&gt;(axObject))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     std::pair&lt;unsigned, unsigned&gt; columnRowRange;
</span><span class="cx">     if (row) {
</span><del>-        toAccessibilityTableCell(axObject)-&gt;rowIndexRange(columnRowRange);
</del><ins>+        downcast&lt;AccessibilityTableCell&gt;(*axObject).rowIndexRange(columnRowRange);
</ins><span class="cx">         *row = columnRowRange.first;
</span><span class="cx">     }
</span><span class="cx">     if (column) {
</span><del>-        toAccessibilityTableCell(axObject)-&gt;columnIndexRange(columnRowRange);
</del><ins>+        downcast&lt;AccessibilityTableCell&gt;(*axObject).columnIndexRange(columnRowRange);
</ins><span class="cx">         *column = columnRowRange.first;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosAccessibilityObjectIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -62,9 +62,9 @@
</span><span class="cx"> {
</span><span class="cx">     if (!isPasswordField())
</span><span class="cx">         return 0;
</span><del>-    RenderObject* renderObject = toAccessibilityRenderObject(this)-&gt;renderer();
</del><ins>+    RenderObject* renderObject = downcast&lt;AccessibilityRenderObject&gt;(*this).renderer();
</ins><span class="cx">     
</span><del>-    if (!renderObject || !renderObject-&gt;node() || !renderObject-&gt;node()-&gt;isHTMLElement())
</del><ins>+    if (!renderObject || !is&lt;HTMLInputElement&gt;(renderObject-&gt;node()))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     HTMLInputElement&amp; inputElement = downcast&lt;HTMLInputElement&gt;(*renderObject-&gt;node());
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1114,8 +1114,8 @@
</span><span class="cx">         ScrollView* scrollView = nullptr;
</span><span class="cx">         AccessibilityObject* parent = nullptr;
</span><span class="cx">         for (parent = m_object-&gt;parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><del>-            if (parent-&gt;isAccessibilityScrollView()) {
-                scrollView = toAccessibilityScrollView(parent)-&gt;scrollView();
</del><ins>+            if (is&lt;AccessibilityScrollView&gt;(*parent)) {
+                scrollView = downcast&lt;AccessibilityScrollView&gt;(*parent).scrollView();
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -1168,8 +1168,8 @@
</span><span class="cx">         ScrollView* scrollView = nullptr;
</span><span class="cx">         AccessibilityObject* parent = nullptr;
</span><span class="cx">         for (parent = m_object-&gt;parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><del>-            if (parent-&gt;isAccessibilityScrollView()) {
-                scrollView = toAccessibilityScrollView(parent)-&gt;scrollView();
</del><ins>+            if (is&lt;AccessibilityScrollView&gt;(*parent)) {
+                scrollView = downcast&lt;AccessibilityScrollView&gt;(*parent).scrollView();
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -994,10 +994,10 @@
</span><span class="cx">     if (!AXAttributedStringRangeIsValid(attrString, range))
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    if (object &amp;&amp; object-&gt;isAccessibilityRenderObject()) {
</del><ins>+    if (is&lt;AccessibilityRenderObject&gt;(object)) {
</ins><span class="cx">         // make a serializable AX object
</span><span class="cx">         
</span><del>-        RenderObject* renderer = toAccessibilityRenderObject(object)-&gt;renderer();
</del><ins>+        RenderObject* renderer = downcast&lt;AccessibilityRenderObject&gt;(*object).renderer();
</ins><span class="cx">         if (!renderer)
</span><span class="cx">             return;
</span><span class="cx">         
</span><span class="lines">@@ -1199,7 +1199,7 @@
</span><span class="cx">     if (m_object-&gt;supportsARIADropping())
</span><span class="cx">         [additional addObject:NSAccessibilityDropEffectsAttribute];
</span><span class="cx">     
</span><del>-    if (m_object-&gt;isAccessibilityTable() &amp;&amp; toAccessibilityTable(m_object)-&gt;supportsSelectedRows())
</del><ins>+    if (m_object-&gt;isAccessibilityTable() &amp;&amp; downcast&lt;AccessibilityTable&gt;(*m_object).supportsSelectedRows())
</ins><span class="cx">         [additional addObject:NSAccessibilitySelectedRowsAttribute];
</span><span class="cx">     
</span><span class="cx">     if (m_object-&gt;supportsARIALiveRegion()) {
</span><span class="lines">@@ -1752,8 +1752,8 @@
</span><span class="cx">         ScrollView* scrollView = nullptr;
</span><span class="cx">         AccessibilityObject* parent = nullptr;
</span><span class="cx">         for (parent = m_object-&gt;parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><del>-            if (parent-&gt;isAccessibilityScrollView()) {
-                scrollView = toAccessibilityScrollView(parent)-&gt;scrollView();
</del><ins>+            if (is&lt;AccessibilityScrollView&gt;(*parent)) {
+                scrollView = downcast&lt;AccessibilityScrollView&gt;(*parent).scrollView();
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -1992,8 +1992,8 @@
</span><span class="cx">     if (m_object-&gt;roleValue() == HorizontalRuleRole)
</span><span class="cx">         return NSAccessibilityContentSeparatorSubrole;
</span><span class="cx">     
</span><del>-    if (m_object-&gt;isSpinButtonPart()) {
-        if (toAccessibilitySpinButtonPart(m_object)-&gt;isIncrementor())
</del><ins>+    if (is&lt;AccessibilitySpinButtonPart&gt;(*m_object)) {
+        if (downcast&lt;AccessibilitySpinButtonPart&gt;(*m_object).isIncrementor())
</ins><span class="cx">             return NSAccessibilityIncrementArrowSubrole;
</span><span class="cx">         
</span><span class="cx">         return NSAccessibilityDecrementArrowSubrole;
</span><span class="lines">@@ -2005,11 +2005,11 @@
</span><span class="cx">     if (m_object-&gt;isTreeItem())
</span><span class="cx">         return NSAccessibilityOutlineRowSubrole;
</span><span class="cx">     
</span><del>-    if (m_object-&gt;isList()) {
-        AccessibilityList* listObject = toAccessibilityList(m_object);
-        if (listObject-&gt;isUnorderedList() || listObject-&gt;isOrderedList())
</del><ins>+    if (is&lt;AccessibilityList&gt;(*m_object)) {
+        auto&amp; listObject = downcast&lt;AccessibilityList&gt;(*m_object);
+        if (listObject.isUnorderedList() || listObject.isOrderedList())
</ins><span class="cx">             return NSAccessibilityContentListSubrole;
</span><del>-        if (listObject-&gt;isDescriptionList()) {
</del><ins>+        if (listObject.isDescriptionList()) {
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 1090
</span><span class="cx">             return NSAccessibilityDefinitionListSubrole;
</span><span class="cx"> #else
</span><span class="lines">@@ -2179,9 +2179,8 @@
</span><span class="cx">     
</span><span class="cx">     // Only returning for DL (not UL or OL) because description changed with HTML5 from 'definition list' to
</span><span class="cx">     // superset 'description list' and does not return the same values in AX API on some OS versions. 
</span><del>-    if (m_object-&gt;isList()) {
-        AccessibilityList* listObject = toAccessibilityList(m_object);
-        if (listObject-&gt;isDescriptionList())
</del><ins>+    if (is&lt;AccessibilityList&gt;(*m_object)) {
+        if (downcast&lt;AccessibilityList&gt;(*m_object).isDescriptionList())
</ins><span class="cx">             return AXDescriptionListText();
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -2217,7 +2216,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (id)scrollViewParent
</span><span class="cx"> {
</span><del>-    if (!m_object || !m_object-&gt;isAccessibilityScrollView())
</del><ins>+    if (!is&lt;AccessibilityScrollView&gt;(m_object))
</ins><span class="cx">         return nil;
</span><span class="cx">     
</span><span class="cx">     // If this scroll view provides it's parent object (because it's a sub-frame), then
</span><span class="lines">@@ -2225,8 +2224,7 @@
</span><span class="cx">     if (m_object-&gt;parentObject())
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    AccessibilityScrollView* scrollView = toAccessibilityScrollView(m_object);
-    ScrollView* scroll = scrollView-&gt;scrollView();
</del><ins>+    ScrollView* scroll = downcast&lt;AccessibilityScrollView&gt;(*m_object).scrollView();
</ins><span class="cx">     if (!scroll)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><span class="lines">@@ -2333,7 +2331,7 @@
</span><span class="cx">     if (m_object-&gt;isWebArea()) {
</span><span class="cx">         if ([attributeName isEqualToString:@&quot;AXLinkUIElements&quot;]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector links;
</span><del>-            toAccessibilityRenderObject(m_object)-&gt;getDocumentLinks(links);
</del><ins>+            downcast&lt;AccessibilityRenderObject&gt;(*m_object).getDocumentLinks(links);
</ins><span class="cx">             return convertToNSArray(links);
</span><span class="cx">         }
</span><span class="cx">         if ([attributeName isEqualToString:@&quot;AXLoaded&quot;])
</span><span class="lines">@@ -2392,11 +2390,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Only native spin buttons have increment and decrement buttons.
</span><del>-    if (m_object-&gt;isNativeSpinButton()) {
</del><ins>+    if (is&lt;AccessibilitySpinButton&gt;(*m_object)) {
</ins><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityIncrementButtonAttribute])
</span><del>-            return toAccessibilitySpinButton(m_object)-&gt;incrementButton()-&gt;wrapper();
</del><ins>+            return downcast&lt;AccessibilitySpinButton&gt;(*m_object).incrementButton()-&gt;wrapper();
</ins><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityDecrementButtonAttribute])
</span><del>-            return toAccessibilitySpinButton(m_object)-&gt;decrementButton()-&gt;wrapper();
</del><ins>+            return downcast&lt;AccessibilitySpinButton&gt;(*m_object).decrementButton()-&gt;wrapper();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if ([attributeName isEqualToString: @&quot;AXVisited&quot;])
</span><span class="lines">@@ -2557,19 +2555,20 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (m_object-&gt;isAccessibilityTable()) {
</span><ins>+        auto&amp; table = downcast&lt;AccessibilityTable&gt;(*m_object);
</ins><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowsAttribute])
</span><del>-            return convertToNSArray(toAccessibilityTable(m_object)-&gt;rows());
</del><ins>+            return convertToNSArray(table.rows());
</ins><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityVisibleRowsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector visibleRows;
</span><del>-            toAccessibilityTable(m_object)-&gt;visibleRows(visibleRows);
</del><ins>+            table.visibleRows(visibleRows);
</ins><span class="cx">             return convertToNSArray(visibleRows);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // TODO: distinguish between visible and non-visible columns
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityColumnsAttribute] ||
</span><span class="cx">             [attributeName isEqualToString:NSAccessibilityVisibleColumnsAttribute]) {
</span><del>-            return convertToNSArray(toAccessibilityTable(m_object)-&gt;columns());
</del><ins>+            return convertToNSArray(table.columns());
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilitySelectedRowsAttribute]) {
</span><span class="lines">@@ -2585,12 +2584,12 @@
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector columnHeaders;
</span><del>-            toAccessibilityTable(m_object)-&gt;columnHeaders(columnHeaders);
</del><ins>+            table.columnHeaders(columnHeaders);
</ins><span class="cx">             return convertToNSArray(columnHeaders);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityHeaderAttribute]) {
</span><del>-            AccessibilityObject* headerContainer = toAccessibilityTable(m_object)-&gt;headerContainer();
</del><ins>+            AccessibilityObject* headerContainer = table.headerContainer();
</ins><span class="cx">             if (headerContainer)
</span><span class="cx">                 return headerContainer-&gt;wrapper();
</span><span class="cx">             return nil;
</span><span class="lines">@@ -2598,59 +2597,61 @@
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector rowHeaders;
</span><del>-            toAccessibilityTable(m_object)-&gt;rowHeaders(rowHeaders);
</del><ins>+            table.rowHeaders(rowHeaders);
</ins><span class="cx">             return convertToNSArray(rowHeaders);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityVisibleCellsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector cells;
</span><del>-            toAccessibilityTable(m_object)-&gt;cells(cells);
</del><ins>+            table.cells(cells);
</ins><span class="cx">             return convertToNSArray(cells);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityColumnCountAttribute])
</span><del>-            return @(toAccessibilityTable(m_object)-&gt;columnCount());
</del><ins>+            return @(table.columnCount());
</ins><span class="cx">         
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowCountAttribute])
</span><del>-            return @(toAccessibilityTable(m_object)-&gt;rowCount());
</del><ins>+            return @(table.rowCount());
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (m_object-&gt;isTableColumn()) {
</del><ins>+    if (is&lt;AccessibilityTableColumn&gt;(*m_object)) {
+        auto&amp; column = downcast&lt;AccessibilityTableColumn&gt;(*m_object);
</ins><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityIndexAttribute])
</span><del>-            return [NSNumber numberWithInt:toAccessibilityTableColumn(m_object)-&gt;columnIndex()];
</del><ins>+            return [NSNumber numberWithInt:column.columnIndex()];
</ins><span class="cx">         
</span><span class="cx">         // rows attribute for a column is the list of all the elements in that column at each row
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowsAttribute] ||
</span><span class="cx">             [attributeName isEqualToString:NSAccessibilityVisibleRowsAttribute]) {
</span><del>-            return convertToNSArray(toAccessibilityTableColumn(m_object)-&gt;children());
</del><ins>+            return convertToNSArray(column.children());
</ins><span class="cx">         }
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityHeaderAttribute]) {
</span><del>-            AccessibilityObject* header = toAccessibilityTableColumn(m_object)-&gt;headerObject();
</del><ins>+            AccessibilityObject* header = column.headerObject();
</ins><span class="cx">             if (!header)
</span><span class="cx">                 return nil;
</span><span class="cx">             return header-&gt;wrapper();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (m_object-&gt;isTableCell()) {
</del><ins>+    if (is&lt;AccessibilityTableCell&gt;(*m_object)) {
+        auto&amp; cell = downcast&lt;AccessibilityTableCell&gt;(*m_object);
</ins><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowIndexRangeAttribute]) {
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; rowRange;
</span><del>-            toAccessibilityTableCell(m_object)-&gt;rowIndexRange(rowRange);
</del><ins>+            cell.rowIndexRange(rowRange);
</ins><span class="cx">             return [NSValue valueWithRange:NSMakeRange(rowRange.first, rowRange.second)];
</span><span class="cx">         }
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityColumnIndexRangeAttribute]) {
</span><span class="cx">             std::pair&lt;unsigned, unsigned&gt; columnRange;
</span><del>-            toAccessibilityTableCell(m_object)-&gt;columnIndexRange(columnRange);
</del><ins>+            cell.columnIndexRange(columnRange);
</ins><span class="cx">             return [NSValue valueWithRange:NSMakeRange(columnRange.first, columnRange.second)];
</span><span class="cx">         }
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector columnHeaders;
</span><del>-            toAccessibilityTableCell(m_object)-&gt;columnHeaders(columnHeaders);
</del><ins>+            cell.columnHeaders(columnHeaders);
</ins><span class="cx">             return convertToNSArray(columnHeaders);
</span><span class="cx">         }
</span><span class="cx">         if ([attributeName isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector rowHeaders;
</span><del>-            toAccessibilityTableCell(m_object)-&gt;rowHeaders(rowHeaders);
</del><ins>+            cell.rowHeaders(rowHeaders);
</ins><span class="cx">             return convertToNSArray(rowHeaders);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2691,9 +2692,9 @@
</span><span class="cx">             
</span><span class="cx">             return nil;
</span><span class="cx">         }
</span><del>-        if (m_object-&gt;isTableRow()) {
</del><ins>+        if (is&lt;AccessibilityTableRow&gt;(*m_object)) {
</ins><span class="cx">             if ([attributeName isEqualToString:NSAccessibilityIndexAttribute])
</span><del>-                return [NSNumber numberWithInt:toAccessibilityTableRow(m_object)-&gt;rowIndex()];
</del><ins>+                return [NSNumber numberWithInt:downcast&lt;AccessibilityTableRow&gt;(*m_object).rowIndex()];
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -2703,9 +2704,9 @@
</span><span class="cx">             AccessibilityObject::AccessibilityChildrenVector rowsCopy;
</span><span class="cx">             m_object-&gt;ariaTreeItemDisclosedRows(rowsCopy);
</span><span class="cx">             return convertToNSArray(rowsCopy);
</span><del>-        } else if (m_object-&gt;isARIATreeGridRow()) {
</del><ins>+        } else if (is&lt;AccessibilityARIAGridRow&gt;(*m_object)) {
</ins><span class="cx">             AccessibilityObject::AccessibilityChildrenVector rowsCopy;
</span><del>-            toAccessibilityARIAGridRow(m_object)-&gt;disclosedRows(rowsCopy);
</del><ins>+            downcast&lt;AccessibilityARIAGridRow&gt;(*m_object).disclosedRows(rowsCopy);
</ins><span class="cx">             return convertToNSArray(rowsCopy);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2723,8 +2724,8 @@
</span><span class="cx">                 parent = parent-&gt;parentObject();
</span><span class="cx">             }
</span><span class="cx">             return nil;
</span><del>-        } else if (m_object-&gt;isARIATreeGridRow()) {
-            AccessibilityObject* row = toAccessibilityARIAGridRow(m_object)-&gt;disclosedByRow();
</del><ins>+        } else if (is&lt;AccessibilityARIAGridRow&gt;(*m_object)) {
+            AccessibilityObject* row = downcast&lt;AccessibilityARIAGridRow&gt;(*m_object).disclosedByRow();
</ins><span class="cx">             if (!row)
</span><span class="cx">                 return nil;
</span><span class="cx">             return row-&gt;wrapper();
</span><span class="lines">@@ -2769,7 +2770,7 @@
</span><span class="cx">         return [NSNumber numberWithBool:m_object-&gt;isSelected()];
</span><span class="cx">     
</span><span class="cx">     if ([attributeName isEqualToString: NSAccessibilityServesAsTitleForUIElementsAttribute] &amp;&amp; m_object-&gt;isMenuButton()) {
</span><del>-        AccessibilityObject* uiElement = toAccessibilityRenderObject(m_object)-&gt;menuForMenuButton();
</del><ins>+        AccessibilityObject* uiElement = downcast&lt;AccessibilityRenderObject&gt;(*m_object).menuForMenuButton();
</ins><span class="cx">         if (uiElement)
</span><span class="cx">             return [NSArray arrayWithObject:uiElement-&gt;wrapper()];
</span><span class="cx">     }
</span><span class="lines">@@ -3197,8 +3198,8 @@
</span><span class="cx">     if (frameView &amp;&amp; !frameView-&gt;platformWidget()) {
</span><span class="cx">         // Find the appropriate scroll view to use to convert the contents to the window.
</span><span class="cx">         for (AccessibilityObject* parent = m_object-&gt;parentObject(); parent; parent = parent-&gt;parentObject()) {
</span><del>-            if (parent-&gt;isAccessibilityScrollView()) {
-                ScrollView* scrollView = toAccessibilityScrollView(parent)-&gt;scrollView();
</del><ins>+            if (is&lt;AccessibilityScrollView&gt;(*parent)) {
+                ScrollView* scrollView = downcast&lt;AccessibilityScrollView&gt;(*parent).scrollView();
</ins><span class="cx">                 rect = scrollView-&gt;contentsToRootView(rect);
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="lines">@@ -3299,7 +3300,7 @@
</span><span class="cx">             return;
</span><span class="cx">         AccessibilityObject::AccessibilityChildrenVector selectedChildren;
</span><span class="cx">         convertToVector(array, selectedChildren);
</span><del>-        toAccessibilityListBox(m_object)-&gt;setSelectedChildren(selectedChildren);
</del><ins>+        downcast&lt;AccessibilityListBox&gt;(*m_object).setSelectedChildren(selectedChildren);
</ins><span class="cx">     } else if (m_object-&gt;isTextControl()) {
</span><span class="cx">         if ([attributeName isEqualToString: NSAccessibilitySelectedTextAttribute]) {
</span><span class="cx">             m_object-&gt;setSelectedText(string);
</span><span class="lines">@@ -3706,7 +3707,7 @@
</span><span class="cx">         if ([attribute isEqualToString:NSAccessibilityCellForColumnAndRowParameterizedAttribute]) {
</span><span class="cx">             if (array == nil || [array count] != 2)
</span><span class="cx">                 return nil;
</span><del>-            AccessibilityTableCell* cell = toAccessibilityTable(m_object)-&gt;cellForColumnAndRow([[array objectAtIndex:0] unsignedIntValue], [[array objectAtIndex:1] unsignedIntValue]);
</del><ins>+            AccessibilityTableCell* cell = downcast&lt;AccessibilityTable&gt;(*m_object).cellForColumnAndRow([[array objectAtIndex:0] unsignedIntValue], [[array objectAtIndex:1] unsignedIntValue]);
</ins><span class="cx">             if (!cell)
</span><span class="cx">                 return nil;
</span><span class="cx">             
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1580,8 +1580,8 @@
</span><span class="cx">                     liveRegionStatus = Inspector::Protocol::DOM::AccessibilityProperties::LiveRegionStatus::Polite;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (axObject-&gt;isAccessibilityNodeObject())
-                mouseEventNode = toAccessibilityNodeObject(axObject)-&gt;mouseButtonListener(MouseButtonListenerResultFilter::IncludeBodyElement);
</del><ins>+            if (is&lt;AccessibilityNodeObject&gt;(*axObject))
+                mouseEventNode = downcast&lt;AccessibilityNodeObject&gt;(*axObject).mouseButtonListener(MouseButtonListenerResultFilter::IncludeBodyElement);
</ins><span class="cx"> 
</span><span class="cx">             if (axObject-&gt;supportsARIAOwns()) {
</span><span class="cx">                 Vector&lt;Element*&gt; ownedElements;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -437,7 +437,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (AXObjectCache* cache = document().existingAXObjectCache()) {
</span><del>-        if (AccessibilityMenuList* menuList = toAccessibilityMenuList(cache-&gt;get(this)))
</del><ins>+        if (AccessibilityMenuList* menuList = downcast&lt;AccessibilityMenuList&gt;(cache-&gt;get(this)))
</ins><span class="cx">             menuList-&gt;didUpdateActiveOption(optionIndex);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinAccessibleBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/AccessibleBase.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/AccessibleBase.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebKit/win/AccessibleBase.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -616,10 +616,10 @@
</span><span class="cx">         return E_INVALIDARG;
</span><span class="cx"> 
</span><span class="cx">     if (selectionFlags &amp; SELFLAG_TAKESELECTION) {
</span><del>-        if (parentObject-&gt;isListBox()) {
</del><ins>+        if (is&lt;AccessibilityListBox&gt;(*parentObject)) {
</ins><span class="cx">             Vector&lt;RefPtr&lt;AccessibilityObject&gt; &gt; selectedChildren(1);
</span><span class="cx">             selectedChildren[0] = childObject;
</span><del>-            toAccessibilityListBox(parentObject)-&gt;setSelectedChildren(selectedChildren);
</del><ins>+            downcast&lt;AccessibilityListBox&gt;(*parentObject).setSelectedChildren(selectedChildren);
</ins><span class="cx">         } else { // any element may be selectable by virtue of it having the aria-selected property
</span><span class="cx">             ASSERT(!parentObject-&gt;isMultiSelectable());
</span><span class="cx">             childObject-&gt;setSelected(true);
</span></span></pre></div>
<a id="trunkSourceWebKitwinAccessibleImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/AccessibleImage.cpp (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/AccessibleImage.cpp        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebKit/win/AccessibleImage.cpp        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -41,16 +41,16 @@
</span><span class="cx"> 
</span><span class="cx"> String AccessibleImage::name() const
</span><span class="cx"> {
</span><del>-    if (!m_object-&gt;isAccessibilityRenderObject())
</del><ins>+    if (!is&lt;AccessibilityRenderObject&gt;(*m_object))
</ins><span class="cx">         return AccessibleBase::name();
</span><span class="cx"> 
</span><del>-    AccessibilityRenderObject* obj = toAccessibilityRenderObject(m_object);
</del><ins>+    AccessibilityRenderObject&amp; obj = downcast&lt;AccessibilityRenderObject&gt;(*m_object);
</ins><span class="cx"> 
</span><del>-    String ariaLabel = obj-&gt;ariaLabeledByAttribute();
</del><ins>+    String ariaLabel = obj.ariaLabeledByAttribute();
</ins><span class="cx">     if (!ariaLabel.isEmpty())
</span><span class="cx">         return ariaLabel;
</span><span class="cx"> 
</span><del>-    const AtomicString&amp; altText = obj-&gt;getAttribute(HTMLNames::altAttr);
</del><ins>+    const AtomicString&amp; altText = obj.getAttribute(HTMLNames::altAttr);
</ins><span class="cx">     if (!altText.isEmpty())
</span><span class="cx">         return altText;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174897 => 174898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-20 18:52:37 UTC (rev 174897)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-20 19:08:40 UTC (rev 174898)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-10-20  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects
+        https://bugs.webkit.org/show_bug.cgi?id=137286
+
+        Reviewed by Darin Adler.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Accessibility objects.
+
+        * AccessibleBase.cpp:
+        (AccessibleBase::accSelect):
+        * AccessibleImage.cpp:
+        (AccessibleImage::name):
+
</ins><span class="cx"> 2014-10-18  peavo@outlook.com  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WinCairo] Repaint issues with accelerated compositing.
</span></span></pre>
</div>
</div>

</body>
</html>