AX: CSS table display styles can cause malformed, inaccessible AXTables to be exposed...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Aug 2015 01:53:10 +0000 (01:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Aug 2015 01:53:10 +0000 (01:53 +0000)
commit3edf2e3f82d1e49282bc889600036786d52395cd
tree07d13c19335b553e7072ac1dc0fd758b0b61b833
parentd0db87b1df2bb21df594b48ca5e21cf769075d45
AX: CSS table display styles can cause malformed, inaccessible AXTables to be exposed to the AX tree
https://bugs.webkit.org/show_bug.cgi?id=136415
<rdar://problem/22026625>

Patch by Nan Wang <n_wang@apple.com> on 2015-08-09
Reviewed by Chris Fleizach.

Source/WebCore:

Applying CSS display styles to tables can end up inserting anonymous RenderTableRows, which is not handled well by the
accessibility code, which treats these as the actual rows. We can address this by diving deeper into anonymous nodes
and finding the real rows and cells we want. In addition, another thing also causing malformed tables is that "grid"
roles are being exposed as AXGrid instead of AXTable.

Test: accessibility/mac/malformed-table.html

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addRowDescendant):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::addTableCellChild):
(WebCore::AccessibilityTable::addChildrenFromSection):
* accessibility/AccessibilityTable.h:
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable):
(WebCore::AccessibilityTableCell::rowIndexRange):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::parentTable):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):

LayoutTests:

* accessibility/aria-table-with-presentational-elements-expected.txt:
* accessibility/aria-table-with-presentational-elements.html:
* accessibility/mac/malformed-table-expected.txt: Added.
* accessibility/mac/malformed-table.html: Added.
* platform/mac-mavericks/accessibility/roles-exposed-expected.txt:
* platform/mac/accessibility/aria-table-hierarchy-expected.txt:
* platform/mac/accessibility/aria-tables-expected.txt:
* platform/mac/accessibility/roles-exposed-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-table-with-presentational-elements-expected.txt
LayoutTests/accessibility/aria-table-with-presentational-elements.html
LayoutTests/accessibility/mac/malformed-table-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/malformed-table.html [new file with mode: 0644]
LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/accessibility/aria-table-hierarchy-expected.txt
LayoutTests/platform/mac/accessibility/aria-tables-expected.txt
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/AccessibilityTable.h
Source/WebCore/accessibility/AccessibilityTableCell.cpp
Source/WebCore/accessibility/AccessibilityTableRow.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm