Title: [290724] trunk
Revision
290724
Author
[email protected]
Date
2022-03-02 00:50:52 -0800 (Wed, 02 Mar 2022)

Log Message

REGRESSION(r216096): [GTK] Test accessibility/gtk/menu-list-unfocused-notifications.html is failing since r216096
https://bugs.webkit.org/show_bug.cgi?id=171598

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Enable accessibility when a WTR observer is added.

* accessibility/atspi/AccessibilityAtspi.cpp:
(WebCore::AccessibilityAtspi::addNotificationObserver):

LayoutTests:

Since r216096 the notification for menu list changes is deffered, so we need to wait one run loop cycle to get
the notifications. Also update the test to ignore notifications that are not interesting like AXLoadComplete and
AXElementBusyChanged, and update expectations for the new behavior with ATSPI where the notification is emitted
on the menu and not the combo.

* accessibility/gtk/menu-list-unfocused-notifications-expected.txt:
* accessibility/gtk/menu-list-unfocused-notifications.html:
* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290723 => 290724)


--- trunk/LayoutTests/ChangeLog	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/LayoutTests/ChangeLog	2022-03-02 08:50:52 UTC (rev 290724)
@@ -1,5 +1,21 @@
 2022-03-02  Carlos Garcia Campos  <[email protected]>
 
+        REGRESSION(r216096): [GTK] Test accessibility/gtk/menu-list-unfocused-notifications.html is failing since r216096
+        https://bugs.webkit.org/show_bug.cgi?id=171598
+
+        Reviewed by Adrian Perez de Castro.
+
+        Since r216096 the notification for menu list changes is deffered, so we need to wait one run loop cycle to get
+        the notifications. Also update the test to ignore notifications that are not interesting like AXLoadComplete and
+        AXElementBusyChanged, and update expectations for the new behavior with ATSPI where the notification is emitted
+        on the menu and not the combo.
+
+        * accessibility/gtk/menu-list-unfocused-notifications-expected.txt:
+        * accessibility/gtk/menu-list-unfocused-notifications.html:
+        * platform/gtk/TestExpectations:
+
+2022-03-02  Carlos Garcia Campos  <[email protected]>
+
         [ATSPI] Test accessibility/select-element-at-index.html is failing
         https://bugs.webkit.org/show_bug.cgi?id=237315
 

Modified: trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications-expected.txt (290723 => 290724)


--- trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications-expected.txt	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications-expected.txt	2022-03-02 08:50:52 UTC (rev 290724)
@@ -9,15 +9,15 @@
 Focused element is: AXRole: AXButton
 
 Changing selected item in non-focused combobox.
-AXSelectedChildrenChanged: AXRole: AXComboBox
+AXMenuItemSelected: AXRole: AXMenu
+Selected item is: AXTitle: four
 Focused element is: AXRole: AXButton
 
 Changing selected item in non-focused combobox.
-AXSelectedChildrenChanged: AXRole: AXComboBox
+AXMenuItemSelected: AXRole: AXMenu
+Selected item is: AXTitle: three
 Focused element is: AXRole: AXButton
 
-AXLoadComplete: AXRole: AXWebArea
-AXElementBusyChanged: AXRole: AXWebArea
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications.html (290723 => 290724)


--- trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications.html	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/LayoutTests/accessibility/gtk/menu-list-unfocused-notifications.html	2022-03-02 08:50:52 UTC (rev 290724)
@@ -19,28 +19,39 @@
 
 if (window.testRunner && window.accessibilityController) {
     accessibilityController.addNotificationListener(function(element, notification) {
-        debug(notification + ": " + element.role);
+        if (notification == "AXFocusedUIElementChanged" || notification == "AXMenuItemSelected")
+            debug(notification + ": " + element.role);
     });
 
-    debug("Changing focus to button.");
-    document.getElementById('button').focus();
-    debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
+    window.setTimeout(function() {
+        debug("Changing focus to button.");
+        document.getElementById("button").focus();
+        debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
 
-    // Programmatic selection changes in the non-focused combo box do not result
-    // in the button losing focus. Therefore the combo box should not claim focus.
-    debug("Changing selected item in non-focused combobox.");
-    document.getElementById('combobox').selectedIndex = 3;
-    debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
+        let axMenu = accessibilityController.accessibleElementById("combobox").childAtIndex(0);
 
-    // Programmatic selection changes in the non-focused combo box do not result
-    // in the button losing focus. Therefore the combo box should not claim focus.
-    debug("Changing selected item in non-focused combobox.");
-    document.getElementById('combobox').selectedIndex = 2;
-    debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
+        // Programmatic selection changes in the non-focused combo box do not result
+        // in the button losing focus. Therefore the combo box should not claim focus.
+        debug("Changing selected item in non-focused combobox.");
+        document.getElementById("combobox").selectedIndex = 3;
+        window.setTimeout(function() {
+            debug("Selected item is: " + axMenu.selectedChildAtIndex(0).title);
+            debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
 
-    window.setTimeout(function() {
-        accessibilityController.removeNotificationListener();
-        finishJSTest();
+            // Programmatic selection changes in the non-focused combo box do not result
+            // in the button losing focus. Therefore the combo box should not claim focus.
+            debug("Changing selected item in non-focused combobox.");
+            document.getElementById('combobox').selectedIndex = 2;
+            window.setTimeout(function() {
+                debug("Selected item is: " + axMenu.selectedChildAtIndex(0).title);
+                debug("Focused element is: " + accessibilityController.focusedElement.role + "\n");
+
+                window.setTimeout(function() {
+                    accessibilityController.removeNotificationListener();
+                    finishJSTest();
+                }, 0);
+            }, 0);
+        }, 0);
     }, 0);
 }
 </script>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (290723 => 290724)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-02 08:50:52 UTC (rev 290724)
@@ -1600,8 +1600,6 @@
 
 webkit.org/b/168552 fast/text/hyphenate-locale.html [ Failure ]
 
-webkit.org/b/171598 accessibility/gtk/menu-list-unfocused-notifications.html [ Failure ]
-
 webkit.org/b/172270 fast/text/font-interstitial-invisible-width-while-loading.html [ Failure ]
 
 webkit.org/b/172271 fast/text/softbank-emoji.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (290723 => 290724)


--- trunk/Source/WebCore/ChangeLog	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/Source/WebCore/ChangeLog	2022-03-02 08:50:52 UTC (rev 290724)
@@ -1,3 +1,15 @@
+2022-03-02  Carlos Garcia Campos  <[email protected]>
+
+        REGRESSION(r216096): [GTK] Test accessibility/gtk/menu-list-unfocused-notifications.html is failing since r216096
+        https://bugs.webkit.org/show_bug.cgi?id=171598
+
+        Reviewed by Adrian Perez de Castro.
+
+        Enable accessibility when a WTR observer is added.
+
+        * accessibility/atspi/AccessibilityAtspi.cpp:
+        (WebCore::AccessibilityAtspi::addNotificationObserver):
+
 2022-03-01  Youenn Fablet  <[email protected]>
 
         Remove RemoteVideoSample support from ImageTransferSessionVT

Modified: trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp (290723 => 290724)


--- trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp	2022-03-02 08:49:29 UTC (rev 290723)
+++ trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp	2022-03-02 08:50:52 UTC (rev 290724)
@@ -826,6 +826,7 @@
 #if ENABLE(DEVELOPER_MODE)
 void AccessibilityAtspi::addNotificationObserver(void* context, NotificationObserver&& observer)
 {
+    AXObjectCache::enableAccessibility();
     m_notificationObservers.add(context, WTFMove(observer));
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to