Bug 248590 - AX: Make crash-in-element-for-text-marker.html and aria-liveregions-attributes.html async-friendly so they can pass in ITM
Summary: AX: Make crash-in-element-for-text-marker.html and aria-liveregions-attribute...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-01 00:37 PST by Tyler Wilcock
Modified: 2022-12-03 02:20 PST (History)
10 users (show)

See Also:


Attachments
Patch (17.89 KB, patch)
2022-12-01 00:42 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (17.94 KB, patch)
2022-12-01 09:57 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-12-01 00:37:36 PST
AX: Make crash-in-element-for-text-marker.html and aria-liveregions-attributes.html async-friendly so they can pass in ITM
Comment 1 Radar WebKit Bug Importer 2022-12-01 00:37:48 PST
<rdar://problem/102849570>
Comment 2 Tyler Wilcock 2022-12-01 00:42:21 PST
Created attachment 463826 [details]
Patch
Comment 3 Andres Gonzalez 2022-12-01 07:11:13 PST
(In reply to Tyler Wilcock from comment #2)
> Created attachment 463826 [details]
> Patch

--- a/LayoutTests/resources/accessibility-helper.js
+++ b/LayoutTests/resources/accessibility-helper.js
@@ -177,6 +177,11 @@ async function expectAsyncExpression(expression, expectedValue) {
     debug(`PASS ${evalExpression}`);
 }

+async function waitForFocus(id) {
+    document.getElementById(id).focus();
+    await waitFor(() => accessibilityController.focusedElement && accessibilityController.focusedElement.domIdentifier === id);
+}

Would it be a bit more performant if we don't call accessibilityController.focusedElement twice? This may be called a bunch of times like in the first test in this patch.
Comment 4 Tyler Wilcock 2022-12-01 09:57:27 PST
Created attachment 463837 [details]
Patch
Comment 5 EWS 2022-12-03 02:20:26 PST
Committed 257319@main (fb7087c033ee): <https://commits.webkit.org/257319@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 463837 [details].