Changeset 246958 in webkit
- Timestamp:
- Jun 30, 2019 6:21:17 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246950 r246958 1 2019-06-30 Andres Gonzalez <andresg_22@apple.com> 2 3 Enhance support of aria-haspopup per ARIA 1.1 specification. 4 https://bugs.webkit.org/show_bug.cgi?id=199216 5 <rdar://problem/46221342> 6 7 Reviewed by Chris Fleizach. 8 9 * accessibility/button-with-aria-haspopup-role-expected.txt: 10 * accessibility/button-with-aria-haspopup-role.html: 11 * accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt: 12 * accessibility/ios-simulator/button-with-aria-haspopup-role.html: 13 1 14 2019-06-29 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/LayoutTests/accessibility/button-with-aria-haspopup-role-expected.txt
r215873 r246958 4 4 5 5 6 test1 AXRole: AXButton for aria-haspopup=(null) 7 test2 AXRole: AXPopUpButton for aria-haspopup='true' 8 test3 AXRole: AXButton for aria-haspopup='false' 9 test4 AXRole: AXPopUpButton for aria-haspopup='dialog' 10 test5 AXRole: AXPopUpButton for aria-haspopup='grid' 11 test6 AXRole: AXPopUpButton for aria-haspopup='listbox' 12 test7 AXRole: AXPopUpButton for aria-haspopup='menu' 13 test8 AXRole: AXPopUpButton for aria-haspopup='tree' 14 test9 AXRole: AXButton for aria-haspopup='foo' 15 test10 AXRole: AXButton for aria-haspopup='' 6 test1 AXRole: AXButton for aria-haspopup = (null) 7 AX popupValue = 'false' 8 test2 AXRole: AXPopUpButton for aria-haspopup = 'true' 9 AX popupValue = 'menu' 10 test3 AXRole: AXButton for aria-haspopup = 'false' 11 AX popupValue = 'false' 12 test4 AXRole: AXPopUpButton for aria-haspopup = 'dialog' 13 AX popupValue = 'dialog' 14 test5 AXRole: AXPopUpButton for aria-haspopup = 'grid' 15 AX popupValue = 'grid' 16 test6 AXRole: AXPopUpButton for aria-haspopup = 'listbox' 17 AX popupValue = 'listbox' 18 test7 AXRole: AXPopUpButton for aria-haspopup = 'menu' 19 AX popupValue = 'menu' 20 test8 AXRole: AXPopUpButton for aria-haspopup = 'tree' 21 AX popupValue = 'tree' 22 test9 AXRole: AXButton for aria-haspopup = 'foo' 23 AX popupValue = 'false' 24 test10 AXRole: AXButton for aria-haspopup = '' 25 AX popupValue = 'false' 16 26 PASS successfullyParsed is true 17 27 -
trunk/LayoutTests/accessibility/button-with-aria-haspopup-role.html
r215873 r246958 23 23 if (window.accessibilityController) { 24 24 for (var i = 1; i <= 10; i++) { 25 25 var element = document.getElementById("test" + i) 26 26 var popup = element.hasAttribute("aria-haspopup") ? "'" + element.getAttribute("aria-haspopup") + "'" : "(null)"; 27 27 var axElement = accessibilityController.accessibleElementById("test" + i); 28 debug("test" + i + " " + axElement.role + " for aria-haspopup=" + popup) 28 debug("test" + i + " " + axElement.role + " for aria-haspopup = " + popup) 29 // Check that accessibilityHasPopupValue returns the right value in each case. 30 debug("AX popupValue = " + "'" + axElement.popupValue + "'"); 29 31 } 30 32 -
trunk/LayoutTests/accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt
r246715 r246958 5 5 6 6 PASS element.hasAttribute('aria-haspopup') is true 7 AX popupValue = 'menu' 7 8 test1 has trait haspopup = true with aria-haspopup attribute = dialog 9 AX popupValue = 'dialog' 8 10 test2 has trait haspopup = true with aria-haspopup attribute = grid 11 AX popupValue = 'grid' 9 12 test3 has trait haspopup = true with aria-haspopup attribute = listbox 13 AX popupValue = 'listbox' 10 14 test4 has trait haspopup = true with aria-haspopup attribute = menu 15 AX popupValue = 'menu' 11 16 test5 has trait haspopup = true with aria-haspopup attribute = tree 17 AX popupValue = 'tree' 12 18 test6 has trait haspopup = false with aria-haspopup attribute = null 19 AX popupValue = 'false' 13 20 test7 has trait haspopup = false with aria-haspopup attribute = false 21 AX popupValue = 'false' 14 22 test8 has trait haspopup = false with aria-haspopup attribute = foo 23 AX popupValue = 'false' 15 24 test9 has trait haspopup = false with aria-haspopup attribute = 25 AX popupValue = 'false' 16 26 PASS successfullyParsed is true 17 27 -
trunk/LayoutTests/accessibility/ios-simulator/button-with-aria-haspopup-role.html
r246715 r246958 22 22 description("This tests the platform attributes exposed for buttons with aria-haspopup"); 23 23 if (window.accessibilityController) { 24 // Get the document and accessibility elements for test0 to be used as reference .24 // Get the document and accessibility elements for test0 to be used as reference to check traits against. 25 25 var element = document.getElementById("test0"); 26 26 shouldBe("element.hasAttribute('aria-haspopup')", "true"); 27 27 var axElement = accessibilityController.accessibleElementById("test0"); 28 28 var haspopupTraits = axElement.traits; 29 // Check that accessibilityHasPopupValue returns the right value in each case. 30 debug("AX popupValue = " + "'" + axElement.popupValue + "'"); 29 31 30 32 for (var i = 1; i <= 9; i++) { … … 34 36 var sameTraits = axElement.traits == haspopupTraits; 35 37 debug("test" + i + " has trait haspopup = " + sameTraits + " with aria-haspopup attribute = " + popup); 38 // Check that accessibilityHasPopupValue returns the right value in each case. 39 debug("AX popupValue = " + "'" + axElement.popupValue + "'"); 36 40 } 37 41 -
trunk/Source/WebCore/ChangeLog
r246954 r246958 1 2019-06-30 Andres Gonzalez <andresg_22@apple.com> 2 3 Enhance support of aria-haspopup per ARIA 1.1 specification. 4 https://bugs.webkit.org/show_bug.cgi?id=199216 5 <rdar://problem/46221342> 6 7 Reviewed by Chris Fleizach. 8 9 Test button-with-aria-haspopup-role.html was expanded to cover testing 10 of new functionality. 11 12 * accessibility/AccessibilityObject.cpp: 13 (WebCore::AccessibilityObject::popupValue const): replaces hasPopupValue. 14 (WebCore::AccessibilityObject::hasPopupValue const): Deleted. 15 * accessibility/AccessibilityObject.h: 16 * accessibility/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::hasPopup const): method rename. 18 * accessibility/atk/WebKitAccessible.cpp: 19 (webkitAccessibleGetAttributes): method rename. 20 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: 21 (-[WebAccessibilityObjectWrapper accessibilityPopupValue]): 22 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 23 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 24 1 25 2019-06-30 Zalan Bujtas <zalan@apple.com> 2 26 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r246736 r246958 2759 2759 } 2760 2760 2761 String AccessibilityObject::hasPopupValue() const 2762 { 2763 const AtomString& hasPopup = getAttribute(aria_haspopupAttr); 2764 if (equalLettersIgnoringASCIICase(hasPopup, "true") 2765 || equalLettersIgnoringASCIICase(hasPopup, "dialog") 2766 || equalLettersIgnoringASCIICase(hasPopup, "grid") 2767 || equalLettersIgnoringASCIICase(hasPopup, "listbox") 2768 || equalLettersIgnoringASCIICase(hasPopup, "menu") 2769 || equalLettersIgnoringASCIICase(hasPopup, "tree")) 2761 String AccessibilityObject::popupValue() const 2762 { 2763 static const NeverDestroyed<HashSet<String>> allowedPopupValues(std::initializer_list<String> { 2764 "menu", "listbox", "tree", "grid", "dialog" 2765 }); 2766 2767 auto hasPopup = getAttribute(aria_haspopupAttr).convertToASCIILowercase(); 2768 if (hasPopup.isNull()) 2769 return "false"; 2770 2771 if (allowedPopupValues->contains(hasPopup)) 2770 2772 return hasPopup; 2773 2774 // aria-haspopup specification states that true must be treated as menu. 2775 if (hasPopup == "true") 2776 return "menu"; 2771 2777 2772 2778 // In ARIA 1.1, the implicit value for combobox became "listbox." -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r246490 r246958 553 553 554 554 virtual bool hasPopup() const { return false; } 555 String hasPopupValue() const;555 String popupValue() const; 556 556 bool supportsHasPopup() const; 557 557 bool pressedIsPresent() const; -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r246715 r246958 1035 1035 // Return true if this has the aria-haspopup attribute, or if it has an ancestor of type link with the aria-haspopup attribute. 1036 1036 return AccessibilityObject::matchedParent(*this, true, [this] (const AccessibilityObject& object) { 1037 return (this == &object) ? !equalLettersIgnoringASCIICase(object. hasPopupValue(), "false")1038 : object.isLink() && !equalLettersIgnoringASCIICase(object. hasPopupValue(), "false");1037 return (this == &object) ? !equalLettersIgnoringASCIICase(object.popupValue(), "false") 1038 : object.isLink() && !equalLettersIgnoringASCIICase(object.popupValue(), "false"); 1039 1039 }); 1040 1040 } -
trunk/Source/WebCore/accessibility/atk/WebKitAccessible.cpp
r246677 r246958 468 468 469 469 if (coreObject->supportsHasPopup()) 470 attributeSet = addToAtkAttributeSet(attributeSet, "haspopup", coreObject-> hasPopupValue().utf8().data());470 attributeSet = addToAtkAttributeSet(attributeSet, "haspopup", coreObject->popupValue().utf8().data()); 471 471 472 472 if (coreObject->supportsCurrent()) -
trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
r246941 r246958 502 502 503 503 return m_object->hasPopup(); 504 } 505 506 - (NSString *)accessibilityPopupValue 507 { 508 if (![self _prepareAccessibilityCall]) 509 return nil; 510 511 return m_object->popupValue(); 504 512 } 505 513 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r246941 r246958 236 236 #ifndef NSAccessibilityHasPopupAttribute 237 237 #define NSAccessibilityHasPopupAttribute @"AXHasPopup" 238 #endif 239 240 #ifndef NSAccessibilityPopupValueAttribute 241 #define NSAccessibilityPopupValueAttribute @"AXPopupValue" 238 242 #endif 239 243 … … 3380 3384 if ([attributeName isEqualToString:@"AXAutocompleteValue"]) 3381 3385 return m_object->autoCompleteValue(); 3382 3383 if ([attributeName isEqualToString: @"AXHasPopUpValue"])3384 return m_object-> hasPopupValue();3385 3386 3387 if ([attributeName isEqualToString:NSAccessibilityPopupValueAttribute]) 3388 return m_object->popupValue(); 3389 3386 3390 if ([attributeName isEqualToString:@"AXKeyShortcutsValue"]) 3387 3391 return m_object->keyShortcutsValue(); -
trunk/Tools/ChangeLog
r246944 r246958 1 2019-06-30 Andres Gonzalez <andresg_22@apple.com> 2 3 Enhance support of aria-haspopup per ARIA 1.1 specification. 4 https://bugs.webkit.org/show_bug.cgi?id=199216 5 <rdar://problem/46221342> 6 7 Reviewed by Chris Fleizach. 8 9 * DumpRenderTree/AccessibilityUIElement.cpp: 10 (getPopupValueCallback): 11 (AccessibilityUIElement::getJSClass): 12 * DumpRenderTree/AccessibilityUIElement.h: 13 * DumpRenderTree/mac/AccessibilityUIElementMac.mm: 14 (AccessibilityUIElement::popupValue const): 15 * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: 16 * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: 17 * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: 18 (WTR::AccessibilityUIElement::popupValue const): 19 * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: 20 (WTR::AccessibilityUIElement::popupValue const): 21 1 22 2019-06-28 Robin Morisset <rmorisset@apple.com> 2 23 -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp
r244561 r246958 1402 1402 { 1403 1403 return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup()); 1404 } 1405 1406 static JSValueRef getPopupValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*) 1407 { 1408 return JSValueMakeString(context, toAXElement(thisObject)->popupValue().get()); 1404 1409 } 1405 1410 … … 1864 1869 { "isCollapsed", getIsCollapsedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1865 1870 { "hasPopup", getHasPopupCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1871 { "popupValue", getPopupValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1866 1872 { "valueDescription", getValueDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1867 1873 { "hierarchicalLevel", hierarchicalLevelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.h
r244561 r246958 165 165 bool isIndeterminate() const; 166 166 bool hasPopup() const; 167 JSRetainPtr<JSStringRef> popupValue() const; 167 168 int hierarchicalLevel() const; 168 169 double clickPointX(); -
trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
r244059 r246958 104 104 - (BOOL)_accessibilityIsStrongPasswordField; 105 105 - (NSString *)accessibilityTextualContext; 106 - (BOOL)accessibilityHasPopup; 107 - (NSString *)accessibilityPopupValue; 106 108 107 109 // TextMarker related … … 1137 1139 bool AccessibilityUIElement::hasPopup() const 1138 1140 { 1139 // FIXME: implement 1140 return false; 1141 return [m_element accessibilityHasPopup]; 1142 } 1143 1144 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 1145 { 1146 return [[m_element accessibilityPopupValue] createJSStringRef]; 1141 1147 } 1142 1148 -
trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r244561 r246958 1627 1627 } 1628 1628 1629 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 1630 { 1631 BEGIN_AX_OBJC_EXCEPTIONS 1632 id value = [m_element accessibilityAttributeValue:@"AXPopupValue"]; 1633 if ([value isKindOfClass:[NSString class]]) 1634 return [value createJSStringRef]; 1635 END_AX_OBJC_EXCEPTIONS 1636 1637 return [@"false" createJSStringRef]; 1638 } 1639 1629 1640 void AccessibilityUIElement::takeFocus() 1630 1641 { -
trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
r236032 r246958 908 908 } 909 909 910 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 911 { 912 return createEmptyJSString(); 913 } 914 910 915 void AccessibilityUIElement::takeFocus() 911 916 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
r245565 r246958 171 171 bool isMultiLine() const; 172 172 bool hasPopup() const; 173 JSRetainPtr<JSStringRef> popupValue() const; 173 174 int hierarchicalLevel() const; 174 175 double clickPointX(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
r244561 r246958 92 92 readonly attribute boolean isCollapsed; 93 93 readonly attribute boolean hasPopup; 94 readonly attribute DOMString popupValue; 94 95 readonly attribute boolean isIgnored; 95 96 readonly attribute boolean isSingleLine; -
trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
r246715 r246958 88 88 - (NSString *)accessibilityRoleDescription; 89 89 - (BOOL)accessibilityHasPopup; 90 - (NSString *)accessibilityPopupValue; 90 91 - (NSString *)accessibilityColorStringValue; 91 92 … … 1057 1058 { 1058 1059 return [m_element accessibilityHasPopup]; 1060 } 1061 1062 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 1063 { 1064 return [[m_element accessibilityPopupValue] createJSStringRef]; 1059 1065 } 1060 1066 -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
r244561 r246958 1709 1709 } 1710 1710 1711 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 1712 { 1713 BEGIN_AX_OBJC_EXCEPTIONS 1714 id value = [m_element accessibilityAttributeValue:@"AXPopupValue"]; 1715 if ([value isKindOfClass:[NSString class]]) 1716 return [value createJSStringRef]; 1717 END_AX_OBJC_EXCEPTIONS 1718 1719 return [@"false" createJSStringRef]; 1720 } 1721 1711 1722 void AccessibilityUIElement::takeFocus() 1712 1723 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp
r244066 r246958 759 759 } 760 760 761 JSRetainPtr<JSStringRef> AccessibilityUIElement::popupValue() const 762 { 763 notImplemented(); 764 return nullptr; 765 } 766 761 767 void AccessibilityUIElement::takeFocus() 762 768 {
Note: See TracChangeset
for help on using the changeset viewer.