Bug 246135 - AX: The isolated tree doesn't update in response to HTMLOptionElement::setSelectedState changes
Summary: AX: The isolated tree doesn't update in response to HTMLOptionElement::setSel...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-05 23:42 PDT by Tyler Wilcock
Modified: 2022-10-07 10:44 PDT (History)
15 users (show)

See Also:


Attachments
Patch (17.12 KB, patch)
2022-10-05 23:52 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (17.42 KB, patch)
2022-10-06 11:59 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2022-10-05 23:42:45 PDT
AX: The isolated tree doesn't update in response to HTMLOptionElement::setSelectedState changes
Comment 1 Radar WebKit Bug Importer 2022-10-05 23:42:56 PDT
<rdar://problem/100839849>
Comment 2 Tyler Wilcock 2022-10-05 23:52:12 PDT
Created attachment 462829 [details]
Patch
Comment 3 Andres Gonzalez 2022-10-06 07:14:28 PDT
(In reply to Tyler Wilcock from comment #2)
> Created attachment 462829 [details]
> Patch

--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ a/Source/WebCore/accessibility/AXObjectCache.cpp

+bool isARIATableCell(Node* node)

Make it a static function like isSimpleImage.

--- a/Source/WebCore/accessibility/AXObjectCache.h
+++ a/Source/WebCore/accessibility/AXObjectCache.h

+    void selectedStateChanged(Node*);

Rename to onSelectedStateChange.

--- a/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm
+++ a/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm

-    if (notificationName.isNull())
+    if (notificationName.isNull() || (notificationName == SelectedCellsChangedNotificationName && !isARIATableCell(object->node())))
         return;

Why do we want to suppress this notification here? If we don't want an iOS client to react to it, we should ignore it closer to the client, maybe in the system bundle.

--- a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
+++ a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

     case AXSelectedStateChanged:
-        macNotification = NSAccessibilitySelectedCellsChangedNotification;
-        break;
+        if (isARIATableCell(object->node())) {
+            macNotification = NSAccessibilitySelectedCellsChangedNotification;
+            break;
+        }
+        return;

If we want to distinguish SelectedState from SelectedCells for table cells, we should add a new AXSelectedCellsChanged, so that we shouldn't need to call isARIATableCell(object->node()) here.
Comment 4 Tyler Wilcock 2022-10-06 11:59:34 PDT
Created attachment 462843 [details]
Patch
Comment 5 EWS 2022-10-07 10:44:38 PDT
Committed 255279@main (1aa25b42a5eb): <https://commits.webkit.org/255279@main>

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