[ATK] Add support for aria-details and aria-errormessage
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jun 2017 16:45:34 +0000 (16:45 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Jun 2017 16:45:34 +0000 (16:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172588

Reviewed by Chris Fleizach.

Source/WebCore:

Add methods to retrieve elements referenced by or referencing the new
aria-details and aria-errormessage attributes. Include aria-details and
aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
elements with these attributes will be included in the accessibility tree.

New test cases added to accessibility/gtk/relation-types.html.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):
(WebCore::AccessibilityObject::ariaDetailsElements):
(WebCore::AccessibilityObject::ariaDetailsReferencingElements):
(WebCore::AccessibilityObject::ariaErrorMessageElements):
(WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):
* html/HTMLAttributeNames.in:

Tools:

Add additional methods to test ARIA properties which are exposed via
AtkRelation. Also bump minimum versions of at-spi2-core and at-spi2-atk
to versions which support the details and error-message relation types.

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
(WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
(WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
* gtk/jhbuild.modules:

LayoutTests:

Add new test cases to relation-types.html.

* accessibility/gtk/relation-types-expected.txt:
* accessibility/gtk/relation-types.html:

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/relation-types-expected.txt
LayoutTests/accessibility/gtk/relation-types.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Source/WebCore/html/HTMLAttributeNames.in
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/gtk/install-dependencies
Tools/gtk/jhbuild.modules

index 7ca0912..790694a 100644 (file)
@@ -1,3 +1,15 @@
+2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        [ATK] Add support for aria-details and aria-errormessage
+        https://bugs.webkit.org/show_bug.cgi?id=172588
+
+        Reviewed by Chris Fleizach.
+
+        Add new test cases to relation-types.html.
+
+        * accessibility/gtk/relation-types-expected.txt:
+        * accessibility/gtk/relation-types.html:
+
 2017-06-26  Claudio Saavedra  <csaavedra@igalia.com>
 
         [WPE][GCrypt] Unreviewed gardening
index 907eda9..56e42c2 100644 (file)
@@ -34,6 +34,12 @@ flowTo.ariaFlowToReferencingElementAtIndex(0): AXGroup: 'label 1 label 2'
 
 axElement.ariaFlowToElementAtIndex(1): AXGroup: 'next group (2 of 2)'
 flowTo.ariaFlowToReferencingElementAtIndex(0): AXGroup: 'label 1 label 2'
+
+axElement.ariaDetailsElementAtIndex(0): AXSection: 'Detailed descriptive information.'
+details.ariaDetailsReferencingElementAtIndex(0): AXGroup: 'label 1 label 2'
+
+axElement.ariaErrorMessageElementAtIndex(0): AXSection: 'Information about the error.'
+error.ariaErrorMessageReferencingElementAtIndex(0): AXGroup: 'label 1 label 2'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 8e27a9c..d6c60dd 100644 (file)
@@ -12,6 +12,8 @@
        aria-owns="owned1                owned2"
        aria-controls="controlled1
                       controlled2"
+       aria-details="details"
+       aria-errormessage="error"
        aria-labelledby="label1 label2"
        aria-describedby="description1 description2">
   </div>
@@ -25,6 +27,8 @@
   <div id="description2">description 2</div>
   <div tabindex="0" id="flowto1" role="group" aria-label="next group (1 of 2)" aria-describedby="description1"></div>
   <div tabindex="0" id="flowto2" role="group" aria-label="next group (2 of 2)" aria-describedby="description2"></div>
+  <div id="details">Detailed descriptive information.</div>
+  <div id="error">Information about the error.</div>
 </div>
 <p id="description"></p>
 <div id="console"></div>
         debug("\naxElement.ariaFlowToElementAtIndex(1): " + info(flowTo));
         debug("flowTo.ariaFlowToReferencingElementAtIndex(0): " + info(flowFrom));
 
+        var details = axElement.ariaDetailsElementAtIndex(0);
+        var detailsFor = details.ariaDetailsReferencingElementAtIndex(0);
+        debug("\naxElement.ariaDetailsElementAtIndex(0): " + info(details));
+        debug("details.ariaDetailsReferencingElementAtIndex(0): " + info(detailsFor));
+
+        var error = axElement.ariaErrorMessageElementAtIndex(0);
+        var errorFor = error.ariaErrorMessageReferencingElementAtIndex(0);
+        debug("\naxElement.ariaErrorMessageElementAtIndex(0): " + info(error));
+        debug("error.ariaErrorMessageReferencingElementAtIndex(0): " + info(errorFor));
+
         document.getElementById("content").style.visibility = "hidden";
     }
 </script>
index a45f889..6cf700a 100644 (file)
@@ -1,3 +1,28 @@
+2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        [ATK] Add support for aria-details and aria-errormessage
+        https://bugs.webkit.org/show_bug.cgi?id=172588
+
+        Reviewed by Chris Fleizach.
+
+        Add methods to retrieve elements referenced by or referencing the new
+        aria-details and aria-errormessage attributes. Include aria-details and
+        aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
+        elements with these attributes will be included in the accessibility tree.
+
+        New test cases added to accessibility/gtk/relation-types.html.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::supportsARIAAttributes):
+        (WebCore::AccessibilityObject::ariaDetailsElements):
+        (WebCore::AccessibilityObject::ariaDetailsReferencingElements):
+        (WebCore::AccessibilityObject::ariaErrorMessageElements):
+        (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (setAtkRelationSetFromCoreObject):
+        * html/HTMLAttributeNames.in:
+
 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
 
         Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
index d4a51b9..91438af 100644 (file)
@@ -2455,7 +2455,9 @@ bool AccessibilityObject::supportsARIAAttributes() const
         || hasAttribute(aria_controlsAttr)
         || hasAttribute(aria_currentAttr)
         || hasAttribute(aria_describedbyAttr)
+        || hasAttribute(aria_detailsAttr)
         || hasAttribute(aria_disabledAttr)
+        || hasAttribute(aria_errormessageAttr)
         || hasAttribute(aria_flowtoAttr)
         || hasAttribute(aria_haspopupAttr)
         || hasAttribute(aria_invalidAttr)
@@ -3327,6 +3329,26 @@ void AccessibilityObject::ariaDescribedByReferencingElements(AccessibilityChildr
     ariaElementsReferencedByAttribute(describers, aria_describedbyAttr);
 }
 
+void AccessibilityObject::ariaDetailsElements(AccessibilityChildrenVector& ariaDetails) const
+{
+    ariaElementsFromAttribute(ariaDetails, aria_detailsAttr);
+}
+
+void AccessibilityObject::ariaDetailsReferencingElements(AccessibilityChildrenVector& detailsFor) const
+{
+    ariaElementsReferencedByAttribute(detailsFor, aria_detailsAttr);
+}
+
+void AccessibilityObject::ariaErrorMessageElements(AccessibilityChildrenVector& ariaErrorMessage) const
+{
+    ariaElementsFromAttribute(ariaErrorMessage, aria_errormessageAttr);
+}
+
+void AccessibilityObject::ariaErrorMessageReferencingElements(AccessibilityChildrenVector& errorMessageFor) const
+{
+    ariaElementsReferencedByAttribute(errorMessageFor, aria_errormessageAttr);
+}
+
 void AccessibilityObject::ariaFlowToElements(AccessibilityChildrenVector& flowTo) const
 {
     ariaElementsFromAttribute(flowTo, aria_flowtoAttr);
index 1e77cd3..cc7f501 100644 (file)
@@ -667,6 +667,10 @@ public:
     void ariaControlsReferencingElements(AccessibilityChildrenVector&) const;
     void ariaDescribedByElements(AccessibilityChildrenVector&) const;
     void ariaDescribedByReferencingElements(AccessibilityChildrenVector&) const;
+    void ariaDetailsElements(AccessibilityChildrenVector&) const;
+    void ariaDetailsReferencingElements(AccessibilityChildrenVector&) const;
+    void ariaErrorMessageElements(AccessibilityChildrenVector&) const;
+    void ariaErrorMessageReferencingElements(AccessibilityChildrenVector&) const;
     void ariaFlowToElements(AccessibilityChildrenVector&) const;
     void ariaFlowToReferencingElements(AccessibilityChildrenVector&) const;
     void ariaLabelledByElements(AccessibilityChildrenVector&) const;
index 141bdda..80be3f7 100644 (file)
@@ -261,6 +261,36 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk
     coreObject->ariaOwnsReferencingElements(owners);
     for (const auto& accessibilityObject : owners)
         atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_CHILD_OF, accessibilityObject->wrapper());
+
+#if ATK_CHECK_VERSION(2, 25, 2)
+    // Elements with aria-details should have the details relation as per the ARIA AAM spec.
+    removeAtkRelationByType(relationSet, ATK_RELATION_DETAILS);
+    AccessibilityObject::AccessibilityChildrenVector ariaDetails;
+    coreObject->ariaDetailsElements(ariaDetails);
+    for (const auto& accessibilityObject : ariaDetails)
+        atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS, accessibilityObject->wrapper());
+
+    // Elements referenced by aria-details should have the details-for relation as per the ARIA AAM spec.
+    removeAtkRelationByType(relationSet, ATK_RELATION_DETAILS_FOR);
+    AccessibilityObject::AccessibilityChildrenVector details;
+    coreObject->ariaDetailsReferencingElements(details);
+    for (const auto& accessibilityObject : details)
+        atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS_FOR, accessibilityObject->wrapper());
+
+    // Elements with aria-errormessage should have the error-message relation as per the ARIA AAM spec.
+    removeAtkRelationByType(relationSet, ATK_RELATION_ERROR_MESSAGE);
+    AccessibilityObject::AccessibilityChildrenVector ariaErrorMessage;
+    coreObject->ariaErrorMessageElements(ariaErrorMessage);
+    for (const auto& accessibilityObject : ariaErrorMessage)
+        atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_MESSAGE, accessibilityObject->wrapper());
+
+    // Elements referenced by aria-errormessage should have the error-for relation as per the ARIA AAM spec.
+    removeAtkRelationByType(relationSet, ATK_RELATION_ERROR_FOR);
+    AccessibilityObject::AccessibilityChildrenVector errors;
+    coreObject->ariaErrorMessageReferencingElements(errors);
+    for (const auto& accessibilityObject : errors)
+        atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_FOR, accessibilityObject->wrapper());
+#endif
 }
 
 static gpointer webkitAccessibleParentClass = nullptr;
