Bug 247400

Summary: AX ITM: fix for aria-activedescendant tests 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, 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
Patch none

Description Andres Gonzalez 2022-11-02 18:19:33 PDT
Currently failing in ITM.
Comment 1 Radar WebKit Bug Importer 2022-11-02 18:19:57 PDT
<rdar://problem/101889227>
Comment 2 Andres Gonzalez 2022-11-02 18:33:57 PDT
Created attachment 463374 [details]
Patch
Comment 3 Tyler Wilcock 2022-11-02 18:42:34 PDT
Comment on attachment 463374 [details]
Patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:1893
> +    updateIsolatedTree(*object, AXNotification::AXActiveDescendantChanged);

If document().focusedElement() == element, we will do this below:

postNotification(target, &document(), AXActiveDescendantChanged);

Causing a duplicated isolated tree update. Should we try to avoid this duplicate update somehow?

> Source/WebCore/accessibility/AXObjectCache.cpp:1896
> +    // NOtify active descendant changes only for the focused element.

Typo here, capital O in "NOtify"
Comment 4 Andres Gonzalez 2022-11-03 08:07:10 PDT
Created attachment 463388 [details]
Patch
Comment 5 Andres Gonzalez 2022-11-03 08:14:06 PDT
(In reply to Tyler Wilcock from comment #3)
> Comment on attachment 463374 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=463374&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:1893
> > +    updateIsolatedTree(*object, AXNotification::AXActiveDescendantChanged);
> 
> If document().focusedElement() == element, we will do this below:
> 
> postNotification(target, &document(), AXActiveDescendantChanged);
> 
> Causing a duplicated isolated tree update. Should we try to avoid this
> duplicate update somehow?

Yes, we should actually call postPlatformNotification instead. This made apparent the need to also update the target element when it is different from the original element.

> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:1896
> > +    // NOtify active descendant changes only for the focused element.
> 
> Typo here, capital O in "NOtify"

Fixed in latest patch.
Comment 6 Andres Gonzalez 2022-11-03 08:14:47 PDT
Created attachment 463389 [details]
Patch
Comment 7 EWS 2022-11-03 10:54:20 PDT
Committed 256279@main (3b4b837022dc): <https://commits.webkit.org/256279@main>

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