Changeset 290673 in webkit
- Timestamp:
- Mar 1, 2022, 1:44:24 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r290670 r290673 1 2022-03-01 Andres Gonzalez <andresg_22@apple.com> 2 3 Make accessibility/aria-hidden-false-works-in-subtrees.html async to pass in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=237051 5 <rdar://problem/89312156> 6 7 Reviewed by Chris Fleizach. 8 9 * accessibility/aria-hidden-false-works-in-subtrees.html: 10 Made both the main script and the iframe onload function async to pass 11 in isolated tree mode. 12 1 13 2022-03-01 Matteo Flores <matteo_flores@apple.com> 2 14 -
trunk/LayoutTests/accessibility/aria-hidden-false-works-in-subtrees.html
r289028 r290673 2 2 <html> 3 3 <head> 4 <script src="../resources/js-test -pre.js"></script>4 <script src="../resources/js-test.js"></script> 5 5 <script src="../resources/accessibility-helper.js"></script> 6 6 </head> 7 <body id="body">7 <body> 8 8 9 <div id="content" >9 <div id="content" role="group"> 10 10 11 11 <div hidden aria-hidden="false" aria-label="group0"> … … 60 60 </div> 61 61 62 <p id="description"></p>63 <div id="console"></div>64 65 62 <script> 66 63 description("This tests that a sub-tree within a node marked with aria-hidden=false will be exposed in the AX tree."); 67 64 68 var iframeChild;69 65 function testiFrameContent() { 70 // Test that aria-hidden=false does NOT expose iframe fallback text. 71 var iframe = accessibilityController.accessibleElementById("iframe").childAtIndex(0).childAtIndex(0); 66 setTimeout(async () => { 67 // Test that aria-hidden=false does NOT expose iframe fallback text. 68 let iframe = accessibilityController.accessibleElementById("iframe").childAtIndex(0).childAtIndex(0); 72 69 73 debug("Non-rendered iframe content should not be visible when aria-hidden=true. The first child should be a group and NOT static text."); 74 iframeChild = iframe.childAtIndex(0); 75 debug("iFrame child role: " + iframeChild.role); 70 debug("Non-rendered iframe content should not be visible when aria-hidden=true. The first child should be a group and NOT static text."); 71 let iframeChild = null; 72 await waitFor(() => { 73 return iframeChild = iframe.childAtIndex(0); 74 }); 75 debug("iFrame child role: " + iframeChild.role); 76 76 77 document.getElementById("content").style.visibility = "hidden";78 79 finishJSTest();77 document.getElementById("content").style.visibility = "hidden"; 78 finishJSTest(); 79 }, 0); 80 80 } 81 81 … … 92 92 } 93 93 } 94 94 95 95 if (window.accessibilityController) { 96 96 window.jsTestIsAsync = true; 97 97 98 var root = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0); 99 dumpAccessibilityChildren(root, 0); 98 setTimeout(async () => { 99 let root = accessibilityController.accessibleElementById("content").childAtIndex(0); 100 dumpAccessibilityChildren(root, 0); 100 101 101 // Text inside aria-hidden=false inherits from parent.102 var object;103 if (accessibilityController.platformName == "atspi") {104 object = accessibilityController.accessibleElementById("group3");105 shouldBe("object.role", "'AXRole: AXSection'");106 } else {107 object = accessibilityController.accessibleElementById("group3").childAtIndex(0);108 shouldBe("object.role", "'AXRole: AXStaticText'");109 }110 varstringValue = object.stringValue.replace(/\n/g, '');111 shouldBe("stringValue", "'AXValue: text3'");102 // Text inside aria-hidden=false inherits from parent. 103 window.object = null; 104 if (accessibilityController.platformName == "atspi") { 105 object = accessibilityController.accessibleElementById("group3"); 106 shouldBe("object.role", "'AXRole: AXSection'"); 107 } else { 108 object = accessibilityController.accessibleElementById("group3").childAtIndex(0); 109 shouldBe("object.role", "'AXRole: AXStaticText'"); 110 } 111 window.stringValue = object.stringValue.replace(/\n/g, ''); 112 shouldBe("stringValue", "'AXValue: text3'"); 112 113 113 // Text inside nested aria-hidden=false inherits from parent.114 if (accessibilityController.platformName == "atspi") {115 object = accessibilityController.accessibleElementById("group4").childAtIndex(0);116 shouldBe("object.role", "'AXRole: AXGroup'");117 } else {118 object = accessibilityController.accessibleElementById("group4").childAtIndex(0).childAtIndex(0);119 shouldBe("object.role", "'AXRole: AXStaticText'");120 }121 stringValue = object.stringValue.replace(/\n/g, '');122 if (accessibilityController.platformName == "atspi")123 shouldBe("stringValue", "'AXValue: text4'");124 else125 shouldBe("stringValue", "'AXValue: text4 '");114 // Text inside nested aria-hidden=false inherits from parent. 115 if (accessibilityController.platformName == "atspi") { 116 object = accessibilityController.accessibleElementById("group4").childAtIndex(0); 117 shouldBe("object.role", "'AXRole: AXGroup'"); 118 } else { 119 object = accessibilityController.accessibleElementById("group4").childAtIndex(0).childAtIndex(0); 120 shouldBe("object.role", "'AXRole: AXStaticText'"); 121 } 122 stringValue = object.stringValue.replace(/\n/g, ''); 123 if (accessibilityController.platformName == "atspi") 124 shouldBe("stringValue", "'AXValue: text4'"); 125 else 126 shouldBe("stringValue", "'AXValue: text4 '"); 126 127 127 // When not all the parents have aria-hidden=false, element should not be visible.128 object = accessibilityController.accessibleElementById("group5").childAtIndex(0);129 shouldBeTrue("!object || !object.isValid");128 // When not all the parents have aria-hidden=false, element should not be visible. 129 object = accessibilityController.accessibleElementById("group5").childAtIndex(0); 130 shouldBeTrue("!object || !object.isValid"); 130 131 131 // Objects that don't have aria-hidden=false are not visible when the parents have that attribute.132 object = accessibilityController.accessibleElementById("group6").childAtIndex(0);133 if (accessibilityController.platformName == "atspi")134 shouldBe("object.role", "'AXRole: AXSection'");135 else136 shouldBe("object.role", "'AXRole: AXGroup'");137 shouldBe("object.childrenCount", "0");132 // Objects that don't have aria-hidden=false are not visible when the parents have that attribute. 133 object = accessibilityController.accessibleElementById("group6").childAtIndex(0); 134 if (accessibilityController.platformName == "atspi") 135 shouldBe("object.role", "'AXRole: AXSection'"); 136 else 137 shouldBe("object.role", "'AXRole: AXGroup'"); 138 shouldBe("object.childrenCount", "0"); 138 139 139 // When all objects have aria-hidden=false, then the elements are visible. 140 object = accessibilityController.accessibleElementById("group7").childAtIndex(0); 141 if (accessibilityController.platformName == "atspi") 142 shouldBe("object.role", "'AXRole: AXSection'"); 143 else 144 shouldBe("object.role", "'AXRole: AXGroup'"); 145 shouldBe("object.childrenCount", "1"); 146 shouldBe("object.childAtIndex(0).role", "'AXRole: AXButton'"); 140 // When all objects have aria-hidden=false, then the elements are visible. 141 object = accessibilityController.accessibleElementById("group7").childAtIndex(0); 142 if (accessibilityController.platformName == "atspi") 143 shouldBe("object.role", "'AXRole: AXSection'"); 144 else 145 shouldBe("object.role", "'AXRole: AXGroup'"); 146 shouldBe("object.childrenCount", "1"); 147 shouldBe("object.childAtIndex(0).role", "'AXRole: AXButton'"); 148 }, 0); 147 149 } 148 149 150 </script> 150 151 <script src="../resources/js-test-post.js"></script>152 151 </body> 153 152 </html> -
trunk/Tools/ChangeLog
r290661 r290673 1 2022-03-01 Andres Gonzalez <andresg_22@apple.com> 2 3 Make accessibility/aria-hidden-false-works-in-subtrees.html async to pass in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=237051 5 <rdar://problem/89312156> 6 7 Reviewed by Chris Fleizach. 8 9 * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm: 10 (WTR::AccessibilityController::accessibleElementById): 11 Convert the JSStringRef to NSString on the main thread and capture the 12 NSString to be used on the AX secondary thread. This may be safer since 13 JSStringRefs are supposed to be used on the main thread. 14 1 15 2022-03-01 Jonathan Bedard <jbedard@apple.com> 2 16 -
trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm
r284395 r290673 115 115 PlatformUIElement root = static_cast<PlatformUIElement>(WKAccessibilityRootObject(page)); 116 116 117 NSString *attributeName = [NSString stringWithJSStringRef:idAttribute]; 117 118 RetainPtr<id> result; 118 executeOnAXThreadAndWait([&root, & idAttribute, &result] {119 result = findAccessibleObjectById(root, [NSString stringWithJSStringRef:idAttribute]);119 executeOnAXThreadAndWait([&root, &attributeName, &result] { 120 result = findAccessibleObjectById(root, attributeName); 120 121 }); 121 122
Note:
See TracChangeset
for help on using the changeset viewer.