AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
https://bugs.webkit.org/show_bug.cgi?id=177763
Reviewed by Chris Fleizach.
Source/WebCore:
Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
AtkObject attributes.
Test: accessibility/gtk/aria-drag-and-drop.html
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
Tools:
Implement ariaIsGrabbed() and ariaDropEffects() for ATK.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaIsGrabbed const):
(WTR::AccessibilityUIElement::ariaDropEffects const):
LayoutTests:
* accessibility/gtk/aria-drag-and-drop-expected.txt: Added.
* accessibility/gtk/aria-drag-and-drop.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@222787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index f604482..abb0242 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -575,6 +575,16 @@
attributeSet = addToAtkAttributeSet(attributeSet, "atomic", "true");
}
+ // The Core AAM states the author-provided value should be exposed as-is.
+ String dropEffect = coreObject->getAttribute(HTMLNames::aria_dropeffectAttr);
+ if (!dropEffect.isEmpty())
+ attributeSet = addToAtkAttributeSet(attributeSet, "dropeffect", dropEffect.utf8().data());
+
+ if (coreObject->isARIAGrabbed())
+ attributeSet = addToAtkAttributeSet(attributeSet, "grabbed", "true");
+ else if (coreObject->supportsARIADragging())
+ attributeSet = addToAtkAttributeSet(attributeSet, "grabbed", "false");
+
return attributeSet;
}