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

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/
(-[WebAccessibilityObjectWrapper detachIsolatedObject:]):

Canonical link:
git-svn-id: 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
- (void)detachIsolatedObject:(AccessibilityDetachmentType)detachmentType
// 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)
[super detachIsolatedObject:detachmentType];

0 comments on commit c8887c5

Please sign in to comment.