Title: [188791] branches/safari-601.1-branch

Diff

Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (188790 => 188791)


--- branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-21 22:42:29 UTC (rev 188790)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-21 22:42:35 UTC (rev 188791)
@@ -1,3 +1,24 @@
+2015-08-21  Matthew Hanson  <[email protected]>
+
+        Merge r188769. rdar://problem/22354983
+
+    2015-08-21  Doug Russell  <[email protected]>
+
+            AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow
+            https://bugs.webkit.org/show_bug.cgi?id=148293
+
+            Reviewed by Chris Fleizach.
+
+            When RenderTableRows are anonymous, they may not be added to the accessible data
+            table's internal row list. However, when calculating the row range for a cell,
+            we were still accounting for those anonymous sections.
+            Change how the row range is calculated to directly ask the accessible parent row
+            for its index. This will ensure it’s more inline with what’s being represented to
+            the accessibility API.
+
+            * accessibility/aria-table-content-expected.txt: Added.
+            * accessibility/aria-table-content.html: Added.
+
 2015-08-15  Alexey Proskuryakov  <[email protected]>
 
         Test result gardening. Removed obsolete expectations.

Added: branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content-expected.txt (0 => 188791)


--- branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content-expected.txt	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content-expected.txt	2015-08-21 22:42:35 UTC (rev 188791)
@@ -0,0 +1,16 @@
+Header
+Item 1
+
+This tests that in an aria table with CSS that makes a row anonymous, the cells can be accessed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS cell00.role is 'AXRole: AXCell'
+PASS cell01.role is 'AXRole: AXCell'
+PASS cell00.isEqual(table.rowAtIndex(0).childAtIndex(0)) is true
+PASS cell01.isEqual(table.rowAtIndex(1).childAtIndex(0)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content.html (0 => 188791)


--- branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/accessibility/aria-table-content.html	2015-08-21 22:42:35 UTC (rev 188791)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<style type="text/css">
+  div.foo table:not(.no-header):before{content:'';}
+</style>
+<title>Table Anonymous Row</title>
+</head>
+<body>
+<div class="foo" role="grid" id="table">
+  <table>
+	<thead> <tr> <th>Header</th> </tr> </thead>
+	<tbody> <tr> <td> <p>Item 1</p> </td> </tr> </tbody>
+  </table>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("This tests that in an aria table with CSS that makes a row anonymous, the cells can be accessed.");
+
+if (window.accessibilityController) {
+    var table = accessibilityController.accessibleElementById("table");
+    var cell00 = table.cellForColumnAndRow(0,0);
+    shouldBe("cell00.role", "'AXRole: AXCell'");
+    var cell01 = table.cellForColumnAndRow(0,1);
+    shouldBe("cell01.role", "'AXRole: AXCell'");
+    shouldBeTrue("cell00.isEqual(table.rowAtIndex(0).childAtIndex(0))");
+    shouldBeTrue("cell01.isEqual(table.rowAtIndex(1).childAtIndex(0))");
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (188790 => 188791)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-21 22:42:29 UTC (rev 188790)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-21 22:42:35 UTC (rev 188791)
@@ -1,5 +1,30 @@
 2015-08-21  Matthew Hanson  <[email protected]>
 
+        Merge r188769. rdar://problem/22354983
+
+    2015-08-21  Doug Russell  <[email protected]>
+
+            AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow
+            https://bugs.webkit.org/show_bug.cgi?id=148293
+
+            Reviewed by Chris Fleizach.
+
+            When RenderTableRows are anonymous, they may not be added to the accessible data
+            table's internal row list. However, when calculating the row range for a cell,
+            we were still accounting for those anonymous sections.
+            Change how the row range is calculated to directly ask the accessible parent row
+            for its index. This will ensure it’s more inline with what’s being represented to
+            the accessibility API.
+
+            Test: accessibility/aria-table-content.html
+
+            * accessibility/AccessibilityTableCell.cpp:
+            (WebCore::AccessibilityTableCell::parentRow):
+            (WebCore::AccessibilityTableCell::rowIndexRange):
+            * accessibility/AccessibilityTableCell.h:
+
+2015-08-21  Matthew Hanson  <[email protected]>
+
         Merge r188765. rdar://problem/22356782
 
     2015-08-21  Beth Dakin  <[email protected]>

Modified: branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.cpp (188790 => 188791)


--- branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.cpp	2015-08-21 22:42:29 UTC (rev 188790)
+++ branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.cpp	2015-08-21 22:42:35 UTC (rev 188791)
@@ -302,41 +302,25 @@
             headers.append(tableCell);
     }
 }
-    
+
+AccessibilityTableRow* AccessibilityTableCell::parentRow() const
+{
+    AccessibilityObject* parent = parentObjectUnignored();
+    if (!is<AccessibilityTableRow>(*parent))
+        return nullptr;
+    return downcast<AccessibilityTableRow>(parent);
+}
+
 void AccessibilityTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) const
 {
     if (!is<RenderTableCell>(m_renderer))
         return;
     
     RenderTableCell& renderCell = downcast<RenderTableCell>(*m_renderer);
-    rowRange.first = renderCell.rowIndex();
     rowRange.second = renderCell.rowSpan();
     
-    // since our table might have multiple sections, we have to offset our row appropriately
-    RenderTableSection* section = renderCell.section();
-    RenderTable* table = renderCell.table();
-    if (!table || !section)
-        return;
-
-    RenderTableSection* footerSection = table->footer();
-    unsigned rowOffset = 0;
-    for (RenderTableSection* tableSection = table->topSection(); tableSection; tableSection = table->sectionBelow(tableSection, SkipEmptySections)) {
-        // Don't add row offsets for bottom sections that are placed in before the body section.
-        if (tableSection == footerSection)
-            continue;
-        if (tableSection == section) {
-            // If the table section is anonymous, we should to use the parent row's API to get the rowIndex
-            if (tableSection->isAnonymous()) {
-                AccessibilityObject* parent = parentObjectUnignored();
-                if (is<AccessibilityTableRow>(*parent))
-                    rowOffset = downcast<AccessibilityTableRow>(*parent).rowIndex();
-            }
-            break;
-        }
-        rowOffset += tableSection->numRows();
-    }
-
-    rowRange.first += rowOffset;
+    if (AccessibilityTableRow* parentRow = this->parentRow())
+        rowRange.first = parentRow->rowIndex();
 }
     
 void AccessibilityTableCell::columnIndexRange(std::pair<unsigned, unsigned>& columnRange) const

Modified: branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.h (188790 => 188791)


--- branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.h	2015-08-21 22:42:29 UTC (rev 188790)
+++ branches/safari-601.1-branch/Source/WebCore/accessibility/AccessibilityTableCell.h	2015-08-21 22:42:35 UTC (rev 188791)
@@ -34,7 +34,8 @@
 namespace WebCore {
     
 class AccessibilityTable;
-    
+class AccessibilityTableRow;
+
 class AccessibilityTableCell : public AccessibilityRenderObject {
 public:
     static Ref<AccessibilityTableCell> create(RenderObject*);
@@ -56,6 +57,7 @@
 protected:
     explicit AccessibilityTableCell(RenderObject*);
 
+    AccessibilityTableRow* parentRow() const;
     virtual AccessibilityTable* parentTable() const;
     virtual AccessibilityRole determineAccessibilityRole() override final;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to