AXIsolatedObject support for tables.
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Feb 2020 00:54:42 +0000 (00:54 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Feb 2020 00:54:42 +0000 (00:54 +0000)
commitdb5ebb8ba8c892c26685cd6261c37187ff71eff2
tree7025a0a3785d6d7651a3e6a119460ce2e2d4fda8
parent6786f3af452faed817b0c8f9ce93d4c97011caa7
AXIsolatedObject support for tables.
https://bugs.webkit.org/show_bug.cgi?id=208074

Reviewed by Chris Fleizach.

Covered by existing tests.

AccessibilityObjectWrapper code and some utility functions in
AccessibilityObject.cpp assume that AX objects can be downcast to a
specialized subclass like AccessibilityTable. That is not true for
AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
mode.

To solve this problem, this patch exposes the AccessibilityTable
interface as part of the AXCoreObject. Thus it eliminates the need to
downcast an AX object to an AccessibilityTable. It also implements the
AccessibilityTable interface in the AXIsolatedObject class. The same
approach will be used in subsequent patches for other specialized
interfaces used by client code.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGrid.h:
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::parentTable const):
(WebCore::AccessibilityARIAGridCell::rowIndexRange const):
(WebCore::AccessibilityARIAGridCell::columnIndexRange const):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::disclosedRows):
(WebCore::AccessibilityARIAGridRow::disclosedByRow const):
(WebCore::AccessibilityARIAGridRow::parentTable const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::shouldUseAccessibilityObjectInnerText):
* accessibility/AccessibilityObject.cpp:
(WebCore::appendChildrenToArray): Use AXCoreObject interface instead of downcasting.
(WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Use AXCoreObject interface instead of downcasting.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h: AXCoreObject now exposes the table interface.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::ariaSelectedRows):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::isExposable const):
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::headerContainer): Returns an AXCoreObject.

The following methods now return a vector of objects instead of taking
and out parameter. RVO guaranties that this does not cause extra copy.
(WebCore::AccessibilityTable::columns):
(WebCore::AccessibilityTable::rows):
(WebCore::AccessibilityTable::columnHeaders):
(WebCore::AccessibilityTable::rowHeaders):
(WebCore::AccessibilityTable::visibleRows):
(WebCore::AccessibilityTable::cells):

(WebCore::AccessibilityTable::tableLevel const):
(WebCore::AccessibilityTable::roleValue const):
(WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityTable::title const):
(WebCore::AccessibilityTable::isExposableThroughAccessibility const): Renamed to just isExposable.
* accessibility/AccessibilityTable.h:
(WebCore::AccessibilityTable::supportsSelectedRows): Deleted.
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable const):
(WebCore::AccessibilityTableCell::isTableCell const):
(WebCore::AccessibilityTableCell::columnHeaders):
(WebCore::AccessibilityTableCell::rowHeaders):
* accessibility/AccessibilityTableCell.h:
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
(WebCore::AccessibilityTableColumn::addChildren):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::addChildren):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::isTableRow const):
(WebCore::AccessibilityTableRow::parentTable const):
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(webkitAccessibleTableCellGetColumnHeaderCells):
(webkitAccessibleTableCellGetRowHeaderCells):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper tableParent]):
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::setObjectVectorProperty):
(WebCore::AXIsolatedObject::cellForColumnAndRow):
(WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
(WebCore::AXIsolatedObject::isAccessibilityTableInstance const):
(WebCore::AXIsolatedObject::isDataTable const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::objectsForIDs const):
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
In addition to replacing the downcast to AccessibilityTable, cleaned up
the unnecessary calls to self.axBackingObject. This used to be a macro,
but it is now a method that check for the execution thread and returns
the appropriate AX object.
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
Source/WebCore/accessibility/AccessibilityARIAGrid.h
Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp
Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/AccessibilityTable.h
Source/WebCore/accessibility/AccessibilityTableCell.cpp
Source/WebCore/accessibility/AccessibilityTableCell.h
Source/WebCore/accessibility/AccessibilityTableColumn.cpp
Source/WebCore/accessibility/AccessibilityTableHeaderContainer.cpp
Source/WebCore/accessibility/AccessibilityTableRow.cpp
Source/WebCore/accessibility/atk/WebKitAccessible.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm