<!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>[167934] trunk</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/167934">167934</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2014-04-29 09:15:14 -0700 (Tue, 29 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Row span info is wrong for table cells when a footer section is placed above a body section
https://bugs.webkit.org/show_bug.cgi?id=131832

Reviewed by Mario Sanchez Prada.


Source/WebCore: 
If a &lt;footer&gt; section is placed before the body, it renders AX row information and order incorrectly.
This also affects ARIA tables because they add their children by looking at renderer children, instead
interrogating the RenderTable directly.

Test: accessibility/table-with-footer-section-above-body.html

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addTableCellChild):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::addChildrenFromSection):
* accessibility/AccessibilityTable.h:
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):

LayoutTests: 
* accessibility/table-with-footer-section-above-body-expected.txt: Added.
* accessibility/table-with-footer-section-above-body.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<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="#trunkSourceWebCoreaccessibilityAccessibilityTableh">trunk/Source/WebCore/accessibility/AccessibilityTable.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp">trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitytablewithfootersectionabovebodyexpectedtxt">trunk/LayoutTests/accessibility/table-with-footer-section-above-body-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytablewithfootersectionabovebodyhtml">trunk/LayoutTests/accessibility/table-with-footer-section-above-body.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/LayoutTests/ChangeLog        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2014-04-29  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        AX: Row span info is wrong for table cells when a footer section is placed above a body section
+        https://bugs.webkit.org/show_bug.cgi?id=131832
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/table-with-footer-section-above-body-expected.txt: Added.
+        * accessibility/table-with-footer-section-above-body.html: Added.
+
+2014-04-29  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
</ins><span class="cx">         AX: SpeechSynthesisUtterance cannot addEventListener
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=132321
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytablewithfootersectionabovebodyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/table-with-footer-section-above-body-expected.txt (0 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/table-with-footer-section-above-body-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/table-with-footer-section-above-body-expected.txt        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This tests that the row span information for the cells in the body is not offset by the footer section, even though the footer section is above the body in the DOM. This tests tables that have a role=grid and without.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Table1 cell content at {0, 1}: AXValue: a
+Table1 cell range at {0, 1}: {1, 1}
+Table1 cell content at {0, 2}: AXValue: Name
+Table1 cell range at {0, 2}: {2, 1}
+Table2 cell content at {0, 1}: AXValue: a
+Table2 cell range at {0, 1}: {1, 1}
+Table2 cell content at {0, 2}: AXValue: Name
+Table2 cell range at {0, 2}: {2, 1}
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytablewithfootersectionabovebodyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/table-with-footer-section-above-body.html (0 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/table-with-footer-section-above-body.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/table-with-footer-section-above-body.html        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div id=&quot;content&quot;&gt;
+&lt;table id=&quot;table1&quot; cellspacing=&quot;0&quot; role=&quot;grid&quot;&gt;
+    &lt;thead&gt;
+        &lt;tr role=&quot;row&quot;&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;th&gt;Office&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;th&gt;Start date&lt;/th&gt;&lt;th&gt;Salary&lt;/th&gt;&lt;/tr&gt;
+    &lt;/thead&gt;
+
+    &lt;tfoot&gt;
+        &lt;tr role=&quot;row&quot;&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;th&gt;Office&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;th&gt;Start date&lt;/th&gt;&lt;th&gt;Salary&lt;/th&gt;&lt;/tr&gt;
+    &lt;/tfoot&gt;
+
+    &lt;tbody&gt;
+        &lt;tr&gt;&lt;td&gt;a&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;td&gt;c&lt;/td&gt;&lt;td&gt;d&lt;/td&gt;&lt;/tr&gt;
+    &lt;/tbody&gt;
+&lt;/table&gt;
+
+&lt;table id=&quot;table2&quot; cellspacing=&quot;0&quot;&gt;
+    &lt;thead&gt;
+        &lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;th&gt;Office&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;th&gt;Start date&lt;/th&gt;&lt;th&gt;Salary&lt;/th&gt;&lt;/tr&gt;
+    &lt;/thead&gt;
+
+    &lt;tfoot&gt;
+        &lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Position&lt;/th&gt;&lt;th&gt;Office&lt;/th&gt;&lt;th&gt;Age&lt;/th&gt;&lt;th&gt;Start date&lt;/th&gt;&lt;th&gt;Salary&lt;/th&gt;&lt;/tr&gt;
+    &lt;/tfoot&gt;
+
+    &lt;tbody&gt;
+        &lt;tr&gt;&lt;td&gt;a&lt;/td&gt;&lt;td&gt;b&lt;/td&gt;&lt;td&gt;c&lt;/td&gt;&lt;td&gt;d&lt;/td&gt;&lt;/tr&gt;
+    &lt;/tbody&gt;
+&lt;/table&gt;
+
+&lt;/div&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    description(&quot;This tests that the row span information for the cells in the body is not offset by the footer section, even though the footer section is above the body in the DOM. This tests tables that have a role=grid and without.&quot;);
+
+    if (window.accessibilityController) {
+     
+        var table = accessibilityController.accessibleElementById(&quot;table1&quot;);
+        var testCell = table.cellForColumnAndRow(0, 1);
+        debug(&quot;Table1 cell content at {0, 1}: &quot; + testCell.childAtIndex(0).stringValue);
+        debug(&quot;Table1 cell range at {0, 1}: &quot; + testCell.rowIndexRange());
+
+        testCell = table.cellForColumnAndRow(0, 2);
+        debug(&quot;Table1 cell content at {0, 2}: &quot; + testCell.childAtIndex(0).stringValue);
+        debug(&quot;Table1 cell range at {0, 2}: &quot; + testCell.rowIndexRange());
+
+        table = accessibilityController.accessibleElementById(&quot;table2&quot;);
+        testCell = table.cellForColumnAndRow(0, 1);
+        debug(&quot;Table2 cell content at {0, 1}: &quot; + testCell.childAtIndex(0).stringValue);
+        debug(&quot;Table2 cell range at {0, 1}: &quot; + testCell.rowIndexRange());
+
+        testCell = table.cellForColumnAndRow(0, 2);
+        debug(&quot;Table2 cell content at {0, 2}: &quot; + testCell.childAtIndex(0).stringValue);
+        debug(&quot;Table2 cell range at {0, 2}: &quot; + testCell.rowIndexRange());
+
+        document.getElementById(&quot;content&quot;).style.visibility = &quot;hidden&quot;;
+    }
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/Source/WebCore/ChangeLog        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2014-04-29  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        AX: Row span info is wrong for table cells when a footer section is placed above a body section
+        https://bugs.webkit.org/show_bug.cgi?id=131832
+
+        Reviewed by Mario Sanchez Prada.
+
+        If a &lt;footer&gt; section is placed before the body, it renders AX row information and order incorrectly.
+        This also affects ARIA tables because they add their children by looking at renderer children, instead
+        interrogating the RenderTable directly.
+
+        Test: accessibility/table-with-footer-section-above-body.html
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addTableCellChild):
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::addChildren):
+        (WebCore::AccessibilityTable::addChildrenFromSection):
+        * accessibility/AccessibilityTable.h:
+        * accessibility/AccessibilityTableCell.cpp:
+        (WebCore::AccessibilityTableCell::rowIndexRange):
+        (WebCore::AccessibilityTableCell::columnIndexRange):
+
+2014-04-29  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
</ins><span class="cx">         AX: SpeechSynthesisUtterance cannot addEventListener
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=132321
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;AccessibilityTableHeaderContainer.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTableRow.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span><ins>+#include &quot;RenderTableSection.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -109,12 +110,29 @@
</span><span class="cx">     
</span><span class="cx">     AXObjectCache* axCache = m_renderer-&gt;document().axObjectCache();
</span><span class="cx">     
</span><del>-    // add only rows that are labeled as aria rows
</del><ins>+    // Add the children rows but be mindful in case there are footer sections in this table.
</ins><span class="cx">     HashSet&lt;AccessibilityObject*&gt; appendedRows;
</span><span class="cx">     unsigned columnCount = 0;
</span><del>-    for (RefPtr&lt;AccessibilityObject&gt; child = firstChild(); child; child = child-&gt;nextSibling())
-        addRowDescendant(child.get(), appendedRows, columnCount);
</del><ins>+    AccessibilityChildrenVector footerSections;
+    for (RefPtr&lt;AccessibilityObject&gt; child = firstChild(); child; child = child-&gt;nextSibling()) {
+        bool footerSection = false;
+        if (RenderObject* childRenderer = child-&gt;renderer()) {
+            if (childRenderer-&gt;isTableSection()) {
+                if (RenderTableSection* childSection = toRenderTableSection(childRenderer)) {
+                    if (childSection == childSection-&gt;table()-&gt;footer()) {
+                        footerSections.append(child);
+                        footerSection = true;
+                    }
+                }
+            }
+        }
+        if (!footerSection)
+            addRowDescendant(child.get(), appendedRows, columnCount);
+    }
</ins><span class="cx">     
</span><ins>+    for (const auto&amp; footerSection : footerSections)
+        addRowDescendant(footerSection.get(), appendedRows, columnCount);
+    
</ins><span class="cx">     // make the columns based on the number of columns in the first body
</span><span class="cx">     for (unsigned i = 0; i &lt; columnCount; ++i) {
</span><span class="cx">         AccessibilityTableColumn* column = toAccessibilityTableColumn(axCache-&gt;getOrCreate(ColumnRole));
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -360,50 +360,23 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     RenderTable* table = toRenderTable(m_renderer);
</span><del>-    AXObjectCache* axCache = m_renderer-&gt;document().axObjectCache();
-
</del><span class="cx">     // Go through all the available sections to pull out the rows and add them as children.
</span><span class="cx">     table-&gt;recalcSectionsIfNeeded();
</span><del>-    RenderTableSection* tableSection = table-&gt;topSection();
-    if (!tableSection)
-        return;
</del><span class="cx">     
</span><span class="cx">     unsigned maxColumnCount = 0;
</span><del>-    while (tableSection) {
-        
-        HashSet&lt;AccessibilityObject*&gt; appendedRows;
-        unsigned numRows = tableSection-&gt;numRows();
-        for (unsigned rowIndex = 0; rowIndex &lt; numRows; ++rowIndex) {
-            
-            RenderTableRow* renderRow = tableSection-&gt;rowRendererAt(rowIndex);
-            if (!renderRow)
-                continue;
-            
-            AccessibilityObject* rowObject = axCache-&gt;getOrCreate(renderRow);
-            if (!rowObject-&gt;isTableRow())
-                continue;
-            
-            AccessibilityTableRow* row = toAccessibilityTableRow(rowObject);
-            // We need to check every cell for a new row, because cell spans
-            // can cause us to miss rows if we just check the first column.
-            if (appendedRows.contains(row))
-                continue;
-            
-            row-&gt;setRowIndex(static_cast&lt;int&gt;(m_rows.size()));
-            m_rows.append(row);
-            if (!row-&gt;accessibilityIsIgnored())
-                m_children.append(row);
-#if PLATFORM(GTK) || PLATFORM(EFL)
-            else
-                m_children.appendVector(row-&gt;children());
-#endif
-            appendedRows.add(row);
-        }
</del><ins>+    RenderTableSection* footer = table-&gt;footer();
</ins><span class="cx">     
</span><del>-        maxColumnCount = std::max(tableSection-&gt;numColumns(), maxColumnCount);
-        tableSection = table-&gt;sectionBelow(tableSection, SkipEmptySections);
</del><ins>+    for (RenderTableSection* tableSection = table-&gt;topSection(); tableSection; tableSection = table-&gt;sectionBelow(tableSection, SkipEmptySections)) {
+        if (tableSection == footer)
+            continue;
+        addChildrenFromSection(tableSection, maxColumnCount);
</ins><span class="cx">     }
</span><span class="cx">     
</span><ins>+    // Process the footer last, in case it was ordered earlier in the DOM.
+    if (footer)
+        addChildrenFromSection(footer, maxColumnCount);
+    
+    AXObjectCache* axCache = m_renderer-&gt;document().axObjectCache();
</ins><span class="cx">     // make the columns based on the number of columns in the first body
</span><span class="cx">     unsigned length = maxColumnCount;
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="lines">@@ -419,7 +392,46 @@
</span><span class="cx">     if (headerContainerObject &amp;&amp; !headerContainerObject-&gt;accessibilityIsIgnored())
</span><span class="cx">         m_children.append(headerContainerObject);
</span><span class="cx"> }
</span><ins>+
+void AccessibilityTable::addChildrenFromSection(RenderTableSection* tableSection, unsigned&amp; maxColumnCount)
+{
+    ASSERT(tableSection);
+    if (!tableSection)
+        return;
</ins><span class="cx">     
</span><ins>+    AXObjectCache* axCache = m_renderer-&gt;document().axObjectCache();
+    HashSet&lt;AccessibilityObject*&gt; appendedRows;
+    unsigned numRows = tableSection-&gt;numRows();
+    for (unsigned rowIndex = 0; rowIndex &lt; numRows; ++rowIndex) {
+        
+        RenderTableRow* renderRow = tableSection-&gt;rowRendererAt(rowIndex);
+        if (!renderRow)
+            continue;
+        
+        AccessibilityObject* rowObject = axCache-&gt;getOrCreate(renderRow);
+        if (!rowObject-&gt;isTableRow())
+            continue;
+        
+        AccessibilityTableRow* row = toAccessibilityTableRow(rowObject);
+        // We need to check every cell for a new row, because cell spans
+        // can cause us to miss rows if we just check the first column.
+        if (appendedRows.contains(row))
+            continue;
+        
+        row-&gt;setRowIndex(static_cast&lt;int&gt;(m_rows.size()));
+        m_rows.append(row);
+        if (!row-&gt;accessibilityIsIgnored())
+            m_children.append(row);
+#if PLATFORM(GTK) || PLATFORM(EFL)
+        else
+            m_children.appendVector(row-&gt;children());
+#endif
+        appendedRows.add(row);
+    }
+    
+    maxColumnCount = std::max(tableSection-&gt;numColumns(), maxColumnCount);
+}
+    
</ins><span class="cx"> AccessibilityObject* AccessibilityTable::headerContainer()
</span><span class="cx"> {
</span><span class="cx">     if (m_headerContainer)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.h (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.h        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.h        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -98,6 +98,7 @@
</span><span class="cx"> private:
</span><span class="cx">     virtual void titleElementText(Vector&lt;AccessibilityText&gt;&amp;) const override;
</span><span class="cx">     HTMLTableElement* tableElement() const;
</span><ins>+    void addChildrenFromSection(RenderTableSection*, unsigned&amp; maxColumnCount);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> ACCESSIBILITY_OBJECT_TYPE_CASTS(AccessibilityTable, isTable())
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (167933 => 167934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-04-29 16:04:57 UTC (rev 167933)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-04-29 16:15:14 UTC (rev 167934)
</span><span class="lines">@@ -231,13 +231,15 @@
</span><span class="cx">     if (!table || !section)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderTableSection* tableSection = table-&gt;topSection();    
</del><ins>+    RenderTableSection* footerSection = table-&gt;footer();
</ins><span class="cx">     unsigned rowOffset = 0;
</span><del>-    while (tableSection) {
</del><ins>+    for (RenderTableSection* tableSection = table-&gt;topSection(); tableSection; tableSection = table-&gt;sectionBelow(tableSection, SkipEmptySections)) {
+        // Don't add row offsets for bottom sections that are placed in before the body section.
+        if (tableSection == footerSection)
+            continue;
</ins><span class="cx">         if (tableSection == section)
</span><span class="cx">             break;
</span><span class="cx">         rowOffset += tableSection-&gt;numRows();
</span><del>-        tableSection = table-&gt;sectionBelow(tableSection, SkipEmptySections);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     rowRange.first += rowOffset;
</span></span></pre>
</div>
</div>

</body>
</html>