Enhance support of aria-haspopup per ARIA 1.1 specification.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jul 2019 20:24:24 +0000 (20:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jul 2019 20:24:24 +0000 (20:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199216
<rdar://problem/46221342>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-07-02
Reviewed by Chris Fleizach.

Source/WebCore:

Test button-with-aria-haspopup-role.html was expanded to cover testing
of new functionality.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue.
(WebCore::AccessibilityObject::hasPopupValue const): Deleted.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPopup const): method rename.
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes): method rename.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(getPopupValueCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::popupValue const):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::popupValue const):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::popupValue const):

LayoutTests:

* accessibility/button-with-aria-haspopup-role-expected.txt:
* accessibility/button-with-aria-haspopup-role.html:
* accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt:
* accessibility/ios-simulator/button-with-aria-haspopup-role.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/button-with-aria-haspopup-role-expected.txt
LayoutTests/accessibility/button-with-aria-haspopup-role.html
LayoutTests/accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt
LayoutTests/accessibility/ios-simulator/button-with-aria-haspopup-role.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/atk/WebKitAccessible.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp

index 546e72e..1b13039 100644 (file)
@@ -1,3 +1,16 @@
+2019-07-02  Andres Gonzalez  <andresg_22@apple.com>
+
+        Enhance support of aria-haspopup per ARIA 1.1 specification.
+        https://bugs.webkit.org/show_bug.cgi?id=199216
+        <rdar://problem/46221342>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/button-with-aria-haspopup-role-expected.txt:
+        * accessibility/button-with-aria-haspopup-role.html:
+        * accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt:
+        * accessibility/ios-simulator/button-with-aria-haspopup-role.html:
+
 2019-07-02  Saam Barati  <sbarati@apple.com>
 
         [WHLSL] Import bitwise bool tests
