Bug 248104

Summary: AX ITM: Fix for aria-hidden-changes-for-non-ignored-elements.html and html-with-aria-label.html in isolated tree mode.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: AccessibilityAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, darin, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, tyler_w, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Andres Gonzalez 2022-11-18 13:45:57 PST
Currently failing in ITM.
Comment 1 Radar WebKit Bug Importer 2022-11-18 13:46:11 PST
<rdar://problem/102528770>
Comment 2 Andres Gonzalez 2022-11-18 13:49:14 PST
Created attachment 463610 [details]
Patch
Comment 3 Tyler Wilcock 2022-11-18 14:06:32 PST
Comment on attachment 463610 [details]
Patch

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

> LayoutTests/accessibility/mac/html-with-aria-label.html:20
> +        html.setAttribute("aria-label", "New Title");

I see this and some other places in this patch are using some implicit object-by-id JS syntax. I think this not recommended:

https://html.spec.whatwg.org/#named-access-on-the-window-object

> As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to this API can vary over time, as new features are added to the web platform, for example. Instead of this, use document.getElementById() or document.querySelector().

> LayoutTests/accessibility/mac/html-with-aria-label.html:22
> +            output += expect("root.description", "'AXDescription: New Title'");

Do we need a `waitFor` here? Maybe moving the expect into the async block is enough...but I wonder if the test is flakey or will become flakey without an explicit waitFor.
Comment 4 Andres Gonzalez 2022-11-28 07:49:38 PST
Created attachment 463762 [details]
Patch
Comment 5 Andres Gonzalez 2022-11-28 07:56:58 PST
(In reply to Tyler Wilcock from comment #3)
> Comment on attachment 463610 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=463610&action=review
> 
> > LayoutTests/accessibility/mac/html-with-aria-label.html:20
> > +        html.setAttribute("aria-label", "New Title");
> 
> I see this and some other places in this patch are using some implicit
> object-by-id JS syntax. I think this not recommended:
> 
> https://html.spec.whatwg.org/#named-access-on-the-window-object
> 
> > As a general rule, relying on this will lead to brittle code. Which IDs end up mapping to this API can vary over time, as new features are added to the web platform, for example. Instead of this, use document.getElementById() or document.querySelector().
> 
> > LayoutTests/accessibility/mac/html-with-aria-label.html:22
> > +            output += expect("root.description", "'AXDescription: New Title'");
> 
> Do we need a `waitFor` here? Maybe moving the expect into the async block is
> enough...but I wonder if the test is flakey or will become flakey without an
> explicit waitFor.

Didn't waitFor intentionally because doesn't seem to be necessary, no failures with --iterations=1000. In real scenarios, there may not be a wait at all, so want to reduce the use of waitFor to when it is strictly necessary. Having said that, will revisit if flakiness shows up in the bots.
Comment 6 Tyler Wilcock 2022-11-28 09:15:47 PST
> Didn't waitFor intentionally because doesn't seem to be necessary, no
> failures with --iterations=1000. In real scenarios, there may not be a wait
> at all, so want to reduce the use of waitFor to when it is strictly
> necessary. Having said that, will revisit if flakiness shows up in the bots.
OK, sounds good!
Comment 7 EWS 2022-11-29 06:10:26 PST
Committed 257113@main (557946b122c5): <https://commits.webkit.org/257113@main>

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