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

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

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

Reviewed by Mihnea Ovidenie.

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

No new tests, no behavior change.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement):
(WebCore::AccessibilityTable::isDataTable):
(WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
(WebCore::AccessibilityTable::addChildren):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable):
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):
(WebCore::AccessibilityTableCell::titleUIElement):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::removeNode):
* editing/TextIterator.cpp:
(WebCore::shouldEmitTabBeforeNode):
(WebCore::shouldEmitNewlinesBeforeAndAfterNode):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::parseAttribute):
(WebCore::HTMLTableCellElement::cellAbove):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::shouldScaleColumns):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::firstColumn):
(WebCore::RenderTable::recalcSections):
(WebCore::RenderTable::sectionAbove):
(WebCore::RenderTable::sectionBelow):
(WebCore::RenderTable::bottomSection):
* rendering/RenderTable.h:
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::table):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::nextCell):
(WebCore::RenderTableCell::previousCell):
(WebCore::RenderTableRow::firstCell):
(WebCore::RenderTableRow::lastCell):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::table):
(WebCore::RenderTableCol::enclosingColumnGroup):
(WebCore::RenderTableCol::nextColumn):
* rendering/RenderTableCol.h:
Make updateFromElement() public to allow the callers to use tighter
typing and devitualize the call as the class is final.

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableRow.h:
(WebCore::RenderTableSection::firstRow):
(WebCore::RenderTableSection::lastRow):
(WebCore::RenderTableRow::nextRow):
(WebCore::RenderTableRow::previousRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::paintCell):
* rendering/RenderTableSection.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeTextRun):
(WebCore::writeSimpleLine):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTablecpp">trunk/Source/WebCore/accessibility/AccessibilityTable.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp">trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp">trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableCellElementcpp">trunk/Source/WebCore/html/HTMLTableCellElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableColElementcpp">trunk/Source/WebCore/html/HTMLTableColElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementcpp">trunk/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingAutoTableLayoutcpp">trunk/Source/WebCore/rendering/AutoTableLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTablecpp">trunk/Source/WebCore/rendering/RenderTable.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableh">trunk/Source/WebCore/rendering/RenderTable.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableCaptioncpp">trunk/Source/WebCore/rendering/RenderTableCaption.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableCellh">trunk/Source/WebCore/rendering/RenderTableCell.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableColcpp">trunk/Source/WebCore/rendering/RenderTableCol.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableColh">trunk/Source/WebCore/rendering/RenderTableCol.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableRowcpp">trunk/Source/WebCore/rendering/RenderTableRow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableRowh">trunk/Source/WebCore/rendering/RenderTableRow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectioncpp">trunk/Source/WebCore/rendering/RenderTableSection.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTableSectionh">trunk/Source/WebCore/rendering/RenderTableSection.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/ChangeLog        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -1,3 +1,93 @@
</span><ins>+2014-10-13  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for Table render objects
+        https://bugs.webkit.org/show_bug.cgi?id=137641
+
+        Reviewed by Mihnea Ovidenie.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for table-related render objects and clean
+        up the surrounding code.
+
+        No new tests, no behavior change.
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::tableElement):
+        (WebCore::AccessibilityTable::isDataTable):
+        (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
+        (WebCore::AccessibilityTable::addChildren):
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::parentTable):
+        (WebCore::AccessibilityTableCell::rowIndexRange):
+        (WebCore::AccessibilityTableCell::columnIndexRange):
+        (WebCore::AccessibilityTableCell::titleUIElement):
+        * accessibility/AccessibilityTableColumn.cpp:
+        (WebCore::AccessibilityTableColumn::headerObject):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::removeNode):
+        * editing/TextIterator.cpp:
+        (WebCore::shouldEmitTabBeforeNode):
+        (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
+        * html/HTMLTableCellElement.cpp:
+        (WebCore::HTMLTableCellElement::parseAttribute):
+        (WebCore::HTMLTableCellElement::cellAbove):
+        * html/HTMLTableColElement.cpp:
+        (WebCore::HTMLTableColElement::parseAttribute):
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::parseAttribute):
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        (WebCore::shouldScaleColumns):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computePercentageLogicalHeight):
+        (WebCore::RenderBox::layoutOverflowRectForPropagation):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::addChild):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::addChild):
+        (WebCore::RenderTable::layout):
+        (WebCore::RenderTable::firstColumn):
+        (WebCore::RenderTable::recalcSections):
+        (WebCore::RenderTable::sectionAbove):
+        (WebCore::RenderTable::sectionBelow):
+        (WebCore::RenderTable::bottomSection):
+        * rendering/RenderTable.h:
+        * rendering/RenderTableCaption.cpp:
+        (WebCore::RenderTableCaption::table):
+        * rendering/RenderTableCell.h:
+        (WebCore::RenderTableCell::nextCell):
+        (WebCore::RenderTableCell::previousCell):
+        (WebCore::RenderTableRow::firstCell):
+        (WebCore::RenderTableRow::lastCell):
+        * rendering/RenderTableCol.cpp:
+        (WebCore::RenderTableCol::table):
+        (WebCore::RenderTableCol::enclosingColumnGroup):
+        (WebCore::RenderTableCol::nextColumn):
+        * rendering/RenderTableCol.h:
+        Make updateFromElement() public to allow the callers to use tighter
+        typing and devitualize the call as the class is final.
+
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::addChild):
+        * rendering/RenderTableRow.h:
+        (WebCore::RenderTableSection::firstRow):
+        (WebCore::RenderTableSection::lastRow):
+        (WebCore::RenderTableRow::nextRow):
+        (WebCore::RenderTableRow::previousRow):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::addChild):
+        (WebCore::RenderTableSection::layoutRows):
+        (WebCore::RenderTableSection::paintCell):
+        * rendering/RenderTableSection.h:
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::writeTextRun):
+        (WebCore::writeSimpleLine):
+
</ins><span class="cx"> 2014-10-08  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -117,12 +117,11 @@
</span><span class="cx">     for (RefPtr&lt;AccessibilityObject&gt; child = firstChild(); child; child = child-&gt;nextSibling()) {
</span><span class="cx">         bool footerSection = false;
</span><span class="cx">         if (RenderObject* childRenderer = child-&gt;renderer()) {
</span><del>-            if (childRenderer-&gt;isTableSection()) {
-                if (RenderTableSection* childSection = toRenderTableSection(childRenderer)) {
-                    if (childSection == childSection-&gt;table()-&gt;footer()) {
-                        footerSections.append(child);
-                        footerSection = true;
-                    }
</del><ins>+            if (is&lt;RenderTableSection&gt;(*childRenderer)) {
+                RenderTableSection&amp; childSection = downcast&lt;RenderTableSection&gt;(*childRenderer);
+                if (&amp;childSection == childSection.table()-&gt;footer()) {
+                    footerSections.append(child);
+                    footerSection = true;
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -92,16 +92,16 @@
</span><span class="cx"> 
</span><span class="cx"> HTMLTableElement* AccessibilityTable::tableElement() const
</span><span class="cx"> {
</span><del>-    if (!m_renderer-&gt;isTable())
</del><ins>+    if (!is&lt;RenderTable&gt;(*m_renderer))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderTable* table = toRenderTable(m_renderer);
-    if (is&lt;HTMLTableElement&gt;(table-&gt;element()))
-        return downcast&lt;HTMLTableElement&gt;(table-&gt;element());
</del><ins>+    RenderTable&amp; table = downcast&lt;RenderTable&gt;(*m_renderer);
+    if (is&lt;HTMLTableElement&gt;(table.element()))
+        return downcast&lt;HTMLTableElement&gt;(table.element());
</ins><span class="cx">     
</span><span class="cx">     // If the table has a display:table-row-group, then the RenderTable does not have a pointer to it's HTMLTableElement.
</span><span class="cx">     // We can instead find it by asking the firstSection for its parent.
</span><del>-    RenderTableSection* firstBody = table-&gt;firstBody();
</del><ins>+    RenderTableSection* firstBody = table.firstBody();
</ins><span class="cx">     if (!firstBody || !firstBody-&gt;element())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="lines">@@ -127,16 +127,14 @@
</span><span class="cx">     if (node() &amp;&amp; node()-&gt;hasEditableStyle())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (!m_renderer-&gt;isTable())
</del><ins>+    if (!is&lt;RenderTable&gt;(*m_renderer))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // This employs a heuristic to determine if this table should appear.
</span><span class="cx">     // Only &quot;data&quot; tables should be exposed as tables.
</span><span class="cx">     // Unfortunately, there is no good way to determine the difference
</span><span class="cx">     // between a &quot;layout&quot; table and a &quot;data&quot; table.
</span><del>-    RenderTable* table = toRenderTable(m_renderer);
-    HTMLTableElement* tableElement = this-&gt;tableElement();
-    if (tableElement) {
</del><ins>+    if (HTMLTableElement* tableElement = this-&gt;tableElement()) {
</ins><span class="cx">         // If there is a caption element, summary, THEAD, or TFOOT section, it's most certainly a data table.
</span><span class="cx">         if (!tableElement-&gt;summary().isEmpty() || tableElement-&gt;tHead() || tableElement-&gt;tFoot() || tableElement-&gt;caption())
</span><span class="cx">             return true;
</span><span class="lines">@@ -146,16 +144,17 @@
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><span class="cx">         // If there's a colgroup or col element, it's probably a data table.
</span><del>-        for (const auto&amp; child : childrenOfType&lt;Element&gt;(*tableElement)) {
</del><ins>+        for (const auto&amp; child : childrenOfType&lt;HTMLElement&gt;(*tableElement)) {
</ins><span class="cx">             if (child.hasTagName(colTag) || child.hasTagName(colgroupTag))
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    RenderTable&amp; table = downcast&lt;RenderTable&gt;(*m_renderer);
</ins><span class="cx">     // go through the cell's and check for tell-tale signs of &quot;data&quot; table status
</span><span class="cx">     // cells have borders, or use attributes like headers, abbr, scope or axis
</span><del>-    table-&gt;recalcSectionsIfNeeded();
-    RenderTableSection* firstBody = table-&gt;firstBody();
</del><ins>+    table.recalcSectionsIfNeeded();
+    RenderTableSection* firstBody = table.firstBody();
</ins><span class="cx">     if (!firstBody)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="lines">@@ -171,7 +170,7 @@
</span><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     // Store the background color of the table to check against cell's background colors.
</span><del>-    const RenderStyle&amp; tableStyle = table-&gt;style();
</del><ins>+    const RenderStyle&amp; tableStyle = table.style();
</ins><span class="cx">     Color tableBGColor = tableStyle.visitedDependentColor(CSSPropertyBackgroundColor);
</span><span class="cx">     
</span><span class="cx">     // check enough of the cells to find if the table matches our criteria
</span><span class="lines">@@ -206,16 +205,16 @@
</span><span class="cx">             if (cell-&gt;width() &lt; 1 || cell-&gt;height() &lt; 1)
</span><span class="cx">                 continue;
</span><span class="cx">             
</span><del>-            validCellCount++;
</del><ins>+            ++validCellCount;
</ins><span class="cx">             
</span><span class="cx">             bool isTHCell = cellElement-&gt;hasTagName(thTag);
</span><span class="cx">             // If the first row is comprised of all &lt;th&gt; tags, assume it is a data table.
</span><span class="cx">             if (!row &amp;&amp; isTHCell)
</span><del>-                headersInFirstRowCount++;
</del><ins>+                ++headersInFirstRowCount;
</ins><span class="cx"> 
</span><span class="cx">             // If the first column is comprised of all &lt;th&gt; tags, assume it is a data table.
</span><span class="cx">             if (!col &amp;&amp; isTHCell)
</span><del>-                headersInFirstColumnCount++;
</del><ins>+                ++headersInFirstColumnCount;
</ins><span class="cx">             
</span><span class="cx">             // In this case, the developer explicitly assigned a &quot;data&quot; table attribute.
</span><span class="cx">             if (is&lt;HTMLTableCellElement&gt;(*cellElement)) {
</span><span class="lines">@@ -233,25 +232,25 @@
</span><span class="cx">             // If a cell has matching bordered sides, call it a (fully) bordered cell.
</span><span class="cx">             if ((cell-&gt;borderTop() &gt; 0 &amp;&amp; cell-&gt;borderBottom() &gt; 0)
</span><span class="cx">                 || (cell-&gt;borderLeft() &gt; 0 &amp;&amp; cell-&gt;borderRight() &gt; 0))
</span><del>-                borderedCellCount++;
</del><ins>+                ++borderedCellCount;
</ins><span class="cx"> 
</span><span class="cx">             // Also keep track of each individual border, so we can catch tables where most
</span><span class="cx">             // cells have a bottom border, for example.
</span><span class="cx">             if (cell-&gt;borderTop() &gt; 0)
</span><del>-                cellsWithTopBorder++;
</del><ins>+                ++cellsWithTopBorder;
</ins><span class="cx">             if (cell-&gt;borderBottom() &gt; 0)
</span><del>-                cellsWithBottomBorder++;
</del><ins>+                ++cellsWithBottomBorder;
</ins><span class="cx">             if (cell-&gt;borderLeft() &gt; 0)
</span><del>-                cellsWithLeftBorder++;
</del><ins>+                ++cellsWithLeftBorder;
</ins><span class="cx">             if (cell-&gt;borderRight() &gt; 0)
</span><del>-                cellsWithRightBorder++;
</del><ins>+                ++cellsWithRightBorder;
</ins><span class="cx">             
</span><span class="cx">             // If the cell has a different color from the table and there is cell spacing,
</span><span class="cx">             // then it is probably a data table cell (spacing and colors take the place of borders).
</span><span class="cx">             Color cellColor = renderStyle.visitedDependentColor(CSSPropertyBackgroundColor);
</span><del>-            if (table-&gt;hBorderSpacing() &gt; 0 &amp;&amp; table-&gt;vBorderSpacing() &gt; 0
</del><ins>+            if (table.hBorderSpacing() &gt; 0 &amp;&amp; table.vBorderSpacing() &gt; 0
</ins><span class="cx">                 &amp;&amp; tableBGColor != cellColor &amp;&amp; cellColor.alpha() != 1)
</span><del>-                backgroundDifferenceCellCount++;
</del><ins>+                ++backgroundDifferenceCellCount;
</ins><span class="cx">             
</span><span class="cx">             // If we've found 10 &quot;good&quot; cells, we don't need to keep searching.
</span><span class="cx">             if (borderedCellCount &gt;= 10 || backgroundDifferenceCellCount &gt;= 10)
</span><span class="lines">@@ -327,7 +326,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Gtk+ ATs expect all tables to be exposed as tables.
</span><span class="cx"> #if PLATFORM(GTK) || PLATFORM(EFL)
</span><del>-    Element* tableNode = toRenderTable(m_renderer)-&gt;element();
</del><ins>+    Element* tableNode = downcast&lt;RenderTable&gt;(*m_renderer).element();
</ins><span class="cx">     return is&lt;HTMLTableElement&gt;(tableNode);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -356,17 +355,17 @@
</span><span class="cx">     ASSERT(!m_haveChildren); 
</span><span class="cx">     
</span><span class="cx">     m_haveChildren = true;
</span><del>-    if (!m_renderer || !m_renderer-&gt;isTable())
</del><ins>+    if (!is&lt;RenderTable&gt;(m_renderer))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    RenderTable* table = toRenderTable(m_renderer);
</del><ins>+    RenderTable&amp; table = downcast&lt;RenderTable&gt;(*m_renderer);
</ins><span class="cx">     // Go through all the available sections to pull out the rows and add them as children.
</span><del>-    table-&gt;recalcSectionsIfNeeded();
</del><ins>+    table.recalcSectionsIfNeeded();
</ins><span class="cx">     
</span><span class="cx">     unsigned maxColumnCount = 0;
</span><del>-    RenderTableSection* footer = table-&gt;footer();
</del><ins>+    RenderTableSection* footer = table.footer();
</ins><span class="cx">     
</span><del>-    for (RenderTableSection* tableSection = table-&gt;topSection(); tableSection; tableSection = table-&gt;sectionBelow(tableSection, SkipEmptySections)) {
</del><ins>+    for (RenderTableSection* tableSection = table.topSection(); tableSection; tableSection = table.sectionBelow(tableSection, SkipEmptySections)) {
</ins><span class="cx">         if (tableSection == footer)
</span><span class="cx">             continue;
</span><span class="cx">         addChildrenFromSection(tableSection, maxColumnCount);
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx"> AccessibilityTable* AccessibilityTableCell::parentTable() const
</span><span class="cx"> {
</span><del>-    if (!m_renderer || !m_renderer-&gt;isTableCell())
</del><ins>+    if (!is&lt;RenderTableCell&gt;(m_renderer))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // If the document no longer exists, we might not have an axObjectCache.
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     // By using only get() implies that the AXTable must be created before AXTableCells. This should
</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><del>-    AccessibilityObject* parentTable = axObjectCache()-&gt;get(toRenderTableCell(m_renderer)-&gt;table());
</del><ins>+    AccessibilityObject* parentTable = axObjectCache()-&gt;get(downcast&lt;RenderTableCell&gt;(*m_renderer).table());
</ins><span class="cx">     if (!parentTable || !parentTable-&gt;isTable())
</span><span class="cx">         return nullptr;
</span><span class="cx">     return toAccessibilityTable(parentTable);
</span><span class="lines">@@ -224,16 +224,16 @@
</span><span class="cx">     
</span><span class="cx"> void AccessibilityTableCell::rowIndexRange(std::pair&lt;unsigned, unsigned&gt;&amp; rowRange)
</span><span class="cx"> {
</span><del>-    if (!m_renderer || !m_renderer-&gt;isTableCell())
</del><ins>+    if (!is&lt;RenderTableCell&gt;(m_renderer))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    RenderTableCell* renderCell = toRenderTableCell(m_renderer);
-    rowRange.first = renderCell-&gt;rowIndex();
-    rowRange.second = renderCell-&gt;rowSpan();
</del><ins>+    RenderTableCell&amp; renderCell = downcast&lt;RenderTableCell&gt;(*m_renderer);
+    rowRange.first = renderCell.rowIndex();
+    rowRange.second = renderCell.rowSpan();
</ins><span class="cx">     
</span><span class="cx">     // since our table might have multiple sections, we have to offset our row appropriately
</span><del>-    RenderTableSection* section = renderCell-&gt;section();
-    RenderTable* table = renderCell-&gt;table();
</del><ins>+    RenderTableSection* section = renderCell.section();
+    RenderTable* table = renderCell.table();
</ins><span class="cx">     if (!table || !section)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -253,10 +253,10 @@
</span><span class="cx">     
</span><span class="cx"> void AccessibilityTableCell::columnIndexRange(std::pair&lt;unsigned, unsigned&gt;&amp; columnRange)
</span><span class="cx"> {
</span><del>-    if (!m_renderer || !m_renderer-&gt;isTableCell())
</del><ins>+    if (!is&lt;RenderTableCell&gt;(m_renderer))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    const RenderTableCell&amp; cell = *toRenderTableCell(m_renderer);
</del><ins>+    const RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*m_renderer);
</ins><span class="cx">     columnRange.first = cell.table()-&gt;colToEffCol(cell.col());
</span><span class="cx">     columnRange.second = cell.table()-&gt;colToEffCol(cell.col() + cell.colSpan()) - columnRange.first;
</span><span class="cx"> }
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx">     // Try to find if the first cell in this row is a &lt;th&gt;. If it is,
</span><span class="cx">     // then it can act as the title ui element. (This is only in the
</span><span class="cx">     // case when the table is not appearing as an AXTable.)
</span><del>-    if (isTableCell() || !m_renderer || !m_renderer-&gt;isTableCell())
</del><ins>+    if (isTableCell() || !is&lt;RenderTableCell&gt;(m_renderer))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // Table cells that are th cannot have title ui elements, since by definition
</span><span class="lines">@@ -275,21 +275,21 @@
</span><span class="cx">     if (node &amp;&amp; node-&gt;hasTagName(thTag))
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderTableCell* renderCell = toRenderTableCell(m_renderer);
</del><ins>+    RenderTableCell&amp; renderCell = downcast&lt;RenderTableCell&gt;(*m_renderer);
</ins><span class="cx"> 
</span><span class="cx">     // If this cell is in the first column, there is no need to continue.
</span><del>-    int col = renderCell-&gt;col();
</del><ins>+    int col = renderCell.col();
</ins><span class="cx">     if (!col)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    int row = renderCell-&gt;rowIndex();
</del><ins>+    int row = renderCell.rowIndex();
</ins><span class="cx"> 
</span><del>-    RenderTableSection* section = renderCell-&gt;section();
</del><ins>+    RenderTableSection* section = renderCell.section();
</ins><span class="cx">     if (!section)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="cx">     RenderTableCell* headerCell = section-&gt;primaryCellAt(row, 0);
</span><del>-    if (!headerCell || headerCell == renderCell)
</del><ins>+    if (!headerCell || headerCell == &amp;renderCell)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (!headerCell-&gt;element() || !headerCell-&gt;element()-&gt;hasTagName(thTag))
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -89,23 +89,17 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!renderer-&gt;isTable())
</del><ins>+    if (!is&lt;RenderTable&gt;(*renderer))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    RenderTable* table = toRenderTable(renderer);
-    
-    AccessibilityObject* headerObject = nullptr;
-    
-    // try the &lt;thead&gt; section first. this doesn't require th tags
-    headerObject = headerObjectForSection(table-&gt;header(), false);
</del><ins>+    RenderTable&amp; table = downcast&lt;RenderTable&gt;(*renderer);
</ins><span class="cx"> 
</span><del>-    if (headerObject)
</del><ins>+    // try the &lt;thead&gt; section first. this doesn't require th tags
+    if (auto* headerObject = headerObjectForSection(table.header(), false))
</ins><span class="cx">         return headerObject;
</span><span class="cx">     
</span><span class="cx">     // now try for &lt;th&gt; tags in the first body
</span><del>-    headerObject = headerObjectForSection(table-&gt;firstBody(), true);
-
-    return headerObject;
</del><ins>+    return headerObjectForSection(table.firstBody(), true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessibilityObject* AccessibilityTableColumn::headerObjectForSection(RenderTableSection* section, bool thTagRequired)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -386,8 +386,8 @@
</span><span class="cx">         
</span><span class="cx">         // Make sure empty cell has some height, if a placeholder can be inserted.
</span><span class="cx">         document().updateLayoutIgnorePendingStylesheets();
</span><del>-        RenderObject *r = node-&gt;renderer();
-        if (r &amp;&amp; r-&gt;isTableCell() &amp;&amp; toRenderTableCell(r)-&gt;contentHeight() &lt;= 0) {
</del><ins>+        RenderObject* renderer = node-&gt;renderer();
+        if (is&lt;RenderTableCell&gt;(renderer) &amp;&amp; downcast&lt;RenderTableCell&gt;(*renderer).contentHeight() &lt;= 0) {
</ins><span class="cx">             Position firstEditablePosition = firstEditablePositionInNode(node.get());
</span><span class="cx">             if (firstEditablePosition.isNotNull())
</span><span class="cx">                 insertBlockPlaceholder(firstEditablePosition);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -785,7 +785,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     // Want a tab before every cell other than the first one.
</span><del>-    RenderTableCell&amp; cell = toRenderTableCell(*renderer);
</del><ins>+    RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*renderer);
</ins><span class="cx">     RenderTable* table = cell.table();
</span><span class="cx">     return table &amp;&amp; (table-&gt;cellBefore(&amp;cell) || table-&gt;cellAbove(&amp;cell));
</span><span class="cx"> }
</span><span class="lines">@@ -840,14 +840,14 @@
</span><span class="cx">     
</span><span class="cx">     // Need to make an exception for table row elements, because they are neither
</span><span class="cx">     // &quot;inline&quot; or &quot;RenderBlock&quot;, but we want newlines for them.
</span><del>-    if (renderer-&gt;isTableRow()) {
-        RenderTable* table = toRenderTableRow(*renderer).table();
</del><ins>+    if (is&lt;RenderTableRow&gt;(*renderer)) {
+        RenderTable* table = downcast&lt;RenderTableRow&gt;(*renderer).table();
</ins><span class="cx">         if (table &amp;&amp; !table-&gt;isInline())
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return !renderer-&gt;isInline()
</span><del>-        &amp;&amp; renderer-&gt;isRenderBlock()
</del><ins>+        &amp;&amp; is&lt;RenderBlock&gt;(*renderer)
</ins><span class="cx">         &amp;&amp; !renderer-&gt;isFloatingOrOutOfFlowPositioned()
</span><span class="cx">         &amp;&amp; !renderer-&gt;isBody()
</span><span class="cx">         &amp;&amp; !renderer-&gt;isRubyText();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableCellElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableCellElement.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableCellElement.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/html/HTMLTableCellElement.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -105,11 +105,11 @@
</span><span class="cx"> void HTMLTableCellElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (name == rowspanAttr) {
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isTableCell())
-            toRenderTableCell(renderer())-&gt;colSpanOrRowSpanChanged();
</del><ins>+        if (is&lt;RenderTableCell&gt;(renderer()))
+            downcast&lt;RenderTableCell&gt;(*renderer()).colSpanOrRowSpanChanged();
</ins><span class="cx">     } else if (name == colspanAttr) {
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isTableCell())
-            toRenderTableCell(renderer())-&gt;colSpanOrRowSpanChanged();
</del><ins>+        if (is&lt;RenderTableCell&gt;(renderer()))
+            downcast&lt;RenderTableCell&gt;(*renderer()).colSpanOrRowSpanChanged();
</ins><span class="cx">     } else
</span><span class="cx">         HTMLTablePartElement::parseAttribute(name, value);
</span><span class="cx"> }
</span><span class="lines">@@ -165,12 +165,12 @@
</span><span class="cx"> 
</span><span class="cx"> HTMLTableCellElement* HTMLTableCellElement::cellAbove() const
</span><span class="cx"> {
</span><del>-    auto cellRenderer = renderer();
-    if (!cellRenderer || !cellRenderer-&gt;isTableCell())
</del><ins>+    auto* cellRenderer = renderer();
+    if (!is&lt;RenderTableCell&gt;(cellRenderer))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto tableCellRenderer = toRenderTableCell(cellRenderer);
-    auto cellAboveRenderer = tableCellRenderer-&gt;table()-&gt;cellAbove(tableCellRenderer);
</del><ins>+    auto&amp; tableCellRenderer = downcast&lt;RenderTableCell&gt;(*cellRenderer);
+    auto* cellAboveRenderer = tableCellRenderer.table()-&gt;cellAbove(&amp;tableCellRenderer);
</ins><span class="cx">     if (!cellAboveRenderer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableColElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableColElement.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableColElement.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/html/HTMLTableColElement.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -67,15 +67,15 @@
</span><span class="cx">     if (name == spanAttr) {
</span><span class="cx">         int newSpan = value.toInt();
</span><span class="cx">         m_span = newSpan ? newSpan : 1;
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isRenderTableCol())
-            renderer()-&gt;updateFromElement();
</del><ins>+        if (is&lt;RenderTableCol&gt;(renderer()))
+            downcast&lt;RenderTableCol&gt;(*renderer()).updateFromElement();
</ins><span class="cx">     } else if (name == widthAttr) {
</span><span class="cx">         if (!value.isEmpty()) {
</span><del>-            if (renderer() &amp;&amp; renderer()-&gt;isRenderTableCol()) {
-                RenderTableCol* col = toRenderTableCol(renderer());
</del><ins>+            if (is&lt;RenderTableCol&gt;(renderer())) {
+                RenderTableCol&amp; col = downcast&lt;RenderTableCol&gt;(*renderer());
</ins><span class="cx">                 int newWidth = width().toInt();
</span><del>-                if (newWidth != col-&gt;width())
-                    col-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</del><ins>+                if (newWidth != col.width())
+                    col.setNeedsLayoutAndPrefWidthsRecalc();
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     } else
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -212,11 +212,11 @@
</span><span class="cx"> void MathMLElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (name == rowspanAttr) {
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isTableCell() &amp;&amp; hasTagName(mtdTag))
-            toRenderTableCell(renderer())-&gt;colSpanOrRowSpanChanged();
</del><ins>+        if (is&lt;RenderTableCell&gt;(renderer()) &amp;&amp; hasTagName(mtdTag))
+            downcast&lt;RenderTableCell&gt;(*renderer()).colSpanOrRowSpanChanged();
</ins><span class="cx">     } else if (name == columnspanAttr) {
</span><del>-        if (renderer() &amp;&amp; renderer()-&gt;isTableCell() &amp;&amp; hasTagName(mtdTag))
-            toRenderTableCell(renderer())-&gt;colSpanOrRowSpanChanged();
</del><ins>+        if (is&lt;RenderTableCell&gt;(renderer()) &amp;&amp; hasTagName(mtdTag))
+            downcast&lt;RenderTableCell&gt;(renderer())-&gt;colSpanOrRowSpanChanged();
</ins><span class="cx">     } else
</span><span class="cx">         StyledElement::parseAttribute(name, value);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingAutoTableLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;RenderTableCol.h&quot;
</span><span class="cx"> #include &quot;RenderTableSection.h&quot;
</span><ins>+#include &quot;RenderView.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -44,20 +45,20 @@
</span><span class="cx"> {
</span><span class="cx">     Layout&amp; columnLayout = m_layoutStruct[effCol];
</span><span class="cx"> 
</span><del>-    RenderTableCell* fixedContributor = 0;
-    RenderTableCell* maxContributor = 0;
</del><ins>+    RenderTableCell* fixedContributor = nullptr;
+    RenderTableCell* maxContributor = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     for (RenderObject* child = m_table-&gt;firstChild(); child; child = child-&gt;nextSibling()) {
</span><del>-        if (child-&gt;isRenderTableCol()){
</del><ins>+        if (is&lt;RenderTableCol&gt;(*child)) {
</ins><span class="cx">             // RenderTableCols don't have the concept of preferred logical width, but we need to clear their dirty bits
</span><span class="cx">             // so that if we call setPreferredWidthsDirty(true) on a col or one of its descendants, we'll mark it's
</span><span class="cx">             // ancestors as dirty.
</span><del>-            toRenderTableCol(child)-&gt;clearPreferredLogicalWidthsDirtyBits();
-        } else if (child-&gt;isTableSection()) {
-            RenderTableSection* section = toRenderTableSection(child);
-            unsigned numRows = section-&gt;numRows();
-            for (unsigned i = 0; i &lt; numRows; i++) {
-                RenderTableSection::CellStruct current = section-&gt;cellAt(i, effCol);
</del><ins>+            downcast&lt;RenderTableCol&gt;(*child).clearPreferredLogicalWidthsDirtyBits();
+        } else if (is&lt;RenderTableSection&gt;(*child)) {
+            RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*child);
+            unsigned numRows = section.numRows();
+            for (unsigned i = 0; i &lt; numRows; ++i) {
+                RenderTableSection::CellStruct current = section.cellAt(i, effCol);
</ins><span class="cx">                 RenderTableCell* cell = current.primaryCell();
</span><span class="cx">                 
</span><span class="cx">                 if (current.inColSpan || !cell)
</span><span class="lines">@@ -120,7 +121,7 @@
</span><span class="cx">                     default:
</span><span class="cx">                         break;
</span><span class="cx">                     }
</span><del>-                } else if (!effCol || section-&gt;primaryCellAt(i, effCol - 1) != cell) {
</del><ins>+                } else if (!effCol || section.primaryCellAt(i, effCol - 1) != cell) {
</ins><span class="cx">                     // This spanning cell originates in this column. Insert the cell into spanning cells list.
</span><span class="cx">                     insertSpanCell(cell);
</span><span class="cx">                 }
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx">     if (columnLayout.logicalWidth.isFixed()) {
</span><span class="cx">         if (m_table-&gt;document().inQuirksMode() &amp;&amp; columnLayout.maxLogicalWidth &gt; columnLayout.logicalWidth.value() &amp;&amp; fixedContributor != maxContributor) {
</span><span class="cx">             columnLayout.logicalWidth = Length();
</span><del>-            fixedContributor = 0;
</del><ins>+            fixedContributor = nullptr;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -186,25 +187,25 @@
</span><span class="cx">     // a cell, then don't bloat the maxwidth by examining percentage growth.
</span><span class="cx">     bool scale = true;
</span><span class="cx">     while (table) {
</span><del>-        Length tw = table-&gt;style().width();
-        if ((tw.isAuto() || tw.isPercent()) &amp;&amp; !table-&gt;isOutOfFlowPositioned()) {
-            RenderBlock* cb = table-&gt;containingBlock();
-            while (cb &amp;&amp; !cb-&gt;isRenderView() &amp;&amp; !cb-&gt;isTableCell() &amp;&amp;
-                cb-&gt;style().width().isAuto() &amp;&amp; !cb-&gt;isOutOfFlowPositioned())
-                cb = cb-&gt;containingBlock();
</del><ins>+        Length tableWidth = table-&gt;style().width();
+        if ((tableWidth.isAuto() || tableWidth.isPercent()) &amp;&amp; !table-&gt;isOutOfFlowPositioned()) {
+            RenderBlock* containingBlock = table-&gt;containingBlock();
+            while (containingBlock &amp;&amp; !is&lt;RenderView&gt;(*containingBlock) &amp;&amp; !is&lt;RenderTableCell&gt;(*containingBlock)
+                &amp;&amp; containingBlock-&gt;style().width().isAuto() &amp;&amp; !containingBlock-&gt;isOutOfFlowPositioned())
+                containingBlock = containingBlock-&gt;containingBlock();
</ins><span class="cx"> 
</span><del>-            table = 0;
-            if (cb &amp;&amp; cb-&gt;isTableCell() &amp;&amp;
-                (cb-&gt;style().width().isAuto() || cb-&gt;style().width().isPercent())) {
-                RenderTableCell* cell = toRenderTableCell(cb);
-                if (cell-&gt;colSpan() &gt; 1 || cell-&gt;table()-&gt;style().width().isAuto())
</del><ins>+            table = nullptr;
+            if (is&lt;RenderTableCell&gt;(containingBlock)
+                &amp;&amp; (containingBlock-&gt;style().width().isAuto() || containingBlock-&gt;style().width().isPercent())) {
+                RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*containingBlock);
+                if (cell.colSpan() &gt; 1 || cell.table()-&gt;style().width().isAuto())
</ins><span class="cx">                     scale = false;
</span><span class="cx">                 else
</span><del>-                    table = cell-&gt;table();
</del><ins>+                    table = cell.table();
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         else
</span><del>-            table = 0;
</del><ins>+            table = nullptr;
</ins><span class="cx">     }
</span><span class="cx">     return scale;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -368,8 +368,8 @@
</span><span class="cx">             minLogicalWidth = 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (isTableCell()) {
-        Length tableCellWidth = toRenderTableCell(this)-&gt;styleOrColLogicalWidth();
</del><ins>+    if (is&lt;RenderTableCell&gt;(*this)) {
+        Length tableCellWidth = downcast&lt;RenderTableCell&gt;(*this).styleOrColLogicalWidth();
</ins><span class="cx">         if (tableCellWidth.isFixed() &amp;&amp; tableCellWidth.value() &gt; 0)
</span><span class="cx">             maxLogicalWidth = std::max(minLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(tableCellWidth.value()));
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -2812,7 +2812,7 @@
</span><span class="cx">     else if (hasOverrideContainingBlockLogicalHeight())
</span><span class="cx">         availableHeight = overrideContainingBlockContentLogicalHeight();
</span><span class="cx"> #endif
</span><del>-    else if (cb-&gt;isTableCell()) {
</del><ins>+    else if (is&lt;RenderTableCell&gt;(*cb)) {
</ins><span class="cx">         if (!skippedAutoHeightContainingBlock) {
</span><span class="cx">             // Table cells violate what the CSS spec says to do with heights. Basically we
</span><span class="cx">             // don't care if the cell specified a height or not. We just always make ourselves
</span><span class="lines">@@ -2825,8 +2825,8 @@
</span><span class="cx">                 // no size and allow the flexing of the table or the cell to its specified height to cause us
</span><span class="cx">                 // to grow to fill the space. This could end up being wrong in some cases, but it is
</span><span class="cx">                 // preferable to the alternative (sizing intrinsically and making the row end up too big).
</span><del>-                RenderTableCell* cell = toRenderTableCell(cb);
-                if (scrollsOverflowY() &amp;&amp; (!cell-&gt;style().logicalHeight().isAuto() || !cell-&gt;table()-&gt;style().logicalHeight().isAuto()))
</del><ins>+                RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*cb);
+                if (scrollsOverflowY() &amp;&amp; (!cell.style().logicalHeight().isAuto() || !cell.table()-&gt;style().logicalHeight().isAuto()))
</ins><span class="cx">                     return 0;
</span><span class="cx">                 return -1;
</span><span class="cx">             }
</span><span class="lines">@@ -4740,18 +4740,18 @@
</span><span class="cx">             || style().logicalMaxHeight().isPercent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void markBoxForRelayoutAfterSplit(RenderBox* box)
</del><ins>+static void markBoxForRelayoutAfterSplit(RenderBox&amp; box)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: The table code should handle that automatically. If not,
</span><span class="cx">     // we should fix it and remove the table part checks.
</span><del>-    if (box-&gt;isTable()) {
</del><ins>+    if (is&lt;RenderTable&gt;(box)) {
</ins><span class="cx">         // Because we may have added some sections with already computed column structures, we need to
</span><span class="cx">         // sync the table structure with them now. This avoids crashes when adding new cells to the table.
</span><del>-        toRenderTable(box)-&gt;forceSectionsRecalc();
-    } else if (box-&gt;isTableSection())
-        toRenderTableSection(box)-&gt;setNeedsCellRecalc();
</del><ins>+        downcast&lt;RenderTable&gt;(box).forceSectionsRecalc();
+    } else if (is&lt;RenderTableSection&gt;(box))
+        downcast&lt;RenderTableSection&gt;(box).setNeedsCellRecalc();
</ins><span class="cx"> 
</span><del>-    box-&gt;setNeedsLayoutAndPrefWidthsRecalc();
</del><ins>+    box.setNeedsLayoutAndPrefWidthsRecalc();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChild)
</span><span class="lines">@@ -4771,12 +4771,12 @@
</span><span class="cx">             // We need to invalidate the |parentBox| before inserting the new node
</span><span class="cx">             // so that the table repainting logic knows the structure is dirty.
</span><span class="cx">             // See for example RenderTableCell:clippedOverflowRectForRepaint.
</span><del>-            markBoxForRelayoutAfterSplit(parentBox);
</del><ins>+            markBoxForRelayoutAfterSplit(*parentBox);
</ins><span class="cx">             parentBox-&gt;insertChildInternal(postBox, boxToSplit-&gt;nextSibling(), NotifyChildren);
</span><span class="cx">             boxToSplit-&gt;moveChildrenTo(postBox, beforeChild, 0, true);
</span><span class="cx"> 
</span><del>-            markBoxForRelayoutAfterSplit(boxToSplit);
-            markBoxForRelayoutAfterSplit(postBox);
</del><ins>+            markBoxForRelayoutAfterSplit(*boxToSplit);
+            markBoxForRelayoutAfterSplit(*postBox);
</ins><span class="cx"> 
</span><span class="cx">             beforeChild = postBox;
</span><span class="cx">         } else
</span><span class="lines">@@ -4784,7 +4784,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (didSplitParentAnonymousBoxes)
</span><del>-        markBoxForRelayoutAfterSplit(this);
</del><ins>+        markBoxForRelayoutAfterSplit(*this);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(beforeChild-&gt;parent() == this);
</span><span class="cx">     return beforeChild;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -468,24 +468,24 @@
</span><span class="cx"> {
</span><span class="cx">     bool needsTable = false;
</span><span class="cx"> 
</span><del>-    if (newChild-&gt;isRenderTableCol()) {
-        RenderTableCol* newTableColumn = toRenderTableCol(newChild);
-        bool isColumnInColumnGroup = newTableColumn-&gt;isTableColumn() &amp;&amp; isRenderTableCol();
-        needsTable = !isTable() &amp;&amp; !isColumnInColumnGroup;
-    } else if (newChild-&gt;isTableCaption())
-        needsTable = !isTable();
-    else if (newChild-&gt;isTableSection())
-        needsTable = !isTable();
-    else if (newChild-&gt;isTableRow())
-        needsTable = !isTableSection();
-    else if (newChild-&gt;isTableCell())
-        needsTable = !isTableRow();
</del><ins>+    if (is&lt;RenderTableCol&gt;(*newChild)) {
+        RenderTableCol&amp; newTableColumn = downcast&lt;RenderTableCol&gt;(*newChild);
+        bool isColumnInColumnGroup = newTableColumn.isTableColumn() &amp;&amp; is&lt;RenderTableCol&gt;(*this);
+        needsTable = !is&lt;RenderTable&gt;(*this) &amp;&amp; !isColumnInColumnGroup;
+    } else if (is&lt;RenderTableCaption&gt;(*newChild))
+        needsTable = !is&lt;RenderTable&gt;(*this);
+    else if (is&lt;RenderTableSection&gt;(*newChild))
+        needsTable = !is&lt;RenderTable&gt;(*this);
+    else if (is&lt;RenderTableRow&gt;(*newChild))
+        needsTable = !is&lt;RenderTableSection&gt;(*this);
+    else if (is&lt;RenderTableCell&gt;(*newChild))
+        needsTable = !is&lt;RenderTableRow&gt;(*this);
</ins><span class="cx"> 
</span><span class="cx">     if (needsTable) {
</span><span class="cx">         RenderTable* table;
</span><span class="cx">         RenderObject* afterChild = beforeChild ? beforeChild-&gt;previousSibling() : m_lastChild;
</span><del>-        if (afterChild &amp;&amp; afterChild-&gt;isAnonymous() &amp;&amp; afterChild-&gt;isTable() &amp;&amp; !afterChild-&gt;isBeforeContent())
-            table = toRenderTable(afterChild);
</del><ins>+        if (afterChild &amp;&amp; afterChild-&gt;isAnonymous() &amp;&amp; is&lt;RenderTable&gt;(*afterChild) &amp;&amp; !afterChild-&gt;isBeforeContent())
+            table = downcast&lt;RenderTable&gt;(afterChild);
</ins><span class="cx">         else {
</span><span class="cx">             table = RenderTable::createAnonymousWithParentRenderer(this);
</span><span class="cx">             addChild(table, beforeChild);
</span><span class="lines">@@ -494,7 +494,7 @@
</span><span class="cx">     } else
</span><span class="cx">         insertChildInternal(newChild, beforeChild, NotifyChildren);
</span><span class="cx"> 
</span><del>-    if (is&lt;RenderText&gt;(newChild))
</del><ins>+    if (is&lt;RenderText&gt;(*newChild))
</ins><span class="cx">         downcast&lt;RenderText&gt;(*newChild).styleDidChange(StyleDifferenceEqual, nullptr);
</span><span class="cx"> 
</span><span class="cx">     // SVG creates renderers for &lt;g display=&quot;none&quot;&gt;, as SVG requires children of hidden
</span><span class="lines">@@ -506,7 +506,7 @@
</span><span class="cx">     // To avoid the problem alltogether, detect early if we're inside a hidden SVG subtree
</span><span class="cx">     // and stop creating layers at all for these cases - they're not used anyways.
</span><span class="cx">     if (newChild-&gt;hasLayer() &amp;&amp; !layerCreationAllowedForSubtree())
</span><del>-        toRenderLayerModelObject(newChild)-&gt;layer()-&gt;removeOnlyThisLayer();
</del><ins>+        downcast&lt;RenderLayerModelObject&gt;(*newChild).layer()-&gt;removeOnlyThisLayer();
</ins><span class="cx"> 
</span><span class="cx">     SVGRenderSupport::childAdded(*this, *newChild);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -5622,8 +5622,8 @@
</span><span class="cx">     LayoutRect result;
</span><span class="cx">     if (renderer().isInline() &amp;&amp; renderer().isRenderInline())
</span><span class="cx">         result = toRenderInline(renderer()).linesVisualOverflowBoundingBox();
</span><del>-    else if (renderer().isTableRow()) {
-        RenderTableRow&amp; tableRow = toRenderTableRow(renderer());
</del><ins>+    else if (is&lt;RenderTableRow&gt;(renderer())) {
+        RenderTableRow&amp; tableRow = downcast&lt;RenderTableRow&gt;(renderer());
</ins><span class="cx">         // Our bounding box is just the union of all of our cells' border/overflow rects.
</span><span class="cx">         for (RenderTableCell* cell = tableRow.firstCell(); cell; cell = cell-&gt;nextCell()) {
</span><span class="cx">             LayoutRect bbox = cell-&gt;borderBoxRect();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -139,28 +139,28 @@
</span><span class="cx"> {
</span><span class="cx">     bool wrapInAnonymousSection = !child-&gt;isOutOfFlowPositioned();
</span><span class="cx"> 
</span><del>-    if (child-&gt;isTableCaption())
</del><ins>+    if (is&lt;RenderTableCaption&gt;(*child))
</ins><span class="cx">         wrapInAnonymousSection = false;
</span><del>-    else if (child-&gt;isRenderTableCol()) {
</del><ins>+    else if (is&lt;RenderTableCol&gt;(*child)) {
</ins><span class="cx">         m_hasColElements = true;
</span><span class="cx">         wrapInAnonymousSection = false;
</span><del>-    } else if (child-&gt;isTableSection()) {
</del><ins>+    } else if (is&lt;RenderTableSection&gt;(*child)) {
</ins><span class="cx">         switch (child-&gt;style().display()) {
</span><span class="cx">             case TABLE_HEADER_GROUP:
</span><span class="cx">                 resetSectionPointerIfNotBefore(m_head, beforeChild);
</span><span class="cx">                 if (!m_head) {
</span><del>-                    m_head = toRenderTableSection(child);
</del><ins>+                    m_head = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">                 } else {
</span><span class="cx">                     resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
</span><span class="cx">                     if (!m_firstBody) 
</span><del>-                        m_firstBody = toRenderTableSection(child);
</del><ins>+                        m_firstBody = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">                 }
</span><span class="cx">                 wrapInAnonymousSection = false;
</span><span class="cx">                 break;
</span><span class="cx">             case TABLE_FOOTER_GROUP:
</span><span class="cx">                 resetSectionPointerIfNotBefore(m_foot, beforeChild);
</span><span class="cx">                 if (!m_foot) {
</span><del>-                    m_foot = toRenderTableSection(child);
</del><ins>+                    m_foot = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">                     wrapInAnonymousSection = false;
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="lines">@@ -168,18 +168,18 @@
</span><span class="cx">             case TABLE_ROW_GROUP:
</span><span class="cx">                 resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
</span><span class="cx">                 if (!m_firstBody)
</span><del>-                    m_firstBody = toRenderTableSection(child);
</del><ins>+                    m_firstBody = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">                 wrapInAnonymousSection = false;
</span><span class="cx">                 break;
</span><span class="cx">             default:
</span><span class="cx">                 ASSERT_NOT_REACHED();
</span><span class="cx">         }
</span><del>-    } else if (child-&gt;isTableCell() || child-&gt;isTableRow())
</del><ins>+    } else if (is&lt;RenderTableCell&gt;(*child) || is&lt;RenderTableRow&gt;(*child))
</ins><span class="cx">         wrapInAnonymousSection = true;
</span><span class="cx">     else
</span><span class="cx">         wrapInAnonymousSection = true;
</span><span class="cx"> 
</span><del>-    if (child-&gt;isTableSection())
</del><ins>+    if (is&lt;RenderTableSection&gt;(*child))
</ins><span class="cx">         setNeedsSectionRecalc();
</span><span class="cx"> 
</span><span class="cx">     if (!wrapInAnonymousSection) {
</span><span class="lines">@@ -190,32 +190,32 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!beforeChild &amp;&amp; lastChild() &amp;&amp; lastChild()-&gt;isTableSection() &amp;&amp; lastChild()-&gt;isAnonymous() &amp;&amp; !lastChild()-&gt;isBeforeContent()) {
-        toRenderTableSection(lastChild())-&gt;addChild(child);
</del><ins>+    if (!beforeChild &amp;&amp; is&lt;RenderTableSection&gt;(lastChild()) &amp;&amp; lastChild()-&gt;isAnonymous() &amp;&amp; !lastChild()-&gt;isBeforeContent()) {
+        downcast&lt;RenderTableSection&gt;(*lastChild()).addChild(child);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (beforeChild &amp;&amp; !beforeChild-&gt;isAnonymous() &amp;&amp; beforeChild-&gt;parent() == this) {
</span><span class="cx">         RenderObject* section = beforeChild-&gt;previousSibling();
</span><del>-        if (section &amp;&amp; section-&gt;isTableSection() &amp;&amp; section-&gt;isAnonymous()) {
-            toRenderTableSection(section)-&gt;addChild(child);
</del><ins>+        if (is&lt;RenderTableSection&gt;(section) &amp;&amp; section-&gt;isAnonymous()) {
+            downcast&lt;RenderTableSection&gt;(*section).addChild(child);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RenderObject* lastBox = beforeChild;
</span><del>-    while (lastBox &amp;&amp; lastBox-&gt;parent()-&gt;isAnonymous() &amp;&amp; !lastBox-&gt;isTableSection() &amp;&amp; lastBox-&gt;style().display() != TABLE_CAPTION &amp;&amp; lastBox-&gt;style().display() != TABLE_COLUMN_GROUP)
</del><ins>+    while (lastBox &amp;&amp; lastBox-&gt;parent()-&gt;isAnonymous() &amp;&amp; !is&lt;RenderTableSection&gt;(*lastBox) &amp;&amp; lastBox-&gt;style().display() != TABLE_CAPTION &amp;&amp; lastBox-&gt;style().display() != TABLE_COLUMN_GROUP)
</ins><span class="cx">         lastBox = lastBox-&gt;parent();
</span><span class="cx">     if (lastBox &amp;&amp; lastBox-&gt;isAnonymous() &amp;&amp; !isAfterContent(lastBox) &amp;&amp; lastBox-&gt;isTableSection()) {
</span><del>-        RenderTableSection* section = toRenderTableSection(lastBox);
-        if (beforeChild == section)
-            beforeChild = section-&gt;firstRow();
-        section-&gt;addChild(child, beforeChild);
</del><ins>+        RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*lastBox);
+        if (beforeChild == &amp;section)
+            beforeChild = section.firstRow();
+        section.addChild(child, beforeChild);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (beforeChild &amp;&amp; !beforeChild-&gt;isTableSection() &amp;&amp; beforeChild-&gt;style().display() != TABLE_CAPTION &amp;&amp; beforeChild-&gt;style().display() != TABLE_COLUMN_GROUP)
-        beforeChild = 0;
</del><ins>+    if (beforeChild &amp;&amp; !is&lt;RenderTableSection&gt;(*beforeChild) &amp;&amp; beforeChild-&gt;style().display() != TABLE_CAPTION &amp;&amp; beforeChild-&gt;style().display() != TABLE_COLUMN_GROUP)
+        beforeChild = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RenderTableSection* section = RenderTableSection::createAnonymousWithParentRenderer(this);
</span><span class="cx">     addChild(section, beforeChild);
</span><span class="lines">@@ -459,8 +459,8 @@
</span><span class="cx">     bool collapsing = collapseBorders();
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; child : childrenOfType&lt;RenderElement&gt;(*this)) {
</span><del>-        if (child.isTableSection()) {
-            RenderTableSection&amp; section = toRenderTableSection(child);
</del><ins>+        if (is&lt;RenderTableSection&gt;(child)) {
+            RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">             if (m_columnLogicalWidthChanged)
</span><span class="cx">                 section.setChildNeedsLayout(MarkOnlyThis);
</span><span class="cx">             section.layoutIfNeeded();
</span><span class="lines">@@ -468,8 +468,8 @@
</span><span class="cx">             if (collapsing)
</span><span class="cx">                 section.recalcOuterBorder();
</span><span class="cx">             ASSERT(!section.needsLayout());
</span><del>-        } else if (child.isRenderTableCol()) {
-            toRenderTableCol(child).layoutIfNeeded();
</del><ins>+        } else if (is&lt;RenderTableCol&gt;(child)) {
+            downcast&lt;RenderTableCol&gt;(child).layoutIfNeeded();
</ins><span class="cx">             ASSERT(!child.needsLayout());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -851,15 +851,15 @@
</span><span class="cx"> RenderTableCol* RenderTable::firstColumn() const
</span><span class="cx"> {
</span><span class="cx">     for (RenderObject* child = firstChild(); child; child = child-&gt;nextSibling()) {
</span><del>-        if (child-&gt;isRenderTableCol())
-            return toRenderTableCol(child);
</del><ins>+        if (is&lt;RenderTableCol&gt;(*child))
+            return downcast&lt;RenderTableCol&gt;(child);
</ins><span class="cx"> 
</span><span class="cx">         // We allow only table-captions before columns or column-groups.
</span><del>-        if (!child-&gt;isTableCaption())
-            return 0;
</del><ins>+        if (!is&lt;RenderTableCaption&gt;(*child))
+            return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderTable::updateColumnCache() const
</span><span class="lines">@@ -1006,31 +1006,31 @@
</span><span class="cx">             m_hasColElements = true;
</span><span class="cx">             break;
</span><span class="cx">         case TABLE_HEADER_GROUP:
</span><del>-            if (child-&gt;isTableSection()) {
-                RenderTableSection* section = toRenderTableSection(child);
</del><ins>+            if (is&lt;RenderTableSection&gt;(*child)) {
+                RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*child);
</ins><span class="cx">                 if (!m_head)
</span><del>-                    m_head = section;
</del><ins>+                    m_head = &amp;section;
</ins><span class="cx">                 else if (!m_firstBody)
</span><del>-                    m_firstBody = section;
-                section-&gt;recalcCellsIfNeeded();
</del><ins>+                    m_firstBody = &amp;section;
+                section.recalcCellsIfNeeded();
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case TABLE_FOOTER_GROUP:
</span><del>-            if (child-&gt;isTableSection()) {
-                RenderTableSection* section = toRenderTableSection(child);
</del><ins>+            if (is&lt;RenderTableSection&gt;(*child)) {
+                RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*child);
</ins><span class="cx">                 if (!m_foot)
</span><del>-                    m_foot = section;
</del><ins>+                    m_foot = &amp;section;
</ins><span class="cx">                 else if (!m_firstBody)
</span><del>-                    m_firstBody = section;
-                section-&gt;recalcCellsIfNeeded();
</del><ins>+                    m_firstBody = &amp;section;
+                section.recalcCellsIfNeeded();
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case TABLE_ROW_GROUP:
</span><del>-            if (child-&gt;isTableSection()) {
-                RenderTableSection* section = toRenderTableSection(child);
</del><ins>+            if (is&lt;RenderTableSection&gt;(*child)) {
+                RenderTableSection&amp; section = downcast&lt;RenderTableSection&gt;(*child);
</ins><span class="cx">                 if (!m_firstBody)
</span><del>-                    m_firstBody = section;
-                section-&gt;recalcCellsIfNeeded();
</del><ins>+                    m_firstBody = &amp;section;
+                section.recalcCellsIfNeeded();
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="lines">@@ -1284,17 +1284,17 @@
</span><span class="cx">     recalcSectionsIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     if (section == m_head)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RenderObject* prevSection = section == m_foot ? lastChild() : section-&gt;previousSibling();
</span><span class="cx">     while (prevSection) {
</span><del>-        if (prevSection-&gt;isTableSection() &amp;&amp; prevSection != m_head &amp;&amp; prevSection != m_foot &amp;&amp; (skipEmptySections == DoNotSkipEmptySections || toRenderTableSection(prevSection)-&gt;numRows()))
</del><ins>+        if (is&lt;RenderTableSection&gt;(*prevSection) &amp;&amp; prevSection != m_head &amp;&amp; prevSection != m_foot &amp;&amp; (skipEmptySections == DoNotSkipEmptySections || downcast&lt;RenderTableSection&gt;(*prevSection).numRows()))
</ins><span class="cx">             break;
</span><span class="cx">         prevSection = prevSection-&gt;previousSibling();
</span><span class="cx">     }
</span><span class="cx">     if (!prevSection &amp;&amp; m_head &amp;&amp; (skipEmptySections == DoNotSkipEmptySections || m_head-&gt;numRows()))
</span><span class="cx">         prevSection = m_head;
</span><del>-    return toRenderTableSection(prevSection);
</del><ins>+    return downcast&lt;RenderTableSection&gt;(prevSection);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTableSection* RenderTable::sectionBelow(const RenderTableSection* section, SkipEmptySectionsValue skipEmptySections) const
</span><span class="lines">@@ -1302,17 +1302,17 @@
</span><span class="cx">     recalcSectionsIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     if (section == m_foot)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RenderObject* nextSection = section == m_head ? firstChild() : section-&gt;nextSibling();
</span><span class="cx">     while (nextSection) {
</span><del>-        if (nextSection-&gt;isTableSection() &amp;&amp; nextSection != m_head &amp;&amp; nextSection != m_foot &amp;&amp; (skipEmptySections  == DoNotSkipEmptySections || toRenderTableSection(nextSection)-&gt;numRows()))
</del><ins>+        if (is&lt;RenderTableSection&gt;(*nextSection) &amp;&amp; nextSection != m_head &amp;&amp; nextSection != m_foot &amp;&amp; (skipEmptySections  == DoNotSkipEmptySections || downcast&lt;RenderTableSection&gt;(*nextSection).numRows()))
</ins><span class="cx">             break;
</span><span class="cx">         nextSection = nextSection-&gt;nextSibling();
</span><span class="cx">     }
</span><span class="cx">     if (!nextSection &amp;&amp; m_foot &amp;&amp; (skipEmptySections == DoNotSkipEmptySections || m_foot-&gt;numRows()))
</span><span class="cx">         nextSection = m_foot;
</span><del>-    return toRenderTableSection(nextSection);
</del><ins>+    return downcast&lt;RenderTableSection&gt;(nextSection);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTableSection* RenderTable::bottomSection() const
</span><span class="lines">@@ -1323,11 +1323,11 @@
</span><span class="cx">         return m_foot;
</span><span class="cx"> 
</span><span class="cx">     for (RenderObject* child = lastChild(); child; child = child-&gt;previousSibling()) {
</span><del>-        if (child-&gt;isTableSection())
-            return toRenderTableSection(child);
</del><ins>+        if (is&lt;RenderTableSection&gt;(*child))
+            return downcast&lt;RenderTableSection&gt;(child);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTable.h (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTable.h        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTable.h        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -381,8 +381,6 @@
</span><span class="cx">     return m_foot;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTable, isTable())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableCaptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCaption.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCaption.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableCaption.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> RenderTable* RenderTableCaption::table() const
</span><span class="cx"> {
</span><del>-    return toRenderTable(parent());
</del><ins>+    return downcast&lt;RenderTable&gt;(parent());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableCellh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCell.h        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx">     RenderTableCell* nextCell() const;
</span><span class="cx">     RenderTableCell* previousCell() const;
</span><span class="cx"> 
</span><del>-    RenderTableRow* row() const { return toRenderTableRow(parent()); }
-    RenderTableSection* section() const { return toRenderTableSection(parent()-&gt;parent()); }
-    RenderTable* table() const { return toRenderTable(parent()-&gt;parent()-&gt;parent()); }
</del><ins>+    RenderTableRow* row() const { return downcast&lt;RenderTableRow&gt;(parent()); }
+    RenderTableSection* section() const { return downcast&lt;RenderTableSection&gt;(parent()-&gt;parent()); }
+    RenderTable* table() const { return downcast&lt;RenderTable&gt;(parent()-&gt;parent()-&gt;parent()); }
</ins><span class="cx"> 
</span><span class="cx">     unsigned rowIndex() const
</span><span class="cx">     {
</span><span class="lines">@@ -294,26 +294,24 @@
</span><span class="cx">     int m_intrinsicPaddingAfter;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTableCell, isTableCell())
-
</del><span class="cx"> inline RenderTableCell* RenderTableCell::nextCell() const
</span><span class="cx"> {
</span><del>-    return toRenderTableCell(RenderBlockFlow::nextSibling());
</del><ins>+    return downcast&lt;RenderTableCell&gt;(RenderBlockFlow::nextSibling());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableCell* RenderTableCell::previousCell() const
</span><span class="cx"> {
</span><del>-    return toRenderTableCell(RenderBlockFlow::previousSibling());
</del><ins>+    return downcast&lt;RenderTableCell&gt;(RenderBlockFlow::previousSibling());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableCell* RenderTableRow::firstCell() const
</span><span class="cx"> {
</span><del>-    return toRenderTableCell(RenderBox::firstChild());
</del><ins>+    return downcast&lt;RenderTableCell&gt;(RenderBox::firstChild());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableCell* RenderTableRow::lastCell() const
</span><span class="cx"> {
</span><del>-    return toRenderTableCell(RenderBox::lastChild());
</del><ins>+    return downcast&lt;RenderTableCell&gt;(RenderBox::lastChild());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableColcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCol.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCol.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableCol.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;HTMLTableColElement.h&quot;
</span><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="cx"> #include &quot;RenderTable.h&quot;
</span><ins>+#include &quot;RenderTableCaption.h&quot;
</ins><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -139,44 +140,44 @@
</span><span class="cx"> RenderTable* RenderTableCol::table() const
</span><span class="cx"> {
</span><span class="cx">     auto table = parent();
</span><del>-    if (table &amp;&amp; !table-&gt;isTable())
</del><ins>+    if (table &amp;&amp; !is&lt;RenderTable&gt;(*table))
</ins><span class="cx">         table = table-&gt;parent();
</span><del>-    return table &amp;&amp; table-&gt;isTable() ? toRenderTable(table) : 0;
</del><ins>+    return is&lt;RenderTable&gt;(table) ? downcast&lt;RenderTable&gt;(table) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTableCol* RenderTableCol::enclosingColumnGroup() const
</span><span class="cx"> {
</span><del>-    if (!parent()-&gt;isRenderTableCol())
-        return 0;
</del><ins>+    if (!is&lt;RenderTableCol&gt;(*parent()))
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    RenderTableCol* parentColumnGroup = toRenderTableCol(parent());
-    ASSERT(parentColumnGroup-&gt;isTableColumnGroup());
</del><ins>+    RenderTableCol&amp; parentColumnGroup = downcast&lt;RenderTableCol&gt;(*parent());
+    ASSERT(parentColumnGroup.isTableColumnGroup());
</ins><span class="cx">     ASSERT(isTableColumn());
</span><del>-    return parentColumnGroup;
</del><ins>+    return &amp;parentColumnGroup;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderTableCol* RenderTableCol::nextColumn() const
</span><span class="cx"> {
</span><span class="cx">     // If |this| is a column-group, the next column is the colgroup's first child column.
</span><span class="cx">     if (RenderObject* firstChild = this-&gt;firstChild())
</span><del>-        return toRenderTableCol(firstChild);
</del><ins>+        return downcast&lt;RenderTableCol&gt;(firstChild);
</ins><span class="cx"> 
</span><span class="cx">     // Otherwise it's the next column along.
</span><span class="cx">     RenderObject* next = nextSibling();
</span><span class="cx"> 
</span><span class="cx">     // Failing that, the child is the last column in a column-group, so the next column is the next column/column-group after its column-group.
</span><del>-    if (!next &amp;&amp; parent()-&gt;isRenderTableCol())
</del><ins>+    if (!next &amp;&amp; is&lt;RenderTableCol&gt;(*parent()))
</ins><span class="cx">         next = parent()-&gt;nextSibling();
</span><span class="cx"> 
</span><del>-    for (; next &amp;&amp; !next-&gt;isRenderTableCol(); next = next-&gt;nextSibling()) {
</del><ins>+    for (; next &amp;&amp; !is&lt;RenderTableCol&gt;(*next); next = next-&gt;nextSibling()) {
</ins><span class="cx">         // We allow captions mixed with columns and column-groups.
</span><del>-        if (next-&gt;isTableCaption())
</del><ins>+        if (is&lt;RenderTableCaption&gt;(*next))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return toRenderTableCol(next);
</del><ins>+    return downcast&lt;RenderTableCol&gt;(next);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const BorderValue&amp; RenderTableCol::borderAdjoiningCellStartBorder(const RenderTableCell*) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableColh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableCol.h (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableCol.h        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableCol.h        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -75,11 +75,11 @@
</span><span class="cx">     virtual LayoutUnit offsetTop() const override;
</span><span class="cx">     virtual LayoutUnit offsetWidth() const override;
</span><span class="cx">     virtual LayoutUnit offsetHeight() const override;
</span><ins>+    virtual void updateFromElement() override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual const char* renderName() const override { return &quot;RenderTableCol&quot;; }
</span><span class="cx">     virtual bool isRenderTableCol() const override { return true; }
</span><del>-    virtual void updateFromElement() override;
</del><span class="cx">     virtual void computePreferredLogicalWidths() override { ASSERT_NOT_REACHED(); }
</span><span class="cx"> 
</span><span class="cx">     virtual void insertedIntoTree() override;
</span><span class="lines">@@ -100,8 +100,6 @@
</span><span class="cx">     unsigned m_span;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTableCol, isRenderTableCol())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableCol, isRenderTableCol())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableRow.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -109,28 +109,28 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
</span><span class="cx"> {
</span><del>-    if (!child-&gt;isTableCell()) {
</del><ins>+    if (!is&lt;RenderTableCell&gt;(*child)) {
</ins><span class="cx">         RenderObject* last = beforeChild;
</span><span class="cx">         if (!last)
</span><span class="cx">             last = lastCell();
</span><del>-        if (last &amp;&amp; last-&gt;isAnonymous() &amp;&amp; last-&gt;isTableCell() &amp;&amp; !last-&gt;isBeforeOrAfterContent()) {
-            RenderTableCell* cell = toRenderTableCell(last);
-            if (beforeChild == cell)
-                beforeChild = cell-&gt;firstChild();
-            cell-&gt;addChild(child, beforeChild);
</del><ins>+        if (last &amp;&amp; last-&gt;isAnonymous() &amp;&amp; is&lt;RenderTableCell&gt;(*last) &amp;&amp; !last-&gt;isBeforeOrAfterContent()) {
+            RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*last);
+            if (beforeChild == &amp;cell)
+                beforeChild = cell.firstChild();
+            cell.addChild(child, beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (beforeChild &amp;&amp; !beforeChild-&gt;isAnonymous() &amp;&amp; beforeChild-&gt;parent() == this) {
</span><span class="cx">             RenderObject* cell = beforeChild-&gt;previousSibling();
</span><del>-            if (cell &amp;&amp; cell-&gt;isTableCell() &amp;&amp; cell-&gt;isAnonymous()) {
-                toRenderTableCell(cell)-&gt;addChild(child);
</del><ins>+            if (is&lt;RenderTableCell&gt;(cell) &amp;&amp; cell-&gt;isAnonymous()) {
+                downcast&lt;RenderTableCell&gt;(*cell).addChild(child);
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If beforeChild is inside an anonymous cell, insert into the cell.
</span><del>-        if (last &amp;&amp; !last-&gt;isTableCell() &amp;&amp; last-&gt;parent() &amp;&amp; last-&gt;parent()-&gt;isAnonymous() &amp;&amp; !last-&gt;parent()-&gt;isBeforeOrAfterContent()) {
</del><ins>+        if (last &amp;&amp; !is&lt;RenderTableCell&gt;(*last) &amp;&amp; last-&gt;parent() &amp;&amp; last-&gt;parent()-&gt;isAnonymous() &amp;&amp; !last-&gt;parent()-&gt;isBeforeOrAfterContent()) {
</ins><span class="cx">             last-&gt;parent()-&gt;addChild(child, beforeChild);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -144,14 +144,14 @@
</span><span class="cx">     if (beforeChild &amp;&amp; beforeChild-&gt;parent() != this)
</span><span class="cx">         beforeChild = splitAnonymousBoxesAroundChild(beforeChild);    
</span><span class="cx"> 
</span><del>-    RenderTableCell* cell = toRenderTableCell(child);
</del><ins>+    RenderTableCell&amp; cell = downcast&lt;RenderTableCell&gt;(*child);
</ins><span class="cx"> 
</span><span class="cx">     // Generated content can result in us having a null section so make sure to null check our parent.
</span><span class="cx">     if (parent())
</span><del>-        section()-&gt;addCell(cell, this);
</del><ins>+        section()-&gt;addCell(&amp;cell, this);
</ins><span class="cx"> 
</span><del>-    ASSERT(!beforeChild || beforeChild-&gt;isTableCell());
-    RenderBox::addChild(cell, beforeChild);
</del><ins>+    ASSERT(!beforeChild || is&lt;RenderTableCell&gt;(*beforeChild));
+    RenderBox::addChild(&amp;cell, beforeChild);
</ins><span class="cx"> 
</span><span class="cx">     if (beforeChild || nextRow())
</span><span class="cx">         section()-&gt;setNeedsCellRecalc();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableRowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableRow.h (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableRow.h        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableRow.h        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx">     RenderTableCell* firstCell() const;
</span><span class="cx">     RenderTableCell* lastCell() const;
</span><span class="cx"> 
</span><del>-    RenderTableSection* section() const { return toRenderTableSection(parent()); }
-    RenderTable* table() const { return toRenderTable(parent()-&gt;parent()); }
</del><ins>+    RenderTableSection* section() const { return downcast&lt;RenderTableSection&gt;(parent()); }
+    RenderTable* table() const { return downcast&lt;RenderTable&gt;(parent()-&gt;parent()); }
</ins><span class="cx"> 
</span><span class="cx">     void paintOutlineForRowIfNeeded(PaintInfo&amp;, const LayoutPoint&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -119,26 +119,24 @@
</span><span class="cx">     unsigned m_rowIndex : 31;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTableRow, isTableRow())
-
</del><span class="cx"> inline RenderTableRow* RenderTableSection::firstRow() const
</span><span class="cx"> {
</span><del>-    return toRenderTableRow(RenderBox::firstChild());
</del><ins>+    return downcast&lt;RenderTableRow&gt;(RenderBox::firstChild());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableRow* RenderTableSection::lastRow() const
</span><span class="cx"> {
</span><del>-    return toRenderTableRow(RenderBox::lastChild());
</del><ins>+    return downcast&lt;RenderTableRow&gt;(RenderBox::lastChild());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableRow* RenderTableRow::nextRow() const
</span><span class="cx"> {
</span><del>-    return toRenderTableRow(RenderBox::nextSibling());
</del><ins>+    return downcast&lt;RenderTableRow&gt;(RenderBox::nextSibling());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline RenderTableRow* RenderTableRow::previousRow() const
</span><span class="cx"> {
</span><del>-    return toRenderTableRow(RenderBox::previousSibling());
</del><ins>+    return downcast&lt;RenderTableRow&gt;(RenderBox::previousSibling());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;RenderTableCol.h&quot;
</span><span class="cx"> #include &quot;RenderTableRow.h&quot;
</span><ins>+#include &quot;RenderTextControl.h&quot;
</ins><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;StyleInheritedData.h&quot;
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="lines">@@ -135,22 +136,22 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild)
</span><span class="cx"> {
</span><del>-    if (!child-&gt;isTableRow()) {
</del><ins>+    if (!is&lt;RenderTableRow&gt;(*child)) {
</ins><span class="cx">         RenderObject* last = beforeChild;
</span><span class="cx">         if (!last)
</span><span class="cx">             last = lastRow();
</span><span class="cx">         if (last &amp;&amp; last-&gt;isAnonymous() &amp;&amp; !last-&gt;isBeforeOrAfterContent()) {
</span><del>-            RenderTableRow* row = toRenderTableRow(last);
-            if (beforeChild == row)
-                beforeChild = row-&gt;firstCell();
-            row-&gt;addChild(child, beforeChild);
</del><ins>+            RenderTableRow&amp; row = downcast&lt;RenderTableRow&gt;(*last);
+            if (beforeChild == &amp;row)
+                beforeChild = row.firstCell();
+            row.addChild(child, beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (beforeChild &amp;&amp; !beforeChild-&gt;isAnonymous() &amp;&amp; beforeChild-&gt;parent() == this) {
</span><span class="cx">             RenderObject* row = beforeChild-&gt;previousSibling();
</span><del>-            if (row &amp;&amp; row-&gt;isTableRow() &amp;&amp; row-&gt;isAnonymous()) {
-                toRenderTableRow(row)-&gt;addChild(child);
</del><ins>+            if (is&lt;RenderTableRow&gt;(row) &amp;&amp; row-&gt;isAnonymous()) {
+                downcast&lt;RenderTableRow&gt;(*row).addChild(child);
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -158,10 +159,10 @@
</span><span class="cx">         // If beforeChild is inside an anonymous cell/row, insert into the cell or into
</span><span class="cx">         // the anonymous row containing it, if there is one.
</span><span class="cx">         RenderObject* lastBox = last;
</span><del>-        while (lastBox &amp;&amp; lastBox-&gt;parent()-&gt;isAnonymous() &amp;&amp; !lastBox-&gt;isTableRow())
</del><ins>+        while (lastBox &amp;&amp; lastBox-&gt;parent()-&gt;isAnonymous() &amp;&amp; !is&lt;RenderTableRow&gt;(*lastBox))
</ins><span class="cx">             lastBox = lastBox-&gt;parent();
</span><span class="cx">         if (lastBox &amp;&amp; lastBox-&gt;isAnonymous() &amp;&amp; !lastBox-&gt;isBeforeOrAfterContent()) {
</span><del>-            toRenderTableRow(lastBox)-&gt;addChild(child, beforeChild);
</del><ins>+            downcast&lt;RenderTableRow&gt;(*lastBox).addChild(child, beforeChild);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -180,9 +181,9 @@
</span><span class="cx"> 
</span><span class="cx">     ensureRows(m_cRow);
</span><span class="cx"> 
</span><del>-    RenderTableRow* row = toRenderTableRow(child);
-    m_grid[insertionRow].rowRenderer = row;
-    row-&gt;setRowIndex(insertionRow);
</del><ins>+    RenderTableRow&amp; row = downcast&lt;RenderTableRow&gt;(*child);
+    m_grid[insertionRow].rowRenderer = &amp;row;
+    row.setRowIndex(insertionRow);
</ins><span class="cx"> 
</span><span class="cx">     if (!beforeChild)
</span><span class="cx">         setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(m_grid[insertionRow]);
</span><span class="lines">@@ -190,7 +191,7 @@
</span><span class="cx">     if (beforeChild &amp;&amp; beforeChild-&gt;parent() != this)
</span><span class="cx">         beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
</span><span class="cx"> 
</span><del>-    ASSERT(!beforeChild || beforeChild-&gt;isTableRow());
</del><ins>+    ASSERT(!beforeChild || is&lt;RenderTableRow&gt;(*beforeChild));
</ins><span class="cx">     RenderBox::addChild(child, beforeChild);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -577,11 +578,11 @@
</span><span class="cx">             bool flexAllChildren = cell-&gt;style().logicalHeight().isFixed()
</span><span class="cx">                 || (!table()-&gt;style().logicalHeight().isAuto() &amp;&amp; rHeight != cell-&gt;logicalHeight());
</span><span class="cx"> 
</span><del>-            for (RenderObject* o = cell-&gt;firstChild(); o; o = o-&gt;nextSibling()) {
-                if (!o-&gt;isText() &amp;&amp; o-&gt;style().logicalHeight().isPercent() &amp;&amp; (flexAllChildren || ((o-&gt;isReplaced() || (o-&gt;isBox() &amp;&amp; toRenderBox(o)-&gt;scrollsOverflow())) &amp;&amp; !o-&gt;isTextControl()))) {
</del><ins>+            for (RenderObject* renderer = cell-&gt;firstChild(); renderer; renderer = renderer-&gt;nextSibling()) {
+                if (!is&lt;RenderText&gt;(*renderer) &amp;&amp; renderer-&gt;style().logicalHeight().isPercent() &amp;&amp; (flexAllChildren || ((renderer-&gt;isReplaced() || (is&lt;RenderBox&gt;(*renderer) &amp;&amp; downcast&lt;RenderBox&gt;(*renderer).scrollsOverflow())) &amp;&amp; !is&lt;RenderTextControl&gt;(*renderer)))) {
</ins><span class="cx">                     // Tables with no sections do not flex.
</span><del>-                    if (!o-&gt;isTable() || toRenderTable(o)-&gt;hasSections()) {
-                        o-&gt;setNeedsLayout(MarkOnlyThis);
</del><ins>+                    if (!is&lt;RenderTable&gt;(*renderer) || downcast&lt;RenderTable&gt;(*renderer).hasSections()) {
+                        renderer-&gt;setNeedsLayout(MarkOnlyThis);
</ins><span class="cx">                         cellChildrenFlex = true;
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -985,13 +986,13 @@
</span><span class="cx"> {
</span><span class="cx">     LayoutPoint cellPoint = flipForWritingModeForChild(cell, paintOffset);
</span><span class="cx">     PaintPhase paintPhase = paintInfo.phase;
</span><del>-    RenderTableRow* row = toRenderTableRow(cell-&gt;parent());
</del><ins>+    RenderTableRow&amp; row = downcast&lt;RenderTableRow&gt;(*cell-&gt;parent());
</ins><span class="cx"> 
</span><span class="cx">     if (paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) {
</span><span class="cx">         // We need to handle painting a stack of backgrounds.  This stack (from bottom to top) consists of
</span><span class="cx">         // the column group, column, row group, row, and then the cell.
</span><span class="cx">         RenderTableCol* column = table()-&gt;colElement(cell-&gt;col());
</span><del>-        RenderTableCol* columnGroup = column ? column-&gt;enclosingColumnGroup() : 0;
</del><ins>+        RenderTableCol* columnGroup = column ? column-&gt;enclosingColumnGroup() : nullptr;
</ins><span class="cx"> 
</span><span class="cx">         // Column groups and columns first.
</span><span class="cx">         // FIXME: Columns and column groups do not currently support opacity, and they are being painted &quot;too late&quot; in
</span><span class="lines">@@ -1006,10 +1007,10 @@
</span><span class="cx"> 
</span><span class="cx">         // Paint the row next, but only if it doesn't have a layer.  If a row has a layer, it will be responsible for
</span><span class="cx">         // painting the row background for the cell.
</span><del>-        if (!row-&gt;hasSelfPaintingLayer())
-            cell-&gt;paintBackgroundsBehindCell(paintInfo, cellPoint, row);
</del><ins>+        if (!row.hasSelfPaintingLayer())
+            cell-&gt;paintBackgroundsBehindCell(paintInfo, cellPoint, &amp;row);
</ins><span class="cx">     }
</span><del>-    if ((!cell-&gt;hasSelfPaintingLayer() &amp;&amp; !row-&gt;hasSelfPaintingLayer()))
</del><ins>+    if ((!cell-&gt;hasSelfPaintingLayer() &amp;&amp; !row.hasSelfPaintingLayer()))
</ins><span class="cx">         cell-&gt;paint(paintInfo, cellPoint);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTableSectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTableSection.h (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTableSection.h        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTableSection.h        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     void layoutRows();
</span><span class="cx">     void computeOverflowFromCells();
</span><span class="cx"> 
</span><del>-    RenderTable* table() const { return toRenderTable(parent()); }
</del><ins>+    RenderTable* table() const { return downcast&lt;RenderTable&gt;(parent()); }
</ins><span class="cx"> 
</span><span class="cx">     struct CellStruct {
</span><span class="cx">         Vector&lt;RenderTableCell*, 1&gt; cells; 
</span><span class="lines">@@ -347,8 +347,6 @@
</span><span class="cx">     HashMap&lt;std::pair&lt;const RenderTableCell*, int&gt;, CollapsedBorderValue &gt; m_cellsCollapsedBorders;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-RENDER_OBJECT_TYPE_CASTS(RenderTableSection, isTableSection())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderTableSection, isTableSection())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (174652 => 174653)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-13 17:49:16 UTC (rev 174652)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2014-10-13 18:21:11 UTC (rev 174653)
</span><span class="lines">@@ -467,8 +467,8 @@
</span><span class="cx">     int logicalWidth = ceilf(run.left() + run.logicalWidth()) - x;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Table cell adjustment is temporary until results can be updated.
</span><del>-    if (o.containingBlock()-&gt;isTableCell())
-        y -= toRenderTableCell(o.containingBlock())-&gt;intrinsicPaddingBefore();
</del><ins>+    if (is&lt;RenderTableCell&gt;(*o.containingBlock()))
+        y -= downcast&lt;RenderTableCell&gt;(*o.containingBlock()).intrinsicPaddingBefore();
</ins><span class="cx">         
</span><span class="cx">     ts &lt;&lt; &quot;text run at (&quot; &lt;&lt; x &lt;&lt; &quot;,&quot; &lt;&lt; y &lt;&lt; &quot;) width &quot; &lt;&lt; logicalWidth;
</span><span class="cx">     if (!run.isLeftToRightDirection() || run.dirOverride()) {
</span><span class="lines">@@ -489,8 +489,8 @@
</span><span class="cx">     int y = rect.y();
</span><span class="cx">     int logicalWidth = ceilf(rect.x() + rect.width()) - x;
</span><span class="cx"> 
</span><del>-    if (o.containingBlock()-&gt;isTableCell())
-        y -= toRenderTableCell(o.containingBlock())-&gt;intrinsicPaddingBefore();
</del><ins>+    if (is&lt;RenderTableCell&gt;(*o.containingBlock()))
+        y -= downcast&lt;RenderTableCell&gt;(*o.containingBlock()).intrinsicPaddingBefore();
</ins><span class="cx">         
</span><span class="cx">     ts &lt;&lt; &quot;text run at (&quot; &lt;&lt; x &lt;&lt; &quot;,&quot; &lt;&lt; y &lt;&lt; &quot;) width &quot; &lt;&lt; logicalWidth;
</span><span class="cx">     ts &lt;&lt; &quot;: &quot;
</span></span></pre>
</div>
</div>

</body>
</html>