[ATK] Implement support for new ARIA 1.1 values of aria-haspopup
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 19:30:08 +0000 (19:30 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Apr 2017 19:30:08 +0000 (19:30 +0000)
commit906499e1dc7240db8e16600a05673a054faece26
tree12ccaf3c0aa4e84e53cfbde6f9514b1b09f1ef2d
parentccadf007d8aba826a8482ada46e464d1a5372a80
[ATK] Implement support for new ARIA 1.1 values of aria-haspopup
https://bugs.webkit.org/show_bug.cgi?id=171164

Reviewed by Chris Fleizach.

Source/WebCore:

In ARIA 1.1, aria-haspopup's value type changed from true/false to a token.
Values: true, false (default, unless it's a combobox), dialog, grid, listbox
(default for combobox), menu, and tree. Any value of aria-haspopup that is
not included in the list of allowed values, including an empty string, must
be treated as if the value false had been provided.

Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit
values, and give platform assistive technologies a means to access that value.

If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP
in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop"
AtkObject attribute.

Test: accessibility/gtk/aria-haspopup.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::ariaPopupValue):
(WebCore::AccessibilityObject::supportsARIAHasPopup):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::ariaHasPopup):
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):

Tools:

hasPopup() should return whether or not ATK_STATE_HAS_POPUP is in the
AtkStateSet; not what is found in the AtkObject's attributes.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::hasPopup):

LayoutTests:

In addition to the new test, update xml-roles-exposed.html's expectations
because the implicit value of aria-haspopup for the combobox role is now
listbox, and that value should be exposed via an AtkObject attribute.

* accessibility/gtk/aria-haspopup-expected.txt: Added.
* accessibility/gtk/aria-haspopup.html: Added.
* accessibility/gtk/xml-roles-exposed-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/aria-haspopup-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/gtk/aria-haspopup.html [new file with mode: 0644]
LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp