Title: [287392] trunk/Tools
Revision
287392
Author
carlo...@webkit.org
Date
2021-12-23 00:57:46 -0800 (Thu, 23 Dec 2021)

Log Message

[GTK][a11y] WTR: handle heading level as special case in intValue with ATSPI
https://bugs.webkit.org/show_bug.cgi?id=234603

Reviewed by Adrian Perez de Castro.

Tests expect intValue to return the heading level.

* WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
(WTR::AccessibilityUIElement::intValue const):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (287391 => 287392)


--- trunk/Tools/ChangeLog	2021-12-23 08:57:03 UTC (rev 287391)
+++ trunk/Tools/ChangeLog	2021-12-23 08:57:46 UTC (rev 287392)
@@ -1,5 +1,17 @@
 2021-12-23  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        [GTK][a11y] WTR: handle heading level as special case in intValue with ATSPI
+        https://bugs.webkit.org/show_bug.cgi?id=234603
+
+        Reviewed by Adrian Perez de Castro.
+
+        Tests expect intValue to return the heading level.
+
+        * WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
+        (WTR::AccessibilityUIElement::intValue const):
+
+2021-12-23  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK][a11y] WTR: handle missing cases in isAttributeSettable with ATSPI
         https://bugs.webkit.org/show_bug.cgi?id=234601
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp (287391 => 287392)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp	2021-12-23 08:57:03 UTC (rev 287391)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp	2021-12-23 08:57:46 UTC (rev 287392)
@@ -867,15 +867,25 @@
 
 double AccessibilityUIElement::intValue() const
 {
-    if (!m_element->interfaces().contains(WebCore::AccessibilityObjectAtspi::Interface::Value))
-        return 0;
+    if (m_element->interfaces().contains(WebCore::AccessibilityObjectAtspi::Interface::Value)) {
+        double currentValue;
+        s_controller->executeOnAXThreadAndWait([this, &currentValue] {
+            m_element->updateBackingStore();
+            currentValue = m_element->currentValue();
+        });
+        return currentValue;
+    }
 
-    double currentValue;
-    s_controller->executeOnAXThreadAndWait([this, &currentValue] {
+    // Consider headings as an special case when returning the int value.
+    unsigned elementRole;
+    s_controller->executeOnAXThreadAndWait([this, &elementRole] {
         m_element->updateBackingStore();
-        currentValue = m_element->currentValue();
+        elementRole = m_element->role();
     });
-    return currentValue;
+    if (elementRole == WebCore::Atspi::Role::Heading)
+        return m_element->attributes().get("level").toDouble();
+
+    return 0;
 }
 
 double AccessibilityUIElement::minValue()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to