Bug 233232

Summary: AX: Fix 5 tests in --release --accessibility-isolated-tree mode
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Tyler Wilcock 2021-11-16 19:43:32 PST
Fix 5 more tests in --release --accessibility-isolated-tree mode
Comment 1 Radar WebKit Bug Importer 2021-11-16 19:43:50 PST
<rdar://problem/85487292>
Comment 2 Tyler Wilcock 2021-11-16 19:48:07 PST
Created attachment 444469 [details]
Patch
Comment 3 chris fleizach 2021-11-17 10:07:56 PST
Comment on attachment 444469 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=444469&action=review

> LayoutTests/accessibility/aria-checkbox-checked.html:-39
> -                checkbox.focus();

why doesn't this setFocus() getFocusElemnt() method work in isolated tree mode?
Comment 4 Tyler Wilcock 2021-11-17 10:41:12 PST
(In reply to chris fleizach from comment #3)
> Comment on attachment 444469 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=444469&action=review
> 
> > LayoutTests/accessibility/aria-checkbox-checked.html:-39
> > -                checkbox.focus();
> 
> why doesn't this setFocus() getFocusElemnt() method work in isolated tree
> mode?
It would work, but we'd have to wait asynchronously for the accessibilityController.focusedElement to catch up with the DOM focused element. This test used focusing elements as a round-about way of getting a reference to AccessibilityUIElement, and we can just use accessibleElementById directly instead to avoid unnecessary async waiting.
Comment 5 Andres Gonzalez 2021-11-17 10:45:27 PST
(In reply to Tyler Wilcock from comment #2)
> Created attachment 444469 [details]
> Patch

--- a/LayoutTests/accessibility/add-children-pseudo-element.html
+++ a/LayoutTests/accessibility/add-children-pseudo-element.html

+        var element;
+        setTimeout(async function() {
+            element = accessibilityController.accessibleElementById("float");

I think you can declare element inside the body of the async function.

--- a/LayoutTests/accessibility/auto-fill-types.html
+++ a/LayoutTests/accessibility/auto-fill-types.html

+        var textField, axTextField, contactsButton, credentialsButton;
+        setTimeout(async function() {
+            textField = document.getElementById("textfield");

No need to declare these outside the function body.

--- a/LayoutTests/accessibility/ax-value-with-search.html
+++ a/LayoutTests/accessibility/ax-value-with-search.html

+        var searchInput;
+        setTimeout(async function() {
+            searchInput = accessibilityController.accessibleElementById("searchInput");

Dito.
Comment 6 EWS 2021-11-17 10:50:08 PST
Committed r285937 (244346@main): <https://commits.webkit.org/244346@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444469 [details].
Comment 7 Tyler Wilcock 2021-11-17 10:51:18 PST
Sorry Andres, the patch has landed, so I'll address your comments in a follow-up.