Title: [273343] branches/safari-611-branch
Revision
273343
Author
alanc...@apple.com
Date
2021-02-23 14:50:47 -0800 (Tue, 23 Feb 2021)

Log Message

Cherry-pick r272067. rdar://problem/74444347

    Support for aria-current state changed notifications.
    https://bugs.webkit.org/show_bug.cgi?id=221074

    Reviewed by Chris Fleizach.

    Source/WebCore:

    Test: accessibility/aria-current-state-changed-notification.html

    Added handling of the AXCurrentStateChanged notification for Mac and iOS
    ports. This notification is fired when the aria-current attribute
    changes.
    Handling of this notification is required to properly update the
    accessibility properties of the target object and convey them to
    assistive technology clients.

    * accessibility/AXLogger.cpp:
    (WebCore::operator<<): Renamed notification anumerand.
    * accessibility/AXObjectCache.cpp:
    (WebCore::AXObjectCache::handleAttributeChange):
    * accessibility/AXObjectCache.h:
    * accessibility/atk/AXObjectCacheAtk.cpp:
    (WebCore::AXObjectCache::postPlatformNotification):
    * accessibility/ios/AXObjectCacheIOS.mm:
    (WebCore::AXObjectCache::postPlatformNotification):
    * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
    (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]):
    (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]):
    (-[WebAccessibilityObjectWrapper accessibilityCurrentState]):
    (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState.
    * accessibility/mac/AXObjectCacheMac.mm:
    (WebCore::AXObjectCache::postPlatformNotification):

    Tools:

    Added AccessibilityUIElement::domIdentifier and currentStateValue used
    in LayoutTests/accessibility/aria-current-state-changed-notification.html.

    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
    (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation.
    (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation.
    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
    * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
    * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
    (WTR::AccessibilityUIElement::domIdentifier const):
    (WTR::AccessibilityUIElement::stringAttributeValue):
    (WTR::AccessibilityUIElement::currentStateValue const):
    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
    (WTR::AccessibilityUIElement::domIdentifier const):
    (WTR::AccessibilityUIElement::currentStateValue const):

    LayoutTests:

    * accessibility/aria-current-state-changed-notification-expected.txt: Added.
    * accessibility/aria-current-state-changed-notification.html: Added.
    * accessibility/aria-current.html:
    Use AccessibilityUIElement::currentStateValue for consistency and to
    match closely how actual clients will invoke this functionality.
    * platform/gtk/TestExpectations:
    * platform/ios-wk1/TestExpectations:
    * platform/ios/TestExpectations:
    * platform/mac-wk1/TestExpectations:
    * platform/win/TestExpectations:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-611-branch/LayoutTests/ChangeLog (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-23 22:50:47 UTC (rev 273343)
@@ -1,5 +1,95 @@
 2021-02-17  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272067. rdar://problem/74444347
+
+    Support for aria-current state changed notifications.
+    https://bugs.webkit.org/show_bug.cgi?id=221074
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Test: accessibility/aria-current-state-changed-notification.html
+    
+    Added handling of the AXCurrentStateChanged notification for Mac and iOS
+    ports. This notification is fired when the aria-current attribute
+    changes.
+    Handling of this notification is required to properly update the
+    accessibility properties of the target object and convey them to
+    assistive technology clients.
+    
+    * accessibility/AXLogger.cpp:
+    (WebCore::operator<<): Renamed notification anumerand.
+    * accessibility/AXObjectCache.cpp:
+    (WebCore::AXObjectCache::handleAttributeChange):
+    * accessibility/AXObjectCache.h:
+    * accessibility/atk/AXObjectCacheAtk.cpp:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/AXObjectCacheIOS.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]):
+    (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]):
+    (-[WebAccessibilityObjectWrapper accessibilityCurrentState]):
+    (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState.
+    * accessibility/mac/AXObjectCacheMac.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    
+    Tools:
+    
+    Added AccessibilityUIElement::domIdentifier and currentStateValue used
+    in LayoutTests/accessibility/aria-current-state-changed-notification.html.
+    
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+    (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation.
+    (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation.
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+    * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+    * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::stringAttributeValue):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    
+    LayoutTests:
+    
+    * accessibility/aria-current-state-changed-notification-expected.txt: Added.
+    * accessibility/aria-current-state-changed-notification.html: Added.
+    * accessibility/aria-current.html:
+    Use AccessibilityUIElement::currentStateValue for consistency and to
+    match closely how actual clients will invoke this functionality.
+    * platform/gtk/TestExpectations:
+    * platform/ios-wk1/TestExpectations:
+    * platform/ios/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    * platform/win/TestExpectations:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-29  Andres Gonzalez  <andresg...@apple.com>
+
+            Support for aria-current state changed notifications.
+            https://bugs.webkit.org/show_bug.cgi?id=221074
+
+            Reviewed by Chris Fleizach.
+
+            * accessibility/aria-current-state-changed-notification-expected.txt: Added.
+            * accessibility/aria-current-state-changed-notification.html: Added.
+            * accessibility/aria-current.html:
+            Use AccessibilityUIElement::currentStateValue for consistency and to
+            match closely how actual clients will invoke this functionality.
+            * platform/gtk/TestExpectations:
+            * platform/ios-wk1/TestExpectations:
+            * platform/ios/TestExpectations:
+            * platform/mac-wk1/TestExpectations:
+            * platform/win/TestExpectations:
+
+2021-02-17  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272755. rdar://problem/74409916
 
     Unreviewed, reverting r270578.

Added: branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification-expected.txt (0 => 273343)


--- branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification-expected.txt	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification-expected.txt	2021-02-23 22:50:47 UTC (rev 273343)
@@ -0,0 +1,19 @@
+This tests that changing the aria-current value results in a CurrentStateChanged notification.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS item2.currentStateValue is 'page'
+PASS item3.currentStateValue is 'false'
+Setting aria-current to false on item2.
+AXCurrentStateChanged notification for item2
+PASS item2.currentStateValue is 'false'
+PASS item3.currentStateValue is 'false'
+Setting aria-current to page on item3.
+AXCurrentStateChanged notification for item3
+PASS item2.currentStateValue is 'false'
+PASS item3.currentStateValue is 'page'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification.html (0 => 273343)


--- branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/accessibility/aria-current-state-changed-notification.html	2021-02-23 22:50:47 UTC (rev 273343)
@@ -0,0 +1,62 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<div id="content" role="list" tabindex="-1">
+  <div id="item1" role="listitem">1</div>
+  <div id="item2" role="listitem" aria-current="page">2</div>
+  <div id="item3" role="listitem">3</div>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that changing the aria-current value results in a CurrentStateChanged notification.");
+    window.jsTestIsAsync = true;
+
+    if (window.testRunner && window.accessibilityController) {
+        var notificationCount = 0;
+
+        accessibilityController.addNotificationListener(function(element, notification) {
+            if (notification != "AXCurrentStateChanged")
+                return;
+
+            ++notificationCount;
+            debug(notification + " notification for " + element.domIdentifier);
+        });
+
+        var item2 = accessibilityController.accessibleElementById("item2");
+        shouldBe("item2.currentStateValue", "'page'");
+        var item3 = accessibilityController.accessibleElementById("item3");
+        shouldBe("item3.currentStateValue", "'false'");
+
+        debug("Setting aria-current to false on item2.");
+        document.getElementById("item2").setAttribute("aria-current", "false");
+        setTimeout(async function() {
+            await waitFor(() => {
+                return notificationCount == 1;
+            });
+            shouldBe("item2.currentStateValue", "'false'");
+            shouldBe("item3.currentStateValue", "'false'");
+
+            debug("Setting aria-current to page on item3.");
+            document.getElementById("item3").setAttribute("aria-current", "page");
+            await waitFor(() => {
+                return notificationCount == 2;
+            });
+            shouldBe("item2.currentStateValue", "'false'");
+            shouldBe("item3.currentStateValue", "'page'");
+
+            document.getElementById("content").style.visibility = "hidden";
+            accessibilityController.removeNotificationListener();
+            finishJSTest();
+        }, 0);
+    }
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-611-branch/LayoutTests/accessibility/aria-current.html (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/accessibility/aria-current.html	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/accessibility/aria-current.html	2021-02-23 22:50:47 UTC (rev 273343)
@@ -34,7 +34,6 @@
 <div id="console"></div>
 
 <script>
-
     description("This tests that aria-current causes the right attribute to be returned.");
 
     function verify(value, expectation, element) {
@@ -50,13 +49,11 @@
             var el = examples[i];
             el.focus();
             var expectation = el.getAttribute("data-expected");
-            var value = accessibilityController.focusedElement.stringAttributeValue('AXARIACurrent');
+            var value = accessibilityController.focusedElement.currentStateValue;
             verify(value, expectation, el);
         }
     }
-
 </script>
-
 <script src=""
 </body>
 </html>

Modified: branches/safari-611-branch/LayoutTests/platform/gtk/TestExpectations (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/platform/gtk/TestExpectations	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/platform/gtk/TestExpectations	2021-02-23 22:50:47 UTC (rev 273343)
@@ -1332,6 +1332,7 @@
 webkit.org/b/181767 fast/hidpi/filters-hue-rotate.html [ Pass ImageOnlyFailure ]
 
 webkit.org/b/182761 accessibility/gtk/aria-busy-changed-notification.html [ Pass Failure ]
+accessibility/aria-current-state-changed-notification.html [ Skip ]
 webkit.org/b/182761 accessibility/gtk/aria-current-changed-notification.html [ Pass Failure ]
 webkit.org/b/182761 accessibility/gtk/aria-disabled-changed-notification.html [ Pass Failure ]
 webkit.org/b/182761 accessibility/gtk/aria-expanded-changed-notification.html [ Pass Failure ]

Modified: branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations	2021-02-23 22:50:47 UTC (rev 273343)
@@ -2159,8 +2159,9 @@
 # Enable "phone number linkifying" test for iOS
 fast/dom/linkify-phone-numbers.html [ Pass ]
 
-# Enable "aria-current" test for iOS
+# Enable "aria-current" tests for iOS.
 webkit.org/b/149297 accessibility/aria-current.html [ Pass ]
+accessibility/aria-current-state-changed-notification.html [ Pass ]
 
 # Enable "aria-table-attributes" test for iOS
 webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ]

Modified: branches/safari-611-branch/LayoutTests/platform/ios-wk1/TestExpectations (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/platform/ios-wk1/TestExpectations	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/platform/ios-wk1/TestExpectations	2021-02-23 22:50:47 UTC (rev 273343)
@@ -126,6 +126,7 @@
 fast/zooming/uiscript-zooming.html [ Failure ]
 
 # Not supported on WK1
+accessibility/aria-current-state-changed-notification.html [ Skip ]
 accessibility/ios-simulator/speak-selection-content.html [ Skip ]
 accessibility/ios-simulator/accessibility-events-setting.html [ Skip ]
 accessibility/ios-simulator/unobscured-content-rect.html [ Skip ]

Modified: branches/safari-611-branch/LayoutTests/platform/mac-wk1/TestExpectations (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/platform/mac-wk1/TestExpectations	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/platform/mac-wk1/TestExpectations	2021-02-23 22:50:47 UTC (rev 273343)
@@ -965,6 +965,8 @@
 
 webkit.org/b/208477 accessibility/mac/text-marker-for-index.html [ Skip ]
 accessibility/mac/isolated-tree-mode-on-off.html [ Skip ]
+accessibility/aria-current-state-changed-notification.html [ Skip ]
+accessibility/aria-current.html [ Skip ]
 
 # <rdar://problem/61066929> [ Stress GC ] flaky JSC::ExceptionScope::assertNoException crash under WebCore::ReadableStreamDefaultController
 webkit.org/b/211923 imported/w3c/web-platform-tests/fetch/api/basic/stream-safe-creation.any.html [ Pass Crash ]

Modified: branches/safari-611-branch/LayoutTests/platform/win/TestExpectations (273342 => 273343)


--- branches/safari-611-branch/LayoutTests/platform/win/TestExpectations	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/LayoutTests/platform/win/TestExpectations	2021-02-23 22:50:47 UTC (rev 273343)
@@ -674,6 +674,7 @@
 
 # TODO aria-current is not supported
 webkit.org/b/149018 accessibility/aria-current.html [ Skip ]
+accessibility/aria-current-state-changed-notification.html [ Skip ]
 
 # TODO ARIA 1.1 table related attributes are not supported
 webkit.org/b/148967 accessibility/aria-table-attributes.html [ Skip ]

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-23 22:50:47 UTC (rev 273343)
@@ -1,5 +1,111 @@
 2021-02-17  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272067. rdar://problem/74444347
+
+    Support for aria-current state changed notifications.
+    https://bugs.webkit.org/show_bug.cgi?id=221074
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Test: accessibility/aria-current-state-changed-notification.html
+    
+    Added handling of the AXCurrentStateChanged notification for Mac and iOS
+    ports. This notification is fired when the aria-current attribute
+    changes.
+    Handling of this notification is required to properly update the
+    accessibility properties of the target object and convey them to
+    assistive technology clients.
+    
+    * accessibility/AXLogger.cpp:
+    (WebCore::operator<<): Renamed notification anumerand.
+    * accessibility/AXObjectCache.cpp:
+    (WebCore::AXObjectCache::handleAttributeChange):
+    * accessibility/AXObjectCache.h:
+    * accessibility/atk/AXObjectCacheAtk.cpp:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/AXObjectCacheIOS.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]):
+    (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]):
+    (-[WebAccessibilityObjectWrapper accessibilityCurrentState]):
+    (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState.
+    * accessibility/mac/AXObjectCacheMac.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    
+    Tools:
+    
+    Added AccessibilityUIElement::domIdentifier and currentStateValue used
+    in LayoutTests/accessibility/aria-current-state-changed-notification.html.
+    
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+    (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation.
+    (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation.
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+    * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+    * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::stringAttributeValue):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    
+    LayoutTests:
+    
+    * accessibility/aria-current-state-changed-notification-expected.txt: Added.
+    * accessibility/aria-current-state-changed-notification.html: Added.
+    * accessibility/aria-current.html:
+    Use AccessibilityUIElement::currentStateValue for consistency and to
+    match closely how actual clients will invoke this functionality.
+    * platform/gtk/TestExpectations:
+    * platform/ios-wk1/TestExpectations:
+    * platform/ios/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    * platform/win/TestExpectations:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-29  Andres Gonzalez  <andresg...@apple.com>
+
+            Support for aria-current state changed notifications.
+            https://bugs.webkit.org/show_bug.cgi?id=221074
+
+            Reviewed by Chris Fleizach.
+
+            Test: accessibility/aria-current-state-changed-notification.html
+
+            Added handling of the AXCurrentStateChanged notification for Mac and iOS
+            ports. This notification is fired when the aria-current attribute
+            changes.
+            Handling of this notification is required to properly update the
+            accessibility properties of the target object and convey them to
+            assistive technology clients.
+
+            * accessibility/AXLogger.cpp:
+            (WebCore::operator<<): Renamed notification anumerand.
+            * accessibility/AXObjectCache.cpp:
+            (WebCore::AXObjectCache::handleAttributeChange):
+            * accessibility/AXObjectCache.h:
+            * accessibility/atk/AXObjectCacheAtk.cpp:
+            (WebCore::AXObjectCache::postPlatformNotification):
+            * accessibility/ios/AXObjectCacheIOS.mm:
+            (WebCore::AXObjectCache::postPlatformNotification):
+            * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
+            * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+            (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]):
+            (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]):
+            (-[WebAccessibilityObjectWrapper accessibilityCurrentState]):
+            (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState.
+            * accessibility/mac/AXObjectCacheMac.mm:
+            (WebCore::AXObjectCache::postPlatformNotification):
+
+2021-02-17  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272755. rdar://problem/74409916
 
     Unreviewed, reverting r270578.

Modified: branches/safari-611-branch/Source/WebCore/accessibility/AXLogger.cpp (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/AXLogger.cpp	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/AXLogger.cpp	2021-02-23 22:50:47 UTC (rev 273343)
@@ -357,8 +357,8 @@
     case AXObjectCache::AXNotification::AXChildrenChanged:
         stream << "AXChildrenChanged";
         break;
-    case AXObjectCache::AXNotification::AXCurrentChanged:
-        stream << "AXCurrentChanged";
+    case AXObjectCache::AXNotification::AXCurrentStateChanged:
+        stream << "AXCurrentStateChanged";
         break;
     case AXObjectCache::AXNotification::AXDisabledStateChanged:
         stream << "AXDisabledStateChanged";

Modified: branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.cpp (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.cpp	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.cpp	2021-02-23 22:50:47 UTC (rev 273343)
@@ -1773,7 +1773,7 @@
     else if (attrName == aria_modalAttr)
         deferModalChange(element);
     else if (attrName == aria_currentAttr)
-        postNotification(element, AXObjectCache::AXCurrentChanged);
+        postNotification(element, AXObjectCache::AXCurrentStateChanged);
     else if (attrName == aria_disabledAttr)
         postNotification(element, AXObjectCache::AXDisabledStateChanged);
     else if (attrName == aria_pressedAttr)

Modified: branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.h (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.h	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/AXObjectCache.h	2021-02-23 22:50:47 UTC (rev 273343)
@@ -278,7 +278,7 @@
         AXAutocorrectionOccured,
         AXCheckedStateChanged,
         AXChildrenChanged,
-        AXCurrentChanged,
+        AXCurrentStateChanged,
         AXDisabledStateChanged,
         AXFocusedUIElementChanged,
         AXFrameLoadComplete,

Modified: branches/safari-611-branch/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp	2021-02-23 22:50:47 UTC (rev 273343)
@@ -262,7 +262,7 @@
         atk_object_notify_state_change(axObject, ATK_STATE_BUSY, coreObject->isBusy());
         break;
 
-    case AXCurrentChanged:
+    case AXCurrentStateChanged:
         atk_object_notify_state_change(axObject, ATK_STATE_ACTIVE, coreObject->currentState() != AccessibilityCurrentState::False);
         break;
 

Modified: branches/safari-611-branch/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm	2021-02-23 22:50:47 UTC (rev 273343)
@@ -49,45 +49,48 @@
 
     NSString *notificationString = nil;
     switch (notification) {
-        case AXActiveDescendantChanged:
-        case AXFocusedUIElementChanged:
-            [obj->wrapper() postFocusChangeNotification];
-            notificationString = @"AXFocusChanged";
-            break;
-        case AXSelectedTextChanged:
-            [obj->wrapper() postSelectedTextChangeNotification];
-            break;
-        case AXLayoutComplete:
-            [obj->wrapper() postLayoutChangeNotification];
-            break;
-        case AXLiveRegionChanged:
-            [obj->wrapper() postLiveRegionChangeNotification];
-            break;
-        case AXLiveRegionCreated:
-            [obj->wrapper() postLiveRegionCreatedNotification];
-            break;
-        case AXChildrenChanged:
-            [obj->wrapper() postChildrenChangedNotification];
-            break;
-        case AXLoadComplete:
-            [obj->wrapper() postLoadCompleteNotification];
-            break;
-        case AXInvalidStatusChanged:
-            [obj->wrapper() postInvalidStatusChangedNotification];
-            break;
-        case AXCheckedStateChanged:
-        case AXValueChanged:
-            [obj->wrapper() postValueChangedNotification];
-            notificationString = @"AXValueChanged";
-            break;
-        case AXExpandedChanged:
-            [obj->wrapper() postExpandedChangedNotification];
-            break;
-        case AXSelectedChildrenChanged:
-        default:
-            break;
+    case AXActiveDescendantChanged:
+    case AXFocusedUIElementChanged:
+        [obj->wrapper() postFocusChangeNotification];
+        notificationString = @"AXFocusChanged";
+        break;
+    case AXSelectedTextChanged:
+        [obj->wrapper() postSelectedTextChangeNotification];
+        break;
+    case AXLayoutComplete:
+        [obj->wrapper() postLayoutChangeNotification];
+        break;
+    case AXLiveRegionChanged:
+        [obj->wrapper() postLiveRegionChangeNotification];
+        break;
+    case AXLiveRegionCreated:
+        [obj->wrapper() postLiveRegionCreatedNotification];
+        break;
+    case AXChildrenChanged:
+        [obj->wrapper() postChildrenChangedNotification];
+        break;
+    case AXLoadComplete:
+        [obj->wrapper() postLoadCompleteNotification];
+        break;
+    case AXInvalidStatusChanged:
+        [obj->wrapper() postInvalidStatusChangedNotification];
+        break;
+    case AXCheckedStateChanged:
+    case AXValueChanged:
+        [obj->wrapper() postValueChangedNotification];
+        notificationString = @"AXValueChanged";
+        break;
+    case AXExpandedChanged:
+        [obj->wrapper() postExpandedChangedNotification];
+        break;
+    case AXCurrentStateChanged:
+        [obj->wrapper() postCurrentStateChangedNotification];
+        notificationString = @"AXCurrentStateChanged";
+        break;
+    default:
+        break;
     }
-    
+
     // Used by DRT to know when notifications are posted.
     if (notificationString)
         [obj->wrapper() accessibilityPostedNotification:notificationString];

Modified: branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.h (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.h	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.h	2021-02-23 22:50:47 UTC (rev 273343)
@@ -66,6 +66,7 @@
 - (void)postScrollStatusChangeNotification;
 - (void)postValueChangedNotification;
 - (void)postExpandedChangedNotification;
+- (void)postCurrentStateChangedNotification;
 
 @end
 

Modified: branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-02-23 22:50:47 UTC (rev 273343)
@@ -335,6 +335,14 @@
 - (uint64_t)_axTextAreaTrait { return (1 << 24); }
 - (uint64_t)_axUpdatesFrequentlyTrait { return (1 << 25); }
 
+- (NSString *)accessibilityDOMIdentifier
+{
+    if (![self _prepareAccessibilityCall])
+        return nil;
+
+    return self.axBackingObject->identifierAttribute();
+}
+
 - (BOOL)accessibilityCanFuzzyHitTest
 {
     if (![self _prepareAccessibilityCall])
@@ -2004,6 +2012,11 @@
     // The UIKit accessibility wrapper will override and post appropriate notification.
 }
 
+- (void)postCurrentStateChangedNotification
+{
+    // The UIKit accessibility wrapper will override and post appropriate notification.
+}
+
 // These will be used by the UIKit wrapper to calculate an appropriate description of scroll status.
 - (CGPoint)_accessibilityScrollPosition
 {
@@ -3031,27 +3044,12 @@
     return self.axBackingObject->invalidStatus();
 }
 
-- (NSString *)accessibilityARIACurrentStatus
+- (NSString *)accessibilityCurrentState
 {
     if (![self _prepareAccessibilityCall])
         return nil;
-    
-    switch (self.axBackingObject->currentState()) {
-    case AccessibilityCurrentState::False:
-        return @"false";
-    case AccessibilityCurrentState::Page:
-        return @"page";
-    case AccessibilityCurrentState::Step:
-        return @"step";
-    case AccessibilityCurrentState::Location:
-        return @"location";
-    case AccessibilityCurrentState::Time:
-        return @"time";
-    case AccessibilityCurrentState::Date:
-        return @"date";
-    case AccessibilityCurrentState::True:
-        return @"true";
-    }
+
+    return self.axBackingObject->currentValue();
 }
 
 - (NSString *)accessibilitySortDirection

Modified: branches/safari-611-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (273342 => 273343)


--- branches/safari-611-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm	2021-02-23 22:50:47 UTC (rev 273343)
@@ -40,6 +40,10 @@
 #import <ApplicationServices/ApplicationServicesPriv.h>
 #endif
 
+#ifndef NSAccessibilityCurrentStateChangedNotification
+#define NSAccessibilityCurrentStateChangedNotification @"AXCurrentStateChanged"
+#endif
+
 #ifndef NSAccessibilityLiveRegionChangedNotification
 #define NSAccessibilityLiveRegionChangedNotification @"AXLiveRegionChanged"
 #endif
@@ -293,109 +297,112 @@
     // Some notifications are unique to Safari and do not have NSAccessibility equivalents.
     NSString *macNotification;
     switch (notification) {
-        case AXActiveDescendantChanged:
-            // An active descendant change for trees means a selected rows change.
-            if (obj->isTree() || obj->isTable())
-                macNotification = NSAccessibilitySelectedRowsChangedNotification;
-            
-            // When a combobox uses active descendant, it means the selected item in its associated
-            // list has changed. In these cases we should use selected children changed, because
-            // we don't want the focus to change away from the combobox where the user is typing.
-            else if (obj->isComboBox() || obj->isList() || obj->isListBox())
-                macNotification = NSAccessibilitySelectedChildrenChangedNotification;
-            else
-                macNotification = NSAccessibilityFocusedUIElementChangedNotification;                
-            break;
-        case AXAutocorrectionOccured:
-            macNotification = @"AXAutocorrectionOccurred";
-            break;
-        case AXFocusedUIElementChanged:
+    case AXActiveDescendantChanged:
+        // An active descendant change for trees means a selected rows change.
+        if (obj->isTree() || obj->isTable())
+            macNotification = NSAccessibilitySelectedRowsChangedNotification;
+
+        // When a combobox uses active descendant, it means the selected item in its associated
+        // list has changed. In these cases we should use selected children changed, because
+        // we don't want the focus to change away from the combobox where the user is typing.
+        else if (obj->isComboBox() || obj->isList() || obj->isListBox())
+            macNotification = NSAccessibilitySelectedChildrenChangedNotification;
+        else
             macNotification = NSAccessibilityFocusedUIElementChangedNotification;
-            break;
-        case AXLayoutComplete:
-            macNotification = @"AXLayoutComplete";
-            break;
-        case AXLoadComplete:
-        case AXFrameLoadComplete:
-            macNotification = @"AXLoadComplete";
-            // Frame loading events are handled by the UIProcess on macOS to improve reliability.
-            // On macOS, before notifications are allowed by AppKit to be sent to clients, you need to have a client (e.g. VoiceOver)
-            // register for that notification. Because these new processes appear before VO has a chance to register, it will often
-            // miss AXLoadComplete notifications. By moving them to the UIProcess, we can eliminate that issue.
-            skipSystemNotification = true;
-            break;
-        case AXInvalidStatusChanged:
-            macNotification = @"AXInvalidStatusChanged";
-            break;
-        case AXSelectedChildrenChanged:
-            if (obj->isTable() && obj->isExposable())
-                macNotification = NSAccessibilitySelectedRowsChangedNotification;
-            else
-                macNotification = NSAccessibilitySelectedChildrenChangedNotification;
-            break;
-        case AXSelectedTextChanged:
-            macNotification = NSAccessibilitySelectedTextChangedNotification;
-            break;
-        case AXCheckedStateChanged:
-        case AXValueChanged:
-            macNotification = NSAccessibilityValueChangedNotification;
-            break;
-        case AXLiveRegionCreated:
-            macNotification = NSAccessibilityLiveRegionCreatedNotification;
-            break;
-        case AXLiveRegionChanged:
-            macNotification = NSAccessibilityLiveRegionChangedNotification;
-            break;
-        case AXRowCountChanged:
-            macNotification = NSAccessibilityRowCountChangedNotification;
-            break;
-        case AXRowExpanded:
-            macNotification = NSAccessibilityRowExpandedNotification;
-            break;
-        case AXRowCollapsed:
-            macNotification = NSAccessibilityRowCollapsedNotification;
-            break;
-        case AXElementBusyChanged:
-            macNotification = @"AXElementBusyChanged";
-            break;
-        case AXExpandedChanged:
-            macNotification = @"AXExpandedChanged";
-            break;
-        case AXMenuClosed:
-            macNotification = (id)kAXMenuClosedNotification;
-            break;
-        case AXMenuListItemSelected:
-        case AXMenuListValueChanged:
-            macNotification = (id)kAXMenuItemSelectedNotification;
-            break;
-        case AXPressDidSucceed:
-            macNotification = @"AXPressDidSucceed";
-            break;
-        case AXPressDidFail:
-            macNotification = @"AXPressDidFail";
-            break;
-        case AXMenuOpened:
-            macNotification = (id)kAXMenuOpenedNotification;
-            break;
-        case AXDraggingStarted:
-            macNotification = (id)kAXDraggingSourceDragBeganNotification;
-            break;
-        case AXDraggingEnded:
-            macNotification = (id)kAXDraggingSourceDragEndedNotification;
-            break;
-        case AXDraggingEnteredDropZone:
-            macNotification = (id)kAXDraggingDestinationDropAllowedNotification;
-            break;
-        case AXDraggingDropped:
-            macNotification = (id)kAXDraggingDestinationDragAcceptedNotification;
-            break;
-        case AXDraggingExitedDropZone:
-            macNotification = (id)kAXDraggingDestinationDragNotAcceptedNotification;
-            break;
-        default:
-            return;
+        break;
+    case AXAutocorrectionOccured:
+        macNotification = @"AXAutocorrectionOccurred";
+        break;
+    case AXCurrentStateChanged:
+        macNotification = NSAccessibilityCurrentStateChangedNotification;
+        break;
+    case AXFocusedUIElementChanged:
+        macNotification = NSAccessibilityFocusedUIElementChangedNotification;
+        break;
+    case AXLayoutComplete:
+        macNotification = @"AXLayoutComplete";
+        break;
+    case AXLoadComplete:
+    case AXFrameLoadComplete:
+        macNotification = @"AXLoadComplete";
+        // Frame loading events are handled by the UIProcess on macOS to improve reliability.
+        // On macOS, before notifications are allowed by AppKit to be sent to clients, you need to have a client (e.g. VoiceOver)
+        // register for that notification. Because these new processes appear before VO has a chance to register, it will often
+        // miss AXLoadComplete notifications. By moving them to the UIProcess, we can eliminate that issue.
+        skipSystemNotification = true;
+        break;
+    case AXInvalidStatusChanged:
+        macNotification = @"AXInvalidStatusChanged";
+        break;
+    case AXSelectedChildrenChanged:
+        if (obj->isTable() && obj->isExposable())
+            macNotification = NSAccessibilitySelectedRowsChangedNotification;
+        else
+            macNotification = NSAccessibilitySelectedChildrenChangedNotification;
+        break;
+    case AXSelectedTextChanged:
+        macNotification = NSAccessibilitySelectedTextChangedNotification;
+        break;
+    case AXCheckedStateChanged:
+    case AXValueChanged:
+        macNotification = NSAccessibilityValueChangedNotification;
+        break;
+    case AXLiveRegionCreated:
+        macNotification = NSAccessibilityLiveRegionCreatedNotification;
+        break;
+    case AXLiveRegionChanged:
+        macNotification = NSAccessibilityLiveRegionChangedNotification;
+        break;
+    case AXRowCountChanged:
+        macNotification = NSAccessibilityRowCountChangedNotification;
+        break;
+    case AXRowExpanded:
+        macNotification = NSAccessibilityRowExpandedNotification;
+        break;
+    case AXRowCollapsed:
+        macNotification = NSAccessibilityRowCollapsedNotification;
+        break;
+    case AXElementBusyChanged:
+        macNotification = @"AXElementBusyChanged";
+        break;
+    case AXExpandedChanged:
+        macNotification = @"AXExpandedChanged";
+        break;
+    case AXMenuClosed:
+        macNotification = (id)kAXMenuClosedNotification;
+        break;
+    case AXMenuListItemSelected:
+    case AXMenuListValueChanged:
+        macNotification = (id)kAXMenuItemSelectedNotification;
+        break;
+    case AXPressDidSucceed:
+        macNotification = @"AXPressDidSucceed";
+        break;
+    case AXPressDidFail:
+        macNotification = @"AXPressDidFail";
+        break;
+    case AXMenuOpened:
+        macNotification = (id)kAXMenuOpenedNotification;
+        break;
+    case AXDraggingStarted:
+        macNotification = (id)kAXDraggingSourceDragBeganNotification;
+        break;
+    case AXDraggingEnded:
+        macNotification = (id)kAXDraggingSourceDragEndedNotification;
+        break;
+    case AXDraggingEnteredDropZone:
+        macNotification = (id)kAXDraggingDestinationDropAllowedNotification;
+        break;
+    case AXDraggingDropped:
+        macNotification = (id)kAXDraggingDestinationDragAcceptedNotification;
+        break;
+    case AXDraggingExitedDropZone:
+        macNotification = (id)kAXDraggingDestinationDragNotAcceptedNotification;
+        break;
+    default:
+        return;
     }
-    
+
     // NSAccessibilityPostNotification will call this method, (but not when running DRT), so ASSERT here to make sure it does not crash.
     // https://bugs.webkit.org/show_bug.cgi?id=46662
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN

Modified: branches/safari-611-branch/Tools/ChangeLog (273342 => 273343)


--- branches/safari-611-branch/Tools/ChangeLog	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/ChangeLog	2021-02-23 22:50:47 UTC (rev 273343)
@@ -1,5 +1,100 @@
 2021-02-17  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272067. rdar://problem/74444347
+
+    Support for aria-current state changed notifications.
+    https://bugs.webkit.org/show_bug.cgi?id=221074
+    
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    Test: accessibility/aria-current-state-changed-notification.html
+    
+    Added handling of the AXCurrentStateChanged notification for Mac and iOS
+    ports. This notification is fired when the aria-current attribute
+    changes.
+    Handling of this notification is required to properly update the
+    accessibility properties of the target object and convey them to
+    assistive technology clients.
+    
+    * accessibility/AXLogger.cpp:
+    (WebCore::operator<<): Renamed notification anumerand.
+    * accessibility/AXObjectCache.cpp:
+    (WebCore::AXObjectCache::handleAttributeChange):
+    * accessibility/AXObjectCache.h:
+    * accessibility/atk/AXObjectCacheAtk.cpp:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/AXObjectCacheIOS.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]):
+    (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]):
+    (-[WebAccessibilityObjectWrapper accessibilityCurrentState]):
+    (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState.
+    * accessibility/mac/AXObjectCacheMac.mm:
+    (WebCore::AXObjectCache::postPlatformNotification):
+    
+    Tools:
+    
+    Added AccessibilityUIElement::domIdentifier and currentStateValue used
+    in LayoutTests/accessibility/aria-current-state-changed-notification.html.
+    
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+    (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation.
+    (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation.
+    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+    * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+    * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::stringAttributeValue):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+    (WTR::AccessibilityUIElement::domIdentifier const):
+    (WTR::AccessibilityUIElement::currentStateValue const):
+    
+    LayoutTests:
+    
+    * accessibility/aria-current-state-changed-notification-expected.txt: Added.
+    * accessibility/aria-current-state-changed-notification.html: Added.
+    * accessibility/aria-current.html:
+    Use AccessibilityUIElement::currentStateValue for consistency and to
+    match closely how actual clients will invoke this functionality.
+    * platform/gtk/TestExpectations:
+    * platform/ios-wk1/TestExpectations:
+    * platform/ios/TestExpectations:
+    * platform/mac-wk1/TestExpectations:
+    * platform/win/TestExpectations:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-29  Andres Gonzalez  <andresg...@apple.com>
+
+            Support for aria-current state changed notifications.
+            https://bugs.webkit.org/show_bug.cgi?id=221074
+
+            Reviewed by Chris Fleizach.
+
+            Added AccessibilityUIElement::domIdentifier and currentStateValue used
+            in LayoutTests/accessibility/aria-current-state-changed-notification.html.
+
+            * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+            (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation.
+            (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation.
+            * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+            * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+            * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+            (WTR::AccessibilityUIElement::domIdentifier const):
+            (WTR::AccessibilityUIElement::stringAttributeValue):
+            (WTR::AccessibilityUIElement::currentStateValue const):
+            * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+            (WTR::AccessibilityUIElement::domIdentifier const):
+            (WTR::AccessibilityUIElement::currentStateValue const):
+
+2021-02-17  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272504. rdar://problem/74409474
 
     NetworkRTCSocketCocoa extractDataMessages should not read too much data

Modified: branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (273342 => 273343)


--- branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp	2021-02-23 22:50:47 UTC (rev 273343)
@@ -111,6 +111,8 @@
 #endif
 
 #if !PLATFORM(COCOA) || !HAVE(ACCESSIBILITY)
+JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const { return nullptr; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::currentStateValue() const { return nullptr; }
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::leftWordTextMarkerRangeForTextMarker(AccessibilityTextMarker*) { return nullptr; }
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker(AccessibilityTextMarker*) { return nullptr; }
 RefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousWordStartTextMarkerForTextMarker(AccessibilityTextMarker*) { return nullptr; }

Modified: branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (273342 => 273343)


--- branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h	2021-02-23 22:50:47 UTC (rev 273343)
@@ -68,8 +68,7 @@
 
 #if PLATFORM(COCOA)
     id platformUIElement() { return m_element.get(); }
-#endif
-#if !PLATFORM(COCOA)
+#else
     PlatformUIElement platformUIElement() { return m_element; }
 #endif
 
@@ -78,7 +77,8 @@
     static JSObjectRef makeJSAccessibilityUIElement(JSContextRef, const AccessibilityUIElement&);
 
     bool isEqual(AccessibilityUIElement* otherElement);
-    
+    JSRetainPtr<JSStringRef> domIdentifier() const;
+
     RefPtr<AccessibilityUIElement> elementAtPoint(int x, int y);
     RefPtr<AccessibilityUIElement> childAtIndex(unsigned);
     unsigned indexOfChild(AccessibilityUIElement*);
@@ -173,6 +173,7 @@
     bool isValid() const;
     bool isExpanded() const;
     bool isChecked() const;
+    JSRetainPtr<JSStringRef> currentStateValue() const;
     bool isIndeterminate() const;
     bool isVisible() const;
     bool isOnScreen() const;

Modified: branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (273342 => 273343)


--- branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl	2021-02-23 22:50:47 UTC (rev 273343)
@@ -27,6 +27,7 @@
     Conditional=ACCESSIBILITY,
 ] interface AccessibilityUIElement {
     boolean isEqual(AccessibilityUIElement otherElement);
+    readonly attribute DOMString domIdentifier;
     readonly attribute boolean isIsolatedObject;
 
     // Document information
@@ -91,6 +92,7 @@
     readonly attribute boolean isMultiSelectable;
     readonly attribute boolean isExpanded;
     readonly attribute boolean isChecked;
+    readonly attribute DOMString currentStateValue;
     readonly attribute boolean isIndeterminate;
     readonly attribute boolean isVisible;
     readonly attribute boolean isCollapsed;

Modified: branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (273342 => 273343)


--- branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-02-23 22:50:47 UTC (rev 273343)
@@ -70,7 +70,7 @@
 - (UIAccessibilityTraits)_axSelectedTrait;
 - (UIAccessibilityTraits)_axTextAreaTrait;
 - (UIAccessibilityTraits)_axSearchFieldTrait;
-- (NSString *)accessibilityARIACurrentStatus;
+- (NSString *)accessibilityCurrentState;
 - (NSUInteger)accessibilityRowCount;
 - (NSUInteger)accessibilityColumnCount;
 - (NSUInteger)accessibilityARIARowCount;
@@ -117,6 +117,7 @@
 @end
 
 @interface NSObject (WebAccessibilityObjectWrapperPrivate)
+- (NSString *)accessibilityDOMIdentifier;
 - (CGPathRef)_accessibilityPath;
 @end
 
@@ -175,6 +176,14 @@
     return platformUIElement() == otherElement->platformUIElement();
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const
+{
+    id value = [m_element accessibilityDOMIdentifier];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    return nullptr;
+}
+
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::headerElementAtIndex(unsigned index)
 {
     NSArray *headers = [m_element accessibilityHeaderElements];
@@ -363,7 +372,7 @@
         return [[m_element accessibilityColorStringValue] createJSStringRef];
 
     if (JSStringIsEqualToUTF8CString(attribute, "AXARIACurrent"))
-        return [[m_element accessibilityARIACurrentStatus] createJSStringRef];
+        return [[m_element accessibilityCurrentState] createJSStringRef];
 
     if (JSStringIsEqualToUTF8CString(attribute, "AXExpandedTextValue"))
         return [[m_element accessibilityExpandedTextValue] createJSStringRef];
@@ -610,6 +619,14 @@
     return false;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::currentStateValue() const
+{
+    id value = [m_element accessibilityCurrentState];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    return nullptr;
+}
+
 int AccessibilityUIElement::hierarchicalLevel() const
 {
     return 0;

Modified: branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (273342 => 273343)


--- branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2021-02-23 22:50:39 UTC (rev 273342)
+++ branches/safari-611-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm	2021-02-23 22:50:47 UTC (rev 273343)
@@ -42,6 +42,8 @@
 #import <wtf/Vector.h>
 #import <wtf/cocoa/VectorCocoa.h>
 
+#define NSAccessibilityDOMIdentifierAttribute @"AXDOMIdentifier"
+
 #ifndef NSAccessibilityOwnsAttribute
 #define NSAccessibilityOwnsAttribute @"AXOwns"
 #endif
@@ -58,6 +60,10 @@
 #define NSAccessibilityPathAttribute @"AXPath"
 #endif
 
+#ifndef NSAccessibilityARIACurrentAttribute
+#define NSAccessibilityARIACurrentAttribute @"AXARIACurrent"
+#endif
+
 // Text
 #ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
 #define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @"AXEndTextMarkerForBounds"
@@ -327,6 +333,14 @@
     return parameters;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::domIdentifier() const
+{
+    id value = attributeValue(m_element.get(), NSAccessibilityDOMIdentifierAttribute);
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    return nullptr;
+}
+
 void AccessibilityUIElement::getLinkedUIElements(Vector<RefPtr<AccessibilityUIElement>>& elementVector)
 {
     elementVector = makeVector<RefPtr<AccessibilityUIElement>>(attributeValue(m_element.get(), NSAccessibilityLinkedUIElementsAttribute));
@@ -976,6 +990,14 @@
     return intValue() == 1;
 }
 
+JSRetainPtr<JSStringRef> AccessibilityUIElement::currentStateValue() const
+{
+    id value = attributeValue(m_element.get(), NSAccessibilityARIACurrentAttribute);
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    return nullptr;
+}
+
 int AccessibilityUIElement::hierarchicalLevel() const
 {
     BEGIN_AX_OBJC_EXCEPTIONS
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to