AX: [ATK] Implement missing AtkRelation types
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jun 2017 12:42:04 +0000 (12:42 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jun 2017 12:42:04 +0000 (12:42 +0000)
commit4bd618b3392342176624cfa8bd460b45f17b77af
tree05b9c78bd9221be801eae0c50ed4ae0df6638af3
parent36949cd820aa9ad498a8be0f0804c5e009295b6e
AX: [ATK] Implement missing AtkRelation types
https://bugs.webkit.org/show_bug.cgi?id=155494

Reviewed by Darin Adler.

Source/WebCore:

Add methods for getting the element(s) which reference a particular element via an
ARIA attribute. Then use those methods to identify and expose the expected reverse/
reciprocal AtkRelationType and targets. Also add ATK support for aria-owns.

Use SpaceSplitString in AccessibilityObject::elementsFromAttribute() so that unexpected
whitespace characters in an attribute's list of ids does not prevent the desired element
from being found.

Lastly, change the return type of AccessibilityObject::identifierAttribute() from a String
to a const AtomicString& for better efficiency.

Tests: accessibility/aria-owns.html
       accessibility/gtk/relation-types.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::identifierAttribute):
(WebCore::AccessibilityObject::elementsFromAttribute):
(WebCore::AccessibilityObject::ariaElementsReferencedByAttribute):
(WebCore::AccessibilityObject::ariaControlsReferencingElements):
(WebCore::AccessibilityObject::ariaDescribedByReferencingElements):
(WebCore::AccessibilityObject::ariaFlowToReferencingElements):
(WebCore::AccessibilityObject::ariaLabelledByReferencingElements):
(WebCore::AccessibilityObject::ariaOwnsReferencingElements):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):

Tools:

Add additional methods to test ARIA properties which are exposed via
AtkRelation. Implement ATK support for ariaOwnsElementAtIndex().

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(WTR::AccessibilityUIElement::ariaLabelledByElementAtIndex):
(WTR::AccessibilityUIElement::ariaDescribedByElementAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaControlsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaLabelledByReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaControlsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaLabelledByElementAtIndex):
(WTR::AccessibilityUIElement::ariaLabelledByReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaDescribedByElementAtIndex):
(WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex):

LayoutTests:

* accessibility/aria-owns-expected.txt: Renamed from LayoutTests/accessibility/mac/aria-owns-expected.txt.
* accessibility/aria-owns.html: Renamed from LayoutTests/accessibility/mac/aria-owns.html.
* accessibility/gtk/relation-types-expected.txt: Added.
* accessibility/gtk/relation-types.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-owns-expected.txt [moved from LayoutTests/accessibility/mac/aria-owns-expected.txt with 100% similarity]
LayoutTests/accessibility/aria-owns.html [moved from LayoutTests/accessibility/mac/aria-owns.html with 90% similarity]
LayoutTests/accessibility/gtk/relation-types-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/gtk/relation-types.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp