Changeset 285776 in webkit
- Timestamp:
- Nov 13, 2021, 10:38:12 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/mac/header-expected.txt (modified) (1 diff)
-
LayoutTests/accessibility/mac/header.html (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/AccessibilityUIElement.cpp (modified) (2 diffs)
-
Tools/DumpRenderTree/AccessibilityUIElement.h (modified) (1 diff)
-
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (modified) (2 diffs)
-
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (modified) (2 diffs)
-
Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285769 r285776 1 2021-11-13 Tyler Wilcock <tyler_w@apple.com> 2 3 AX: Make accessibility/mac/header.html test async to fix it for isolated tree mode 4 https://bugs.webkit.org/show_bug.cgi?id=233017 5 6 Reviewed by Andres Gonzalez. 7 8 This test needs to be made async, as we need to wait for 9 accessibilityController.focusedElement to be synced with the DOM 10 focused element before running our expectations. This fixes the 11 test in isolated tree mode. 12 13 * accessibility/mac/header-expected.txt: 14 Remove extra newline at end of the file. 15 * accessibility/mac/header.html: 16 Make test async. 17 1 18 2021-11-12 Said Abou-Hallawa <said@apple.com> 2 19 -
trunk/LayoutTests/accessibility/mac/header-expected.txt
r187799 r285776 11 11 Header inside an article. 12 12 Header inside a section. 13 -
trunk/LayoutTests/accessibility/mac/header.html
r187799 r285776 1 < html>1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 2 <html> 3 3 <head> 4 <script src='../../resources/js-test-pre.js'></script> 4 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id='body'> 7 <header tabindex='0' id='header01'>Header outside section and article elements.</header> 8 <article> 9 <header tabindex='0' id='header02'>Header inside an article.</header> 10 </article> 11 <section> 12 <header tabindex='0' id='header03'>Header inside a section.</header> 13 </section> 14 <pre id='result'></pre> 15 <script> 16 function log(str) { 17 var result = document.querySelector('#result'); 18 result.appendChild(document.createTextNode(str)); 19 } 7 <body> 20 8 21 function expectRole(expectedRole, expectedDescription, id) { 22 if (!window.accessibilityController) 23 return; 24 var el = document.querySelector(id); 25 el.focus(); 26 shouldBeEqualToString('accessibilityController.focusedElement.role', "AXRole: " + expectedRole); 27 shouldBeEqualToString('accessibilityController.focusedElement.roleDescription', "AXRoleDescription: " + expectedDescription); 28 } 9 <header tabindex="0" id="header01">Header outside section and article elements.</header> 10 <article> 11 <header tabindex="0" id="header02">Header inside an article.</header> 12 </article> 13 <section> 14 <header tabindex="0" id="header03">Header inside a section.</header> 15 </section> 29 16 30 expectRole('AXGroup', 'banner', '#header01'); 31 expectRole('AXGroup', 'group', '#header02'); 32 expectRole('AXGroup', 'group', '#header03'); 33 </script> 34 <script src='../../resources/js-test-post.js'></script> 17 <script> 18 async function expectRole(expectedRole, expectedDescription, id) { 19 document.getElementById(id).focus(); 20 21 await waitFor(() => { 22 const focusedElement = accessibilityController.focusedElement; 23 return focusedElement && focusedElement.domIdentifier === id; 24 }); 25 26 shouldBeEqualToString("accessibilityController.focusedElement.role", "AXRole: " + expectedRole); 27 shouldBeEqualToString("accessibilityController.focusedElement.roleDescription", "AXRoleDescription: " + expectedDescription); 28 } 29 30 if (window.accessibilityController) { 31 window.jsTestIsAsync = true; 32 33 setTimeout(async function() { 34 await expectRole("AXGroup", "banner", "header01"); 35 await expectRole("AXGroup", "group", "header02"); 36 await expectRole("AXGroup", "group", "header03"); 37 38 finishJSTest(); 39 }, 0); 40 } 41 </script> 42 35 43 </body> 36 44 </html> 45 -
trunk/Tools/ChangeLog
r285772 r285776 1 2021-11-13 Tyler Wilcock <tyler_w@apple.com> 2 3 AX: Make accessibility/mac/header.html test async to fix it for isolated tree mode 4 https://bugs.webkit.org/show_bug.cgi?id=233017 5 6 Reviewed by Andres Gonzalez. 7 8 This patch implements the `domIdentifier` attribute for DumpRenderTree 9 elements. When making this test async, I wanted to use this attribute, 10 hence the implementation in this patch. 11 12 * DumpRenderTree/AccessibilityUIElement.cpp: 13 (domIdentifierCallback): Added. 14 (AccessibilityUIElement::getJSClass): 15 Add "domIdentifer" entry to `staticValues[]`. 16 17 * DumpRenderTree/AccessibilityUIElement.h: 18 Add AccessibilityUIElement::domIdentifier const definition. 19 * DumpRenderTree/mac/AccessibilityUIElementMac.mm: 20 (AccessibilityUIElement::domIdentifier const): Added. 21 * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: 22 (AccessibilityUIElement::domIdentifier const): Added. 23 * DumpRenderTree/win/AccessibilityUIElementWin.cpp: 24 (AccessibilityUIElement::domIdentifier const):Added. 25 1 26 2021-11-12 Jonathan Bedard <jbedard@apple.com> 2 27 -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp
r285589 r285776 1167 1167 auto classList = toAXElement(thisObject)->classList(); 1168 1168 return JSValueMakeString(context, classList.get()); 1169 } 1170 1171 static JSValueRef domIdentifierCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) 1172 { 1173 auto domIdentifier = toAXElement(thisObject)->domIdentifier(); 1174 return JSValueMakeString(context, domIdentifier.get()); 1169 1175 } 1170 1176 … … 1946 1952 { "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1947 1953 { "classList", getClassListCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1954 { "domIdentifier", domIdentifierCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1948 1955 { "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1949 1956 { "speakAs", speakAsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/Tools/DumpRenderTree/AccessibilityUIElement.h
r285589 r285776 176 176 JSRetainPtr<JSStringRef> url(); 177 177 JSRetainPtr<JSStringRef> classList() const; 178 JSRetainPtr<JSStringRef> domIdentifier() const; 178 179 179 180 // CSS3-speech properties. -
trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
r285589 r285776 95 95 - (NSString *)_accessibilityPhotoDescription; 96 96 - (BOOL)accessibilityPerformEscape; 97 - (NSString *)accessibilityDOMIdentifier; 97 98 98 99 // TextMarker related … … 1227 1228 } 1228 1229 1230 JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const 1231 { 1232 return [[m_element accessibilityDOMIdentifier] createJSStringRef]; 1233 } 1234 1229 1235 void AccessibilityUIElement::uiElementArrayAttributeValue(JSStringRef, Vector<AccessibilityUIElement>&) const 1230 1236 { -
trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
r285589 r285776 39 39 #import <wtf/cocoa/VectorCocoa.h> 40 40 41 #ifndef NSAccessibilityDOMIdentifierAttribute 42 #define NSAccessibilityDOMIdentifierAttribute @"AXDOMIdentifier" 43 #endif 44 41 45 #ifndef NSAccessibilityOwnsAttribute 42 46 #define NSAccessibilityOwnsAttribute @"AXOwns" … … 656 660 id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityDescriptionAttribute], m_element.get()); 657 661 return concatenateAttributeAndValue(@"AXDescription", description); 662 END_AX_OBJC_EXCEPTIONS 663 664 return nullptr; 665 } 666 667 JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const 668 { 669 BEGIN_AX_OBJC_EXCEPTIONS 670 id value = [m_element accessibilityAttributeValue:NSAccessibilityDOMIdentifierAttribute]; 671 if ([value isKindOfClass:[NSString class]]) 672 return [value createJSStringRef]; 658 673 END_AX_OBJC_EXCEPTIONS 659 674 -
trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
r285589 r285776 991 991 } 992 992 993 JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const 994 { 995 // FIXME: implement 996 return 0; 997 } 998 993 999 unsigned AccessibilityUIElement::selectedChildrenCount() const 994 1000 {
Note:
See TracChangeset
for help on using the changeset viewer.