index 4d9d9fa..89c2a02 100644 (file)
@@ -24,8 +24,10 @@ aria-colspan
 aria-controls
 aria-current
 aria-describedby
+aria-details
 aria-disabled
 aria-dropeffect
+aria-errormessage
 aria-expanded
 aria-flowto
 aria-grabbed
index af80388..446eb77 100644 (file)
@@ -1,3 +1,27 @@
+2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        [ATK] Add support for aria-details and aria-errormessage
+        https://bugs.webkit.org/show_bug.cgi?id=172588
+
+        Reviewed by Chris Fleizach.
+
+        Add additional methods to test ARIA properties which are exposed via
+        AtkRelation. Also bump minimum versions of at-spi2-core and at-spi2-atk
+        to versions which support the details and error-message relation types.
+
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        (WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::ariaDetailsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaDetailsReferencingElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex):
+        * gtk/jhbuild.modules:
+
 2017-06-26  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Add libfii to GTK+ install dependencies script.
index ceac49e..4a27253 100644 (file)
@@ -203,6 +203,10 @@ public:
     RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned);
     RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned);
     RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned);
+    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned);
+    RefPtr<AccessibilityUIElement> ariaDetailsReferencingElementAtIndex(unsigned);
+    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned);
+    RefPtr<AccessibilityUIElement> ariaErrorMessageReferencingElementAtIndex(unsigned);
 #else
     RefPtr<AccessibilityUIElement> ariaLabelledByElementAtIndex(unsigned) { return nullptr; }
     RefPtr<AccessibilityUIElement> ariaDescribedByElementAtIndex(unsigned) { return nullptr; }