index 8b91b02..ee799f2 100644 (file)
@@ -3,16 +3,26 @@ This tests the platform role exposed for buttons with aria-haspopup
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-test1 AXRole: AXButton for aria-haspopup=(null)
-test2 AXRole: AXPopUpButton for aria-haspopup='true'
-test3 AXRole: AXButton for aria-haspopup='false'
-test4 AXRole: AXPopUpButton for aria-haspopup='dialog'
-test5 AXRole: AXPopUpButton for aria-haspopup='grid'
-test6 AXRole: AXPopUpButton for aria-haspopup='listbox'
-test7 AXRole: AXPopUpButton for aria-haspopup='menu'
-test8 AXRole: AXPopUpButton for aria-haspopup='tree'
-test9 AXRole: AXButton for aria-haspopup='foo'
-test10 AXRole: AXButton for aria-haspopup=''
+test1 AXRole: AXButton for aria-haspopup = (null)
+AX popupValue = 'false'
+test2 AXRole: AXPopUpButton for aria-haspopup = 'true'
+AX popupValue = 'menu'
+test3 AXRole: AXButton for aria-haspopup = 'false'
+AX popupValue = 'false'
+test4 AXRole: AXPopUpButton for aria-haspopup = 'dialog'
+AX popupValue = 'dialog'
+test5 AXRole: AXPopUpButton for aria-haspopup = 'grid'
+AX popupValue = 'grid'
+test6 AXRole: AXPopUpButton for aria-haspopup = 'listbox'
+AX popupValue = 'listbox'
+test7 AXRole: AXPopUpButton for aria-haspopup = 'menu'
+AX popupValue = 'menu'
+test8 AXRole: AXPopUpButton for aria-haspopup = 'tree'
+AX popupValue = 'tree'
+test9 AXRole: AXButton for aria-haspopup = 'foo'
+AX popupValue = 'false'
+test10 AXRole: AXButton for aria-haspopup = ''
+AX popupValue = 'false'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 06ff97e..abd8a02 100644 (file)
     description("This tests the platform role exposed for buttons with aria-haspopup");
     if (window.accessibilityController) {
         for (var i = 1; i <= 10; i++) {
-           var element = document.getElementById("test" + i)
+            var element = document.getElementById("test" + i)
             var popup = element.hasAttribute("aria-haspopup") ? "'" + element.getAttribute("aria-haspopup") + "'" : "(null)";
             var axElement = accessibilityController.accessibleElementById("test" + i);
-            debug("test" + i + " " + axElement.role + " for aria-haspopup=" + popup)
+            debug("test" + i + " " + axElement.role + " for aria-haspopup = " + popup)
+            // Check that accessibilityHasPopupValue returns the right value in each case.
+            debug("AX popupValue = " + "'" + axElement.popupValue + "'");
         }
 
         document.getElementById("content").style.visibility = "hidden";
index 409c859..4cc667b 100644 (file)
@@ -4,15 +4,25 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS element.hasAttribute('aria-haspopup') is true
+AX popupValue = 'menu'
 test1 has trait haspopup = true with aria-haspopup attribute = dialog
+AX popupValue = 'dialog'
 test2 has trait haspopup = true with aria-haspopup attribute = grid
+AX popupValue = 'grid'
 test3 has trait haspopup = true with aria-haspopup attribute = listbox
+AX popupValue = 'listbox'
 test4 has trait haspopup = true with aria-haspopup attribute = menu
+AX popupValue = 'menu'
 test5 has trait haspopup = true with aria-haspopup attribute = tree
+AX popupValue = 'tree'
 test6 has trait haspopup = false with aria-haspopup attribute = null
+AX popupValue = 'false'
 test7 has trait haspopup = false with aria-haspopup attribute = false
+AX popupValue = 'false'
 test8 has trait haspopup = false with aria-haspopup attribute = foo
+AX popupValue = 'false'
 test9 has trait haspopup = false with aria-haspopup attribute = 
+AX popupValue = 'false'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 3da94b3..82f1bd4 100644 (file)
 <script>
     description("This tests the platform attributes exposed for buttons with aria-haspopup");
     if (window.accessibilityController) {
-        // Get the document and accessibility elements for test0 to be used as reference.
+        // Get the document and accessibility elements for test0 to be used as reference to check traits against.
         var element = document.getElementById("test0");
         shouldBe("element.hasAttribute('aria-haspopup')", "true");
         var axElement = accessibilityController.accessibleElementById("test0");
         var haspopupTraits = axElement.traits;
+        // Check that accessibilityHasPopupValue returns the right value in each case.
+        debug("AX popupValue = " + "'" + axElement.popupValue + "'");
 
         for (var i = 1; i <= 9; i++) {
             var element = document.getElementById("test" + i);
@@ -33,6 +35,8 @@
             var axElement = accessibilityController.accessibleElementById("test" + i);
             var sameTraits = axElement.traits == haspopupTraits;
             debug("test" + i + " has trait haspopup = " + sameTraits + " with aria-haspopup attribute = " + popup);
+            // Check that accessibilityHasPopupValue returns the right value in each case.
+            debug("AX popupValue = " + "'" + axElement.popupValue + "'");
         }
 
         document.getElementById("content").style.visibility = "hidden";
index 273ef0f..0c9c2c0 100644 (file)
@@ -1,3 +1,27 @@
+2019-07-02  Andres Gonzalez  <andresg_22@apple.com>
+
+        Enhance support of aria-haspopup per ARIA 1.1 specification.
+        https://bugs.webkit.org/show_bug.cgi?id=199216
+        <rdar://problem/46221342>
+
+        Reviewed by Chris Fleizach.
+
+        Test button-with-aria-haspopup-role.html was expanded to cover testing
+        of new functionality.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue.
+        (WebCore::AccessibilityObject::hasPopupValue const): Deleted.
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::hasPopup const): method rename.
+        * accessibility/atk/WebKitAccessible.cpp:
+        (webkitAccessibleGetAttributes): method rename.
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityPopupValue]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
 2019-07-02  Saam Barati  <sbarati@apple.com>
 
         [WHLSL] Import bitwise bool tests
index 0b33d28..bbea694 100644 (file)
@@ -2758,20 +2758,26 @@ bool AccessibilityObject::supportsHasPopup() const
     return hasAttribute(aria_haspopupAttr) || isComboBox();
 }
 
-String AccessibilityObject::hasPopupValue() const
-{
-    const AtomString& hasPopup = getAttribute(aria_haspopupAttr);
-    if (equalLettersIgnoringASCIICase(hasPopup, "true")
-        || equalLettersIgnoringASCIICase(hasPopup, "dialog")
-        || equalLettersIgnoringASCIICase(hasPopup, "grid")
-        || equalLettersIgnoringASCIICase(hasPopup, "listbox")
-        || equalLettersIgnoringASCIICase(hasPopup, "menu")
-        || equalLettersIgnoringASCIICase(hasPopup, "tree"))
+String AccessibilityObject::popupValue() const
+{
+    static const NeverDestroyed<HashSet<String>> allowedPopupValues(std::initializer_list<String> {
+        "menu", "listbox", "tree", "grid", "dialog"
+    });
+
+    auto hasPopup = getAttribute(aria_haspopupAttr).convertToASCIILowercase();
+    if (hasPopup.isNull() || hasPopup.isEmpty()) {
+        // In ARIA 1.1, the implicit value for combobox became "listbox."
+        if (isComboBox())
+            return "listbox";
+        return "false";
+    }
+
+    if (allowedPopupValues->contains(hasPopup))
         return hasPopup;
 
-    // In ARIA 1.1, the implicit value for combobox became "listbox."
-    if (isComboBox() && hasPopup.isEmpty())
-        return "listbox";
+    // aria-haspopup specification states that true must be treated as menu.
+    if (hasPopup == "true")
+        return "menu";
 
     // The spec states that "User agents must treat any value of aria-haspopup that is not
     // included in the list of allowed values, including an empty string, as if the value
index b59b7d5..7b763c7 100644 (file)
@@ -552,7 +552,7 @@ public:
     void ariaOwnsReferencingElements(AccessibilityChildrenVector&) const;
 
     virtual bool hasPopup() const { return false; }
-    String hasPopupValue() const;
+    String popupValue() const;
     bool supportsHasPopup() const;
     bool pressedIsPresent() const;
     bool ariaIsMultiline() const;
index 85f6e2f..05af025 100644 (file)
@@ -1034,8 +1034,8 @@ bool AccessibilityRenderObject::hasPopup() const
 {
     // Return true if this has the aria-haspopup attribute, or if it has an ancestor of type link with the aria-haspopup attribute.
     return AccessibilityObject::matchedParent(*this, true, [this] (const AccessibilityObject& object) {
-        return (this == &object) ? !equalLettersIgnoringASCIICase(object.hasPopupValue(), "false")
-            : object.isLink() && !equalLettersIgnoringASCIICase(object.hasPopupValue(), "false");
+        return (this == &object) ? !equalLettersIgnoringASCIICase(object.popupValue(), "false")
+            : object.isLink() && !equalLettersIgnoringASCIICase(object.popupValue(), "false");
     });
 }
 
index f47efc5..5c8f60c 100644 (file)
@@ -467,7 +467,7 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
         attributeSet = addToAtkAttributeSet(attributeSet, "autocomplete", coreObject->autoCompleteValue().utf8().data());
 
     if (coreObject->supportsHasPopup())
-        attributeSet = addToAtkAttributeSet(attributeSet, "haspopup", coreObject->hasPopupValue().utf8().data());
+        attributeSet = addToAtkAttributeSet(attributeSet, "haspopup", coreObject->popupValue().utf8().data());
 
     if (coreObject->supportsCurrent())
         attributeSet = addToAtkAttributeSet(attributeSet, "current", coreObject->currentValue().utf8().data());
index d873462..a2eb20b 100644 (file)
@@ -503,6 +503,14 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
     return m_object->hasPopup();
 }
 
+- (NSString *)accessibilityPopupValue
+{
+    if (![self _prepareAccessibilityCall])
+        return nil;
+
+    return m_object->popupValue();
+}
+
 - (NSString *)accessibilityLanguage
 {
     if (![self _prepareAccessibilityCall])
index 8ac9631..f9a1844 100644 (file)
@@ -237,6 +237,10 @@ using namespace HTMLNames;
 #define NSAccessibilityHasPopupAttribute @"AXHasPopup"
 #endif
 
+#ifndef NSAccessibilityPopupValueAttribute
+#define NSAccessibilityPopupValueAttribute @"AXPopupValue"
+#endif
+
 #ifndef NSAccessibilityPlaceholderValueAttribute
 #define NSAccessibilityPlaceholderValueAttribute @"AXPlaceholderValue"
 #endif
@@ -3379,10 +3383,10 @@ IGNORE_WARNINGS_END
     
     if ([attributeName isEqualToString:@"AXAutocompleteValue"])
         return m_object->autoCompleteValue();
-    
-    if ([attributeName isEqualToString:@"AXHasPopUpValue"])
-        return m_object->hasPopupValue();
-    
+
+    if ([attributeName isEqualToString:NSAccessibilityPopupValueAttribute])
+        return m_object->popupValue();
+
     if ([attributeName isEqualToString:@"AXKeyShortcutsValue"])
         return m_object->keyShortcutsValue();
     
index 347704b..d7fe391 100644 (file)
@@ -1,3 +1,24 @@
+2019-07-02  Andres Gonzalez  <andresg_22@apple.com>
+
+        Enhance support of aria-haspopup per ARIA 1.1 specification.
+        https://bugs.webkit.org/show_bug.cgi?id=199216
+        <rdar://problem/46221342>
+
+        Reviewed by Chris Fleizach.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (getPopupValueCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::popupValue const):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::popupValue const):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::popupValue const):
+
 2019-07-02  Aakash Jain  <aakash_jain@apple.com>
 
         [ews-build] Do not print worker environment variables in each build step [part 2]
index 1159cd6..6b8736e 100644 (file)
@@ -1403,6 +1403,11 @@ static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObje
     return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
 }
 
+static JSValueRef getPopupValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+    return JSValueMakeString(context, toAXElement(thisObject)->popupValue().get());
+}
+
 static JSValueRef hierarchicalLevelCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
 {
     return JSValueMakeNumber(context, toAXElement(thisObject)->hierarchicalLevel());
@@ -1863,6 +1868,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "isOffScreen", getIsOffScreenCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "isCollapsed", getIsCollapsedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "hasPopup", getHasPopupCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "popupValue", getPopupValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "valueDescription", getValueDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "documentEncoding", getDocumentEncodingCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index 0e2a1d3..3ee21b6 100644 (file)
@@ -164,6 +164,7 @@ public:
     bool isMultiLine() const;
     bool isIndeterminate() const;
     bool hasPopup() const;
+    JSRetainPtr<JSStringRef> popupValue() const;
     int hierarchicalLevel() const;
     double clickPointX();
     double clickPointY();
index e14774b..b5367ab 100644 (file)
@@ -103,6 +103,8 @@ AccessibilityUIElement::~AccessibilityUIElement()
 - (NSArray *)accessibilitySpeechHint;
 - (BOOL)_accessibilityIsStrongPasswordField;
 - (NSString *)accessibilityTextualContext;
+- (BOOL)accessibilityHasPopup;
+- (NSString *)accessibilityPopupValue;
 
 // TextMarker related
 - (NSArray *)textMarkerRange;
@@ -1136,8 +1138,12 @@ bool AccessibilityUIElement::isMultiLine() const
 
 bool AccessibilityUIElement::hasPopup() const
 {
-    // FIXME: implement
-    return false;
+    return [m_element accessibilityHasPopup];
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    return [[m_element accessibilityPopupValue] createJSStringRef];
 }
 
 void AccessibilityUIElement::takeFocus()
index 8024657..93cfe73 100644 (file)
@@ -1626,6 +1626,17 @@ bool AccessibilityUIElement::hasPopup() const
     return false;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXPopupValue"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+
+    return [@"false" createJSStringRef];
+}
+
 void AccessibilityUIElement::takeFocus()
 {
     BEGIN_AX_OBJC_EXCEPTIONS
index e1b16ff..797c70d 100644 (file)
@@ -907,6 +907,11 @@ bool AccessibilityUIElement::hasPopup() const
     return (state & STATE_SYSTEM_HASPOPUP) == STATE_SYSTEM_HASPOPUP;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    return createEmptyJSString();
+}
+
 void AccessibilityUIElement::takeFocus()
 {
     if (!m_element)
index 69d3f51..94c21a0 100644 (file)
@@ -170,6 +170,7 @@ public:
     bool isSingleLine() const;
     bool isMultiLine() const;
     bool hasPopup() const;
+    JSRetainPtr<JSStringRef> popupValue() const;
     int hierarchicalLevel() const;
     double clickPointX();
     double clickPointY();
index e3531fb..b60bf17 100644 (file)
@@ -91,6 +91,7 @@ interface AccessibilityUIElement {
     readonly attribute boolean isVisible;
     readonly attribute boolean isCollapsed;
     readonly attribute boolean hasPopup;
+    readonly attribute DOMString popupValue;
     readonly attribute boolean isIgnored;
     readonly attribute boolean isSingleLine;
     readonly attribute boolean isMultiLine;
index f34deed..2700807 100644 (file)
@@ -87,6 +87,7 @@ typedef void (*AXPostedNotificationCallback)(id element, NSString* notification,
 - (NSString *)accessibilityTextualContext;
 - (NSString *)accessibilityRoleDescription;
 - (BOOL)accessibilityHasPopup;
+- (NSString *)accessibilityPopupValue;
 - (NSString *)accessibilityColorStringValue;
 
 // TextMarker related
@@ -1058,6 +1059,11 @@ bool AccessibilityUIElement::hasPopup() const
     return [m_element accessibilityHasPopup];
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    return [[m_element accessibilityPopupValue] createJSStringRef];
+}
+
 void AccessibilityUIElement::takeFocus()
 {
     // FIXME: implement
index 6b2788e..8958b63 100644 (file)
@@ -1708,6 +1708,17 @@ bool AccessibilityUIElement::hasPopup() const
     return false;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXPopupValue"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+
+    return [@"false" createJSStringRef];
+}
+
 void AccessibilityUIElement::takeFocus()
 {
     BEGIN_AX_OBJC_EXCEPTIONS
index f12a855..c341857 100644 (file)
@@ -758,6 +758,12 @@ bool AccessibilityUIElement::hasPopup() const
     return false;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const
+{
+    notImplemented();
+    return nullptr;
+}
+
 void AccessibilityUIElement::takeFocus()
 {
     notImplemented();