<!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>[198819] 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/198819">198819</a></dd>
<dt>Author</dt> <dd>n_wang@apple.com</dd>
<dt>Date</dt> <dd>2016-03-29 19:02:47 -0700 (Tue, 29 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: VoiceOver not announcing the right header information for table on iOS
https://bugs.webkit.org/show_bug.cgi?id=155907

Reviewed by Chris Fleizach.

Source/WebCore:

Make sure we consider the case where header elements size does not equal to
row size.

Test: accessibility/ios-simulator/table-row-column-headers.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):

LayoutTests:

* accessibility/ios-simulator/table-row-column-headers-expected.txt: Added.
* accessibility/ios-simulator/table-row-column-headers.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="#trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm">trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilityiossimulatortablerowcolumnheadersexpectedtxt">trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityiossimulatortablerowcolumnheadershtml">trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198818 => 198819)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-30 01:31:33 UTC (rev 198818)
+++ trunk/LayoutTests/ChangeLog        2016-03-30 02:02:47 UTC (rev 198819)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-03-29  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: VoiceOver not announcing the right header information for table on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=155907
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/ios-simulator/table-row-column-headers-expected.txt: Added.
+        * accessibility/ios-simulator/table-row-column-headers.html: Added.
+
</ins><span class="cx"> 2016-03-29  Dana Burkart and Matthew Hanson  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: JS PrettyPrinting in do/while loops, &quot;while&quot; should be on the same line as &quot;}&quot; if there was a closing brace
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityiossimulatortablerowcolumnheadersexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers-expected.txt (0 => 198819)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers-expected.txt        2016-03-30 02:02:47 UTC (rev 198819)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+ColHeader1        ColHeader2
+Rowheader1        content1        content2        content3
+RowHeader2        content4        content5        content6
+content7        content8        content9
+This test makes sure that cells are getting the correct header elements.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Verifying &quot;content1&quot; with col header: &quot;ColHeader1&quot; row header: &quot;Rowheader1&quot;.
+PASS cell.headerElementAtIndex(0).description is colDescription
+PASS cell.headerElementAtIndex(1).description is rowDescription
+
+
+Verifying &quot;content2&quot; with col header: &quot;ColHeader2&quot; row header: &quot;Rowheader1&quot;.
+PASS cell.headerElementAtIndex(0).description is colDescription
+PASS cell.headerElementAtIndex(1).description is rowDescription
+
+
+Verifying &quot;content7&quot; with col header: &quot;ColHeader1&quot; row header: &quot;Rowheader2&quot;.
+PASS cell.headerElementAtIndex(0).description is colDescription
+PASS cell.headerElementAtIndex(1).description is rowDescription
+
+
+Verifying &quot;content9&quot; with col header: &quot;ColHeader2&quot; row header: &quot;Rowheader2&quot;.
+PASS cell.headerElementAtIndex(0).description is colDescription
+PASS cell.headerElementAtIndex(1).description is rowDescription
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityiossimulatortablerowcolumnheadershtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers.html (0 => 198819)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/table-row-column-headers.html        2016-03-30 02:02:47 UTC (rev 198819)
</span><span class="lines">@@ -0,0 +1,83 @@
</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;script&gt;
+var successfullyParsed = false;
+&lt;/script&gt;
+&lt;style&gt;
+table, th, td {
+    border: 1px solid black;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;table&gt;
+&lt;thead&gt;&lt;tr&gt;
+&lt;td&gt;&lt;/td&gt;
+&lt;th aria-label=&quot;ColHeader1&quot;&gt;ColHeader1&lt;/th&gt;
+&lt;th aria-label=&quot;ColHeader2&quot; colspan=&quot;2&quot;&gt;ColHeader2&lt;/th&gt;
+&lt;/tr&gt;&lt;/thead&gt;
+
+&lt;tbody&gt;
+&lt;tr&gt;
+&lt;th aria-label=&quot;Rowheader1&quot;&gt;Rowheader1&lt;/th&gt;
+&lt;td id=&quot;content1&quot;&gt;content1&lt;/td&gt;
+&lt;td id=&quot;content2&quot;&gt;content2&lt;/td&gt;
+&lt;td&gt;content3&lt;/td&gt;
+&lt;/tr&gt;
+&lt;tr&gt;
+&lt;th aria-label=&quot;Rowheader2&quot; rowspan=&quot;2&quot;&gt;RowHeader2&lt;/th&gt;
+&lt;td&gt;content4&lt;/td&gt;
+&lt;td&gt;content5&lt;/td&gt;
+&lt;td&gt;content6&lt;/td&gt;
+&lt;/tr&gt;
+&lt;tr&gt;
+&lt;td id=&quot;content7&quot;&gt;content7&lt;/td&gt;
+&lt;td&gt;content8&lt;/td&gt;
+&lt;td id=&quot;content9&quot;&gt;content9&lt;/td&gt;
+&lt;/tr&gt;
+&lt;/tbody&gt;
+&lt;/table&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 test makes sure that cells are getting the correct header elements.&quot;);
+    
+    if (window.accessibilityController) {
+        
+        var cell;
+        var colDescription, rowDescription;
+        var rowHeaderLabel1 = &quot;Rowheader1&quot;;
+        var rowHeaderLabel2 = &quot;Rowheader2&quot;;
+        var colHeaderLabel1 = &quot;ColHeader1&quot;;
+        var colHeaderLabel2 = &quot;ColHeader2&quot;;
+        
+        verifyCellAndHeaders(&quot;content1&quot;, colHeaderLabel1, rowHeaderLabel1);
+        verifyCellAndHeaders(&quot;content2&quot;, colHeaderLabel2, rowHeaderLabel1);
+        verifyCellAndHeaders(&quot;content7&quot;, colHeaderLabel1, rowHeaderLabel2);
+        verifyCellAndHeaders(&quot;content9&quot;, colHeaderLabel2, rowHeaderLabel2);
+    }
+    
+    function verifyCellAndHeaders(cellID, colHeader, rowHeader) {
+        cell = accessibilityController.accessibleElementById(cellID);
+        colDescription = &quot;AXLabel: &quot; + colHeader;
+        rowDescription = &quot;AXLabel: &quot; + rowHeader;
+        debug(&quot;Verifying \&quot;&quot; + cellID + &quot;\&quot; with col header: \&quot;&quot; + colHeader + &quot;\&quot; row header: \&quot;&quot; + rowHeader + &quot;\&quot;.&quot;);
+        shouldBe(&quot;cell.headerElementAtIndex(0).description&quot;, &quot;colDescription&quot;);
+        shouldBe(&quot;cell.headerElementAtIndex(1).description&quot;, &quot;rowDescription&quot;);
+        debug(&quot;\n&quot;);
+    }
+
+    successfullyParsed = true;
+&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 (198818 => 198819)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-30 01:31:33 UTC (rev 198818)
+++ trunk/Source/WebCore/ChangeLog        2016-03-30 02:02:47 UTC (rev 198819)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-29  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: VoiceOver not announcing the right header information for table on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=155907
+
+        Reviewed by Chris Fleizach.
+
+        Make sure we consider the case where header elements size does not equal to
+        row size.
+
+        Test: accessibility/ios-simulator/table-row-column-headers.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
+
</ins><span class="cx"> 2016-03-29  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r198782): CGImageSourceUpdateData() is called twice with the same data every time ImageSource::setData() is called
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (198818 => 198819)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2016-03-30 01:31:33 UTC (rev 198818)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2016-03-30 02:02:47 UTC (rev 198819)
</span><span class="lines">@@ -1057,13 +1057,20 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned rowRangeIndex = static_cast&lt;unsigned&gt;(rowRange.first);
</span><del>-    if (rowRangeIndex &lt; rowHeaders.size()) {
-        RefPtr&lt;AccessibilityObject&gt; rowHeader = rowHeaders[rowRange.first];
-        AccessibilityObjectWrapper* wrapper = rowHeader-&gt;wrapper();
-        if (wrapper)
-            [headers addObject:wrapper];
</del><ins>+    // We should consider the cases where the row number does NOT match the index in
+    // rowHeaders, the most common case is when row0/col0 does not have a header.
+    for (const auto&amp; rowHeader : rowHeaders) {
+        if (!is&lt;AccessibilityTableCell&gt;(*rowHeader))
+            break;
+        std::pair&lt;unsigned, unsigned&gt; rowHeaderRange;
+        downcast&lt;AccessibilityTableCell&gt;(*rowHeader).rowIndexRange(rowHeaderRange);
+        if (rowRangeIndex &gt;= rowHeaderRange.first &amp;&amp; rowRangeIndex &lt; rowHeaderRange.first + rowHeaderRange.second) {
+            if (AccessibilityObjectWrapper* wrapper = rowHeader-&gt;wrapper())
+                [headers addObject:wrapper];
+            break;
+        }
</ins><span class="cx">     }
</span><del>-        
</del><ins>+
</ins><span class="cx">     return headers;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>