WebAccessibilityObjectWrapperMac::detachIsolatedObject should not unregister the...
commit1a39208a4acfc9510ff6dc07aa0dbfad8b0b15df
authortyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2022 17:13:32 +0000 (20 17:13 +0000)
committertyler_w@apple.com <tyler_w@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2022 17:13:32 +0000 (20 17:13 +0000)
tree8cf42343ef8b9795ab643a729bc1a020a95e6489
parentee66ae2f7f278a27eea4360c06a85ac1f5a88a13
WebAccessibilityObjectWrapperMac::detachIsolatedObject should not unregister 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:]):

link: https://commits.webkit.org/250805@main
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@294552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm