<!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>[149858] 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/149858">149858</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2013-05-09 17:57:24 -0700 (Thu, 09 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: VoiceOver is no longer seeing items in poorly formed tables
https://bugs.webkit.org/show_bug.cgi?id=115837

Reviewed by Darin Adler.

Source/WebCore: 

In case the author didn't include the rows of a table as the 
direct children, a table needs to dive down its descendant chain
until the rows are found. 

I also took the opportunity to clean up a bit around what the different
meanings of table are in the accessibility classes.

Test: accessibility/poorly-formed-aria-table.html

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addRowDescendant):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable):
(WebCore):
* accessibility/AccessibilityARIAGridRow.h:
(AccessibilityARIAGridRow):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isTable):
* accessibility/AccessibilityTable.h:
(AccessibilityTable):
(WebCore::AccessibilityTable::isTable):
(WebCore::toAccessibilityTable):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::parentTable):

LayoutTests: 

* accessibility/poorly-formed-aria-table-expected.txt: Added.
* accessibility/poorly-formed-aria-table.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="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridh">trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowcpp">trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowh">trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableh">trunk/Source/WebCore/accessibility/AccessibilityTable.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp">trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitypoorlyformedariatableexpectedtxt">trunk/LayoutTests/accessibility/poorly-formed-aria-table-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitypoorlyformedariatablehtml">trunk/LayoutTests/accessibility/poorly-formed-aria-table.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/LayoutTests/ChangeLog        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2013-05-09  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: VoiceOver is no longer seeing items in poorly formed tables
+        https://bugs.webkit.org/show_bug.cgi?id=115837
+
+        Reviewed by Darin Adler.
+
+        * accessibility/poorly-formed-aria-table-expected.txt: Added.
+        * accessibility/poorly-formed-aria-table.html: Added.
+
</ins><span class="cx"> 2013-05-09  Zoltan Horvath  &lt;zoltan@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Qt] REGRESSION (r148975) shape-inside-percentage.html and shape-inside-overflow-fixed-dimensions.html are failing after r148975
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitypoorlyformedariatableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/poorly-formed-aria-table-expected.txt (0 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/poorly-formed-aria-table-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/poorly-formed-aria-table-expected.txt        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This tests that if an ARIA table does not report the rows as its direct children, the table will still correctly report the rows.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS grid.rowAtIndex(0).isEqual(row1) is true
+PASS grid.rowAtIndex(1).isEqual(row2) is true
+PASS grid.rowCount is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitypoorlyformedariatablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/poorly-formed-aria-table.html (0 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/poorly-formed-aria-table.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/poorly-formed-aria-table.html        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../fast/js/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+
+&lt;div id=&quot;content&quot;&gt;
+
+&lt;div role=&quot;grid&quot; id=&quot;grid&quot;&gt;
+  &lt;div role=&quot;application&quot;&gt;
+     &lt;div role=&quot;application&quot;&gt;
+         &lt;div role=&quot;row&quot; id=&quot;row1&quot;&gt;
+            &lt;div role=&quot;gridcell&quot;&gt;1&lt;/div&gt;
+         &lt;/div&gt;
+         &lt;div role=&quot;text&quot;&gt;a&lt;/div&gt;
+         &lt;div role=&quot;row&quot; id=&quot;row2&quot;&gt;
+            &lt;div role=&quot;gridcell&quot;&gt;1&lt;/div&gt;
+         &lt;/div&gt;
+     &lt;/div&gt;
+  &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;/div&gt;
+
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+description(&quot;This tests that if an ARIA table does not report the rows as its direct children, the table will still correctly report the rows.&quot;)
+
+if (window.testRunner &amp;&amp; window.accessibilityController) {

+    var grid = accessibilityController.accessibleElementById(&quot;grid&quot;);
+    var row1 = accessibilityController.accessibleElementById(&quot;row1&quot;);
+    var row2 = accessibilityController.accessibleElementById(&quot;row2&quot;);
+    

+    shouldBeTrue(&quot;grid.rowAtIndex(0).isEqual(row1)&quot;);
+    shouldBeTrue(&quot;grid.rowAtIndex(1).isEqual(row2)&quot;);
+    shouldBe(&quot;grid.rowCount&quot;, &quot;2&quot;);
+
+    document.getElementById(&quot;content&quot;).style.visibility = 'hidden';    
+}
+&lt;/script&gt;
+&lt;script src=&quot;../fast/js/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 (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/ChangeLog        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2013-05-09  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: VoiceOver is no longer seeing items in poorly formed tables
+        https://bugs.webkit.org/show_bug.cgi?id=115837
+
+        Reviewed by Darin Adler.
+
+        In case the author didn't include the rows of a table as the 
+        direct children, a table needs to dive down its descendant chain
+        until the rows are found. 
+
+        I also took the opportunity to clean up a bit around what the different
+        meanings of table are in the accessibility classes.
+
+        Test: accessibility/poorly-formed-aria-table.html
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addRowDescendant):
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityARIAGrid.h:
+        (AccessibilityARIAGrid):
+        * accessibility/AccessibilityARIAGridRow.cpp:
+        (WebCore::AccessibilityARIAGridRow::parentTable):
+        (WebCore):
+        * accessibility/AccessibilityARIAGridRow.h:
+        (AccessibilityARIAGridRow):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isTable):
+        * accessibility/AccessibilityTable.h:
+        (AccessibilityTable):
+        (WebCore::AccessibilityTable::isTable):
+        (WebCore::toAccessibilityTable):
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::parentTable):
+
</ins><span class="cx"> 2013-05-09  Yael Aharon  &lt;yael.aharon@intel.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: Disabled multiline select element now responds to (certain) clicks
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -81,7 +81,23 @@
</span><span class="cx">     appendedRows.add(row);
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+void AccessibilityARIAGrid::addRowDescendant(AccessibilityObject* rowChild, HashSet&lt;AccessibilityObject*&gt;&amp; appendedRows, unsigned&amp; columnCount)
+{
+    if (!rowChild)
+        return;
+
+    if (!rowChild-&gt;isTableRow()) {
+        // Although a &quot;grid&quot; should have rows as its direct descendants, if this is not a table row,
+        // dive deeper into the descendants to try to find a valid row.
+        AccessibilityChildrenVector children = rowChild-&gt;children();
+        size_t length = children.size();
+        for (size_t i = 0; i &lt; length; ++i)
+            addRowDescendant(children[i].get(), appendedRows, columnCount);
+    } else
+        addTableCellChild(rowChild, appendedRows, columnCount);
+}
+
</ins><span class="cx"> void AccessibilityARIAGrid::addChildren()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_haveChildren); 
</span><span class="lines">@@ -100,22 +116,8 @@
</span><span class="cx">     // add only rows that are labeled as aria rows
</span><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()) {
-
-        if (!addTableCellChild(child.get(), appendedRows, columnCount)) {
-            
-            // in case the render tree doesn't match the expected ARIA hierarchy, look at the children
-            if (!child-&gt;hasChildren())
-                child-&gt;addChildren();
-
-            // The children of this non-row will contain all non-ignored elements (recursing to find them). 
-            // This allows the table to dive arbitrarily deep to find the rows.
-            AccessibilityChildrenVector children = child-&gt;children();
-            size_t length = children.size();
-            for (size_t i = 0; i &lt; length; ++i)
-                addTableCellChild(children[i].get(), appendedRows, columnCount);
-        }
-    }
</del><ins>+    for (RefPtr&lt;AccessibilityObject&gt; child = firstChild(); child; child = child-&gt;nextSibling())
+        addRowDescendant(child.get(), appendedRows, columnCount);
</ins><span class="cx">     
</span><span class="cx">     // make the columns based on the number of columns in the first body
</span><span class="cx">     for (unsigned i = 0; i &lt; columnCount; ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">     virtual bool isMultiSelectable() const { return true; }
</span><span class="cx">     virtual bool isTableExposableThroughAccessibility() const { return true; }
</span><span class="cx">     
</span><ins>+    void addRowDescendant(AccessibilityObject*, HashSet&lt;AccessibilityObject*&gt;&amp; appendedRows, unsigned&amp; columnCount);
</ins><span class="cx">     bool addTableCellChild(AccessibilityObject*, HashSet&lt;AccessibilityObject*&gt;&amp; appendedRows, unsigned&amp; columnCount);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -116,6 +116,19 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+AccessibilityObject* AccessibilityARIAGridRow::parentTable() const
+{
+    // The parent table might not be the direct ancestor of the row unfortunately. ARIA states that role=&quot;grid&quot; should
+    // only have &quot;row&quot; elements, but if not, we still should handle it gracefully by finding the right table.
+    for (AccessibilityObject* parent = parentObject(); parent; parent = parent-&gt;parentObject()) {
+        // The parent table for an ARIA grid row should be an ARIA table.
+        if (parent-&gt;isTable() &amp;&amp; parent-&gt;isAccessibilityTable() &amp;&amp; toAccessibilityTable(parent)-&gt;isAriaTable())
+            return parent;
+    }
+    
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityObject* AccessibilityARIAGridRow::headerObject()
</span><span class="cx"> {
</span><span class="cx">     AccessibilityChildrenVector rowChildren = children();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityARIAGridRowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.h        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isARIATreeGridRow() const;
</span><ins>+    virtual AccessibilityObject* parentTable() const;
</ins><span class="cx"> }; 
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -413,6 +413,7 @@
</span><span class="cx">     virtual bool isInputSlider() const { return false; }
</span><span class="cx">     virtual bool isControl() const { return false; }
</span><span class="cx">     virtual bool isList() const { return false; }
</span><ins>+    virtual bool isTable() const { return false; }
</ins><span class="cx">     virtual bool isAccessibilityTable() const { return false; }
</span><span class="cx">     virtual bool isDataTable() const { return false; }
</span><span class="cx">     virtual bool isTableRow() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -510,7 +510,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     // Widgets are the replaced elements that we represent to AX as attachments
</span><span class="cx">     bool isWidget = renderer-&gt;isWidget();
</span><del>-    ASSERT(!isWidget || (renderer-&gt;isReplaced() &amp;&amp; !isImage()));
</del><ins>+
</ins><span class="cx">     return isWidget &amp;&amp; ariaRoleAttribute() == UnknownRole;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.h (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTable.h        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.h        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -47,9 +47,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void init();
</span><span class="cx"> 
</span><del>-    virtual bool isAccessibilityTable() const;
-    virtual bool isDataTable() const;
-
</del><span class="cx">     virtual AccessibilityRole roleValue() const;
</span><span class="cx">     virtual bool isAriaTable() const { return false; }
</span><span class="cx">     
</span><span class="lines">@@ -84,13 +81,22 @@
</span><span class="cx">     bool m_isAccessibilityTable;
</span><span class="cx"> 
</span><span class="cx">     bool hasARIARole() const;
</span><ins>+
+    // isTable is whether it's an AccessibilityTable object.
+    virtual bool isTable() const OVERRIDE { return true; }
+    // isAccessibilityTable is whether it is exposed as an AccessibilityTable to the platform.
+    virtual bool isAccessibilityTable() const OVERRIDE;
+    // isDataTable is whether it is exposed as an AccessibilityTable because the heuristic
+    // think this &quot;looks&quot; like a data-based table (instead of a table used for layout).
+    virtual bool isDataTable() const OVERRIDE;
+
</ins><span class="cx">     virtual bool isTableExposableThroughAccessibility() const;
</span><del>-    virtual bool computeAccessibilityIsIgnored() const;
</del><ins>+    virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> inline AccessibilityTable* toAccessibilityTable(AccessibilityObject* object)
</span><span class="cx"> {
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(!object || object-&gt;isAccessibilityTable());
</del><ins>+    ASSERT_WITH_SECURITY_IMPLICATION(!object || object-&gt;isTable());
</ins><span class="cx">     return static_cast&lt;AccessibilityTable*&gt;(object);
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableRowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp (149857 => 149858)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp        2013-05-10 00:12:25 UTC (rev 149857)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableRow.cpp        2013-05-10 00:57:24 UTC (rev 149858)
</span><span class="lines">@@ -102,11 +102,16 @@
</span><span class="cx">     
</span><span class="cx"> AccessibilityObject* AccessibilityTableRow::parentTable() const
</span><span class="cx"> {
</span><del>-    AccessibilityObject* parent = parentObjectUnignored();
-    if (!parent || !parent-&gt;isAccessibilityTable())
-        return 0;
</del><ins>+    // The parent table might not be the direct ancestor of the row unfortunately. ARIA states that role=&quot;grid&quot; should
+    // only have &quot;row&quot; elements, but if not, we still should handle it gracefully by finding the right table.
+    for (AccessibilityObject* parent = parentObject(); parent; parent = parent-&gt;parentObject()) {
+        // If this is a table object, but not an accessibility table, we should stop because we don't want to
+        // choose another ancestor table as this row's table.
+        if (parent-&gt;isTable())
+            return parent-&gt;isAccessibilityTable() ? parent : 0;
+    }
</ins><span class="cx">     
</span><del>-    return parent;
</del><ins>+    return 0;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> AccessibilityObject* AccessibilityTableRow::headerObject()
</span></span></pre>
</div>
</div>

</body>
</html>