@@ -211,6 +215,10 @@ public:
     RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned) { return nullptr; }
     RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned) { return nullptr; }
     RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned) { return nullptr; }
+    RefPtr<AccessibilityUIElement> ariaDetailsElementAtIndex(unsigned) { return nullptr; }
+    RefPtr<AccessibilityUIElement> ariaDetailsReferencingElementAtIndex(unsigned) { return nullptr; }
+    RefPtr<AccessibilityUIElement> ariaErrorMessageElementAtIndex(unsigned) { return nullptr; }
+    RefPtr<AccessibilityUIElement> ariaErrorMessageReferencingElementAtIndex(unsigned) { return nullptr; }
 #endif
 
     // ARIA Drag and Drop
index 8b9820a..be0d646 100644 (file)
@@ -160,6 +160,10 @@ interface AccessibilityUIElement {
     AccessibilityUIElement ariaLabelledByReferencingElementAtIndex(unsigned long index);
     AccessibilityUIElement ariaDescribedByElementAtIndex(unsigned long index);
     AccessibilityUIElement ariaDescribedByReferencingElementAtIndex(unsigned long index);
+    AccessibilityUIElement ariaDetailsElementAtIndex(unsigned long index);
+    AccessibilityUIElement ariaDetailsReferencingElementAtIndex(unsigned long index);
+    AccessibilityUIElement ariaErrorMessageElementAtIndex(unsigned long index);
+    AccessibilityUIElement ariaErrorMessageReferencingElementAtIndex(unsigned long index);
 
     // Paramaterized attributes.
     DOMString parameterizedAttributeNames();
index 5b910bd..832c36b 100644 (file)
@@ -910,6 +910,38 @@ RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDescribedByReferencin
     return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_DESCRIPTION_FOR, index);
 }
 
+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDetailsElementAtIndex(unsigned index)
+{
+#if ATK_CHECK_VERSION(2, 25, 2)
+    return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_DETAILS, index);
+#endif
+    return nullptr;
+}
+
+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDetailsReferencingElementAtIndex(unsigned index)
+{
+#if ATK_CHECK_VERSION(2, 25, 2)
+    return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_DETAILS_FOR, index);
+#endif
+    return nullptr;
+}
+
+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaErrorMessageElementAtIndex(unsigned index)
+{
+#if ATK_CHECK_VERSION(2, 25, 2)
+    return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_ERROR_MESSAGE, index);
+#endif
+    return nullptr;
+}
+
+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaErrorMessageReferencingElementAtIndex(unsigned index)
+{
+#if ATK_CHECK_VERSION(2, 25, 2)
+    return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_ERROR_FOR, index);
+#endif
+    return nullptr;
+}
+
 RefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
 {
     // FIXME: implement
index ac8f1c3..6e99ca5 100755 (executable)
@@ -198,6 +198,7 @@ function installDependenciesWithApt {
         libxcb-xfixes0-dev \
         $(aptIfElse libxfont1-dev libxfont-dev) \
         libxkbfile-dev \
+        libxkbcommon-x11-dev \
         libtool-bin \
         libudev-dev \
         python-dev \
@@ -342,6 +343,7 @@ function installDependenciesWithPacman {
         libxfont \
         libxcb \
         libxkbfile \
+        libxkbcommon-x11 \
         mtdev \
         orc \
         python2 \
@@ -479,6 +481,7 @@ function installDependenciesWithDnf {
         libtiff-devel \
         libxcb-devel \
         libxkbfile-devel \
+        libxkbcommon-x11-devel \
         mesa-libEGL-devel \
         mtdev-devel \
         orc-devel \
index 9610236..7d9a113 100644 (file)
 
   <autotools id="at-spi2-core" 
              autogenargs="--disable-introspection">
-    <branch module="pub/GNOME/sources/at-spi2-core/2.25/at-spi2-core-2.25.2.tar.xz" version="2.25.2"
+    <branch module="pub/GNOME/sources/at-spi2-core/2.25/at-spi2-core-2.25.4.tar.xz" version="2.25.4"
             repo="ftp.gnome.org"
-            hash="sha256:4eaffa15bce924541809042dc0db5f62b80d0b45493b1d529642219a13871a40">
+            hash="sha256:baeccbf92e84e64bb4a853f076c27b78ab44edf1fa5414a9c6e59a9b180bc9d8">
     </branch>
     <dependencies>
       <dep package="glib"/>
   </autotools>
 
   <autotools id="at-spi2-atk">
-    <branch module="pub/GNOME/sources/at-spi2-atk/2.25/at-spi2-atk-2.25.2.tar.xz" version="2.25.2"
+    <branch module="pub/GNOME/sources/at-spi2-atk/2.25/at-spi2-atk-2.25.3.tar.xz" version="2.25.3"
             repo="ftp.gnome.org"
-            hash="sha256:dca41319d72915c40cce4ce59fdc0a33b922f974441ae8d60da125e2ee983ff0">
+            hash="sha256:b7aab1a4ee7182083fcfafb595b7b3fe4df34aa2230c775050fe6015b01f84e1">
     </branch>
     <dependencies>
       <dep package="glib"/>