Changeset 280633 in webkit


Ignore:
Timestamp:
Aug 4, 2021 7:04:38 AM (12 months ago)
Author:
Andres Gonzalez
Message:

Add support for aria-selected value changes in table cells.
https://bugs.webkit.org/show_bug.cgi?id=228756
<rdar://problem/81483071>

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/selected-state-changed-notifications.html

  • Added the AXSelectedStateChangedNotification to notify AX clients that

the selected state of an object has changed.

  • This notification is used in this patch for aria-selected value

changes in table cells.

  • accessibility/AXLogger.cpp:

(WebCore::operator<<):

  • accessibility/AXObjectCache.cpp:

(WebCore::AXObjectCache::selectedStateChanged):
(WebCore::AXObjectCache::handleAttributeChange):

  • accessibility/AXObjectCache.h:
  • accessibility/ios/AXObjectCacheIOS.mm:

(WebCore::AXObjectCache::notificationPlatformName):

  • accessibility/mac/AXObjectCacheMac.mm:

(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:

  • accessibility/selected-state-changed-notifications-expected.txt: Added.
  • accessibility/selected-state-changed-notifications.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280631 r280633  
     12021-08-04  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Add support for aria-selected value changes in table cells.
     4        https://bugs.webkit.org/show_bug.cgi?id=228756
     5        <rdar://problem/81483071>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/selected-state-changed-notifications-expected.txt: Added.
     10        * accessibility/selected-state-changed-notifications.html: Added.
     11
    1122021-08-04  Cathie Chen  <cathiechen@igalia.com>
    213
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r280539 r280633  
    971971accessibility/mac/pseudo-element-text-markers.html [ Skip ]
    972972accessibility/nested-textareas-value-changed-notifications.html [ Skip ]
     973accessibility/selected-state-changed-notifications.html [ Skip ]
    973974
    974975# <rdar://problem/61066929> [ Stress GC ] flaky JSC::ExceptionScope::assertNoException crash under WebCore::ReadableStreamDefaultController
  • trunk/Source/WebCore/ChangeLog

    r280632 r280633  
     12021-08-04  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        Add support for aria-selected value changes in table cells.
     4        https://bugs.webkit.org/show_bug.cgi?id=228756
     5        <rdar://problem/81483071>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Test: accessibility/selected-state-changed-notifications.html
     10
     11        - Added the AXSelectedStateChangedNotification to notify AX clients that
     12        the selected state of an object has changed.
     13        - This notification is used in this patch for aria-selected value
     14        changes in table cells.
     15
     16        * accessibility/AXLogger.cpp:
     17        (WebCore::operator<<):
     18        * accessibility/AXObjectCache.cpp:
     19        (WebCore::AXObjectCache::selectedStateChanged):
     20        (WebCore::AXObjectCache::handleAttributeChange):
     21        * accessibility/AXObjectCache.h:
     22        * accessibility/ios/AXObjectCacheIOS.mm:
     23        (WebCore::AXObjectCache::notificationPlatformName):
     24        * accessibility/mac/AXObjectCacheMac.mm:
     25        (WebCore::AXObjectCache::postPlatformNotification):
     26
    1272021-08-04  Martin Robinson  <mrobinson@webkit.org>
    228
  • trunk/Source/WebCore/accessibility/AXLogger.cpp

    r279171 r280633  
    394394        stream << "AXSelectedChildrenChanged";
    395395        break;
     396    case AXObjectCache::AXNotification::AXSelectedStateChanged:
     397        stream << "AXSelectedStateChanged";
     398        break;
    396399    case AXObjectCache::AXNotification::AXSelectedTextChanged:
    397400        stream << "AXSelectedTextChanged";
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r279941 r280633  
    12981298    // to find the container which should send out the notification.
    12991299    postNotification(renderer, AXSelectedChildrenChanged, PostTarget::ObservableParent);
     1300}
     1301
     1302void AXObjectCache::selectedStateChanged(Node* node)
     1303{
     1304    // For a table cell, post AXSelectedStateChanged on the cell itself.
     1305    // For any other element, post AXSelectedChildrenChanged on the parent.
     1306    if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "cell")
     1307        || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader"))
     1308        postNotification(node, AXSelectedStateChanged);
     1309    else
     1310        selectedChildrenChanged(node);
    13001311}
    13011312
     
    18071818        checkedStateChanged(element);
    18081819    else if (attrName == aria_selectedAttr)
    1809         selectedChildrenChanged(element);
     1820        selectedStateChanged(element);
    18101821    else if (attrName == aria_expandedAttr)
    18111822        handleAriaExpandedChange(element);
  • trunk/Source/WebCore/accessibility/AXObjectCache.h

    r279171 r280633  
    292292        AXPageScrolled,
    293293        AXSelectedChildrenChanged,
     294        AXSelectedStateChanged,
    294295        AXSelectedTextChanged,
    295296        AXValueChanged,
     
    464465    void selectedChildrenChanged(Node*);
    465466    void selectedChildrenChanged(RenderObject*);
     467    void selectedStateChanged(Node*);
    466468    // Called by a node when text or a text equivalent (e.g. alt) attribute is changed.
    467469    void textChanged(Node*);
  • trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm

    r279171 r280633  
    5757    case AXPageScrolled:
    5858        name = "AXPageScrolled";
     59        break;
     60    case AXSelectedStateChanged:
     61        name = "AXSelectedCellsChanged";
    5962        break;
    6063    case AXSelectedTextChanged:
  • trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

    r279171 r280633  
    343343        else
    344344            macNotification = NSAccessibilitySelectedChildrenChangedNotification;
     345        break;
     346    case AXSelectedStateChanged:
     347        macNotification = NSAccessibilitySelectedCellsChangedNotification;
    345348        break;
    346349    case AXSelectedTextChanged:
Note: See TracChangeset for help on using the changeset viewer.