Skip to content
Permalink
Browse files
WebAccessibilityObjectWrapperMac::detachIsolatedObject should not unr…
…egister the wrapper for AccessibilityDetachmentType::ElementChanged detachments

https://bugs.webkit.org/show_bug.cgi?id=240628

Reviewed by Chris Fleizach.

Prior to this change, WebAccessibilityObjectWrapperMac::detachIsolatedObject unconditionally
called NSAccessibilityUnregisterUniqueIdForUIElement. This is the wrong
behavior for AccessibilityDetachmentType::ElementChanged detachments, as
this unregistering causes an element destroyed notification to be issued.

This type of detachment happens when we swap the underlying isolated
object for a wrapper as the result of a call to AXIsolatedTree::updateNode.

This unregistering caused VoiceOver focus flickering when modifying
sliders or textboxes, greatly hampering user experience.

No test included because there isn't a great way to test this.

* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper detachIsolatedObject:]):

Canonical link: https://commits.webkit.org/250805@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
twilco committed May 20, 2022
1 parent 408a9d7 commit c8887c548505cc60fcef62033515146a0066b64d
Showing 1 changed file with 4 additions and 1 deletion.
@@ -542,7 +542,10 @@ - (void)detach
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
- (void)detachIsolatedObject:(AccessibilityDetachmentType)detachmentType
{
NSAccessibilityUnregisterUniqueIdForUIElement(self);
// Only unregister this wrapper if the underlying object or cache is being destroyed. Unregistering it in other cases (like `ElementChanged`)
// would cause AX clients to get a notification that this wrapper was destroyed, which wouldn't be true.
if (detachmentType == AccessibilityDetachmentType::ElementDestroyed || detachmentType == AccessibilityDetachmentType::CacheDestroyed)
NSAccessibilityUnregisterUniqueIdForUIElement(self);
[super detachIsolatedObject:detachmentType];
}
#endif

0 comments on commit c8887c5

Please sign in to comment.