Source/WebCore: [AX][ATK] Added support for sort and help attributes.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Sep 2013 11:29:33 +0000 (11:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Sep 2013 11:29:33 +0000 (11:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120456

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-09-03
Reviewed by Chris Fleizach.

Added support for aria-sort and aria-help attributes.

Test: accessibility/aria-sort.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):

Tools: [AX][ATK] Added support for sort and help attributes
https://bugs.webkit.org/show_bug.cgi?id=120456

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-09-03
Reviewed by Chris Fleizach.

Added missing implementation to AccessibilityUIElement::helpText and support for
aria-sort attribute.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(coreAttributeToAtkAttribute):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::coreAttributeToAtkAttribute):
(WTR::AccessibilityUIElement::helpText):

LayoutTests: [AX][ATK] Added support for sort and help attributes
https://bugs.webkit.org/show_bug.cgi?id=120456

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-09-03
Reviewed by Chris Fleizach.

Sharing aria-sort.html specific mac test with efl and gtk.
Changing specific expectations of some accessibility tests.

* accessibility/aria-sort-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/aria-sort-expected.txt.
* accessibility/aria-sort.html: Renamed from LayoutTests/platform/mac/accessibility/aria-sort.html.
* platform/efl-wk2/TestExpectations:
* platform/efl-wk2/accessibility/image-link-expected.txt:
* platform/efl-wk2/accessibility/image-map2-expected.txt:
* platform/efl-wk2/accessibility/table-cell-spans-expected.txt:
* platform/efl-wk2/accessibility/table-cells-expected.txt:
* platform/gtk/accessibility/image-link-expected.txt:
* platform/gtk/accessibility/image-map2-expected.txt:
* platform/gtk/accessibility/table-cell-spans-expected.txt:
* platform/gtk/accessibility/table-cells-expected.txt:

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

17 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-sort-expected.txt [moved from LayoutTests/platform/mac/accessibility/aria-sort-expected.txt with 100% similarity]
LayoutTests/accessibility/aria-sort.html [moved from LayoutTests/platform/mac/accessibility/aria-sort.html with 89% similarity]
LayoutTests/platform/efl-wk2/TestExpectations
LayoutTests/platform/efl-wk2/accessibility/image-link-expected.txt
LayoutTests/platform/efl-wk2/accessibility/image-map2-expected.txt
LayoutTests/platform/efl-wk2/accessibility/table-cell-spans-expected.txt
LayoutTests/platform/efl-wk2/accessibility/table-cells-expected.txt
LayoutTests/platform/gtk/accessibility/image-link-expected.txt
LayoutTests/platform/gtk/accessibility/image-map2-expected.txt
LayoutTests/platform/gtk/accessibility/table-cell-spans-expected.txt
LayoutTests/platform/gtk/accessibility/table-cells-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Tools/ChangeLog
Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

index 92cc98e5b349436dd4d3248c86e0a0ccd0631190..9c1047c30f8848a391d76653136376a1d305bad6 100644 (file)
@@ -1,3 +1,25 @@
+2013-09-03  Krzysztof Czech  <k.czech@samsung.com>
+
+        [AX][ATK] Added support for sort and help attributes
+        https://bugs.webkit.org/show_bug.cgi?id=120456
+
+        Reviewed by Chris Fleizach.
+
+        Sharing aria-sort.html specific mac test with efl and gtk.
+        Changing specific expectations of some accessibility tests.
+
+        * accessibility/aria-sort-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/aria-sort-expected.txt.
+        * accessibility/aria-sort.html: Renamed from LayoutTests/platform/mac/accessibility/aria-sort.html.
+        * platform/efl-wk2/TestExpectations:
+        * platform/efl-wk2/accessibility/image-link-expected.txt:
+        * platform/efl-wk2/accessibility/image-map2-expected.txt:
+        * platform/efl-wk2/accessibility/table-cell-spans-expected.txt:
+        * platform/efl-wk2/accessibility/table-cells-expected.txt:
+        * platform/gtk/accessibility/image-link-expected.txt:
+        * platform/gtk/accessibility/image-map2-expected.txt:
+        * platform/gtk/accessibility/table-cell-spans-expected.txt:
+        * platform/gtk/accessibility/table-cells-expected.txt:
+
 2013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSS Regions] position: fixed is computed relative to the first region, not the viewport
similarity index 89%
rename from LayoutTests/platform/mac/accessibility/aria-sort.html
rename to LayoutTests/accessibility/aria-sort.html
index 7eb5dc1417f48bdbb2d7738839ef860caefce7ff..c1eb3073d67d6ff1f929020bead1861afbcfe1d9 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html>
 <head>
-<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script src="../fast/js/resources/js-test-pre.js"></script>
 </head>
 <body id="body">
 
@@ -35,6 +35,6 @@
 
 </script>
 
-<script src="../../../fast/js/resources/js-test-post.js"></script>
+<script src="../fast/js/resources/js-test-post.js"></script>
 </body>
 </html>
index d7b48cbaf2857720bc9b99b56c91bc5f28007774..61bcd5e4808f5266dc5f4855507ce05e8e0e1644 100644 (file)
@@ -217,7 +217,6 @@ webkit.org/b/108355 storage/websql/sql-error-codes.html [ Crash Pass ]
 
 # Missing EFL's accessibility functions
 webkit.org/b/112027 accessibility/aria-describedby-on-input.html [ Failure ]
-webkit.org/b/112028 accessibility/aria-help.html [ Failure ]
 webkit.org/b/111984 accessibility/aria-hidden-updates-alldescendants.html [ Failure ]
 webkit.org/b/111986 accessibility/aria-invalid.html [ Failure ]
 webkit.org/b/111987 accessibility/aria-link-supports-press.html [ Failure ]
index a7e858c757bfa18dc07b7f8af92e8b02f261ab14..d50b3a8224bd74263f7aec2b6201dd830d09bf5a 100644 (file)
@@ -20,7 +20,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: html-id:test, toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, html-id:test, toolkit:WebKitEfl
 
 Child 0:
 AXRole: AXImage
@@ -39,6 +39,6 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 
 
index 3a88f5dca3cfa85f802523b8013ec652aed58423..e5e0918e3b2581c6a136625b1cdd1a9b172762c2 100644 (file)
@@ -17,7 +17,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: html-id:result, toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, html-id:result, toolkit:WebKitEfl
 ------------
 AXRole: AXLink
 AXParent: AXWebArea
@@ -35,7 +35,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------
 AXRole: AXLink
 AXParent: AXWebArea
@@ -53,7 +53,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------
 
 
index 27d8f5fadeca00e3335ee11edd0f2d121d777b20..98fa8ac1cbedb3eeadd1eb5d031a6aad311d72e5 100644 (file)
@@ -25,7 +25,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 {0, 2}, {0, 2}
 
 ----------------------
@@ -47,7 +47,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 {0, 2}, {0, 2}
 
 ----------------------
@@ -69,7 +69,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 {2, 2}, {0, 1}
 
 ----------------------
@@ -91,7 +91,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 {2, 2}, {0, 1}
 
 ----------------------
@@ -113,7 +113,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 {2, 1}, {3, 1}
 
 ----------------------
index ee6620068b4f846b03cc14bf9c61fee4aad96540..7b68e3d9bc76de198e4e7340120b417f53c525d9 100644 (file)
@@ -27,7 +27,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------------------
 [3,1]
 AXRole: AXCell
@@ -47,7 +47,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------------------
 [1,1]
 AXRole: AXCell
@@ -67,7 +67,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------------------
 [2,2]
 AXRole: AXCell
@@ -87,7 +87,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------------------
 [3,5]
 AXRole: AXCell
@@ -107,7 +107,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitEfl
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitEfl
 ------------------------
 [100,0]
 
index 0c67923093a6877bbc518948e7280ab34dd19524..179370ada4dab735f02c2230ed4eaef7ae53d876 100644 (file)
@@ -20,7 +20,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: html-id:test, toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, html-id:test, toolkit:WebKitGtk
 
 Child 0:
 AXRole: AXImage
@@ -39,6 +39,6 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 
 
index d617a1f2dfbe633cca2f4014df5351fb5990f3e4..8cd740d2fd3258dc0ed9dfb5cecf788dbf0d301a 100644 (file)
@@ -17,7 +17,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: html-id:result, toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, html-id:result, toolkit:WebKitGtk
 ------------
 AXRole: AXLink
 AXParent: AXWebArea
@@ -35,7 +35,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------
 AXRole: AXLink
 AXParent: AXWebArea
@@ -53,7 +53,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------
 
 
index 28453d76cb9db0350b7343281e7b702b30607de6..781cef7d464864f279ddfeed4ccd2debf932abff 100644 (file)
@@ -25,7 +25,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 {0, 2}, {0, 2}
 
 ----------------------
@@ -47,7 +47,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 {0, 2}, {0, 2}
 
 ----------------------
@@ -69,7 +69,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 {2, 2}, {0, 1}
 
 ----------------------
@@ -91,7 +91,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 {2, 2}, {0, 1}
 
 ----------------------
@@ -113,7 +113,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 {2, 1}, {3, 1}
 
 ----------------------
index 9b5b3923f1d5e7f4b490498a2416da22945f8aa5..7441a7a166e05b438cc964ed59cc64ed252bf875 100644 (file)
@@ -27,7 +27,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------------------
 [3,1]
 AXRole: AXCell
@@ -47,7 +47,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------------------
 [1,1]
 AXRole: AXCell
@@ -67,7 +67,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------------------
 [2,2]
 AXRole: AXCell
@@ -87,7 +87,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------------------
 [3,5]
 AXRole: AXCell
@@ -107,7 +107,7 @@ AXEnabled: 1
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: toolkit:WebKitGtk
+AXPlatformAttributes: aria-sort:AXUnknownSortDirection, toolkit:WebKitGtk
 ------------------------
 [100,0]
 
index 89e7c2e083ed19d61d93ae5fa61602398b89f40c..5cc6183ec6947873140b9fe6f9df1b9383fa8679 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-03  Krzysztof Czech  <k.czech@samsung.com>
+
+        [AX][ATK] Added support for sort and help attributes.
+        https://bugs.webkit.org/show_bug.cgi?id=120456
+
+        Reviewed by Chris Fleizach.
+
+        Added support for aria-sort and aria-help attributes.
+
+        Test: accessibility/aria-sort.html
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes):
+
 2013-09-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] Remove dead code for QtXmlPatterns
index 26d4785095f2ebaf45d24059584d0d8d11d7abf1..8bc2488b15223e1d99cbe782b7759e94a5274e4e 100644 (file)
@@ -502,6 +502,19 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
     if (!invalidStatus.isEmpty() && invalidStatus != "false")
         attributeSet = addToAtkAttributeSet(attributeSet, "aria-invalid", coreObject->invalidStatus().string().utf8().data());
 
+    String helpText = coreObject->helpText();
+    if (!helpText.isEmpty())
+        attributeSet = addToAtkAttributeSet(attributeSet, "aria-help", helpText.utf8().data());
+
+    const char* sortDescription = "AXUnknownSortDirection";
+    AccessibilitySortDirection sortDirection = coreObject->sortDirection();
+    if (sortDirection == SortDirectionAscending)
+        sortDescription = "AXAscendingSortDirection";
+    else if (sortDirection == SortDirectionDescending)
+        sortDescription = "AXDescendingSortDirection";
+
+    attributeSet = addToAtkAttributeSet(attributeSet, "aria-sort", sortDescription);
+
     return attributeSet;
 }
 
index 80e87b1e525675181e1257da3e187c143489e46a..c69475362afd088a5708b912c593d1ec64a40a16 100644 (file)
@@ -1,3 +1,19 @@
+2013-09-03  Krzysztof Czech  <k.czech@samsung.com>
+
+        [AX][ATK] Added support for sort and help attributes
+        https://bugs.webkit.org/show_bug.cgi?id=120456
+
+        Reviewed by Chris Fleizach.
+
+        Added missing implementation to AccessibilityUIElement::helpText and support for
+        aria-sort attribute.
+
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (coreAttributeToAtkAttribute):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::coreAttributeToAtkAttribute):
+        (WTR::AccessibilityUIElement::helpText):
+
 2013-09-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt][WK1] PageVisibility tests are flaky
index c928220f9e9b159d0426949b7a1372d31c376ba3..41bc9697d355f651bf0611570b085428f021f3e4 100644 (file)
@@ -54,6 +54,9 @@ static String coreAttributeToAtkAttribute(JSStringRef attribute)
     if (attributeString == "AXPlaceholderValue")
         return "placeholder-text";
 
+    if (attributeString == "AXSortDirection")
+        return "aria-sort";
+
     return String();
 }
 
index 0a5972ddc301d0d6317f90566fd48a69c70dd4a7..2813800f429d995a4942b1e8e5113ab8c0644a4b 100644 (file)
@@ -57,6 +57,9 @@ static String coreAttributeToAtkAttribute(JSStringRef attribute)
 
     if (attributeString == "AXPlaceholderValue")
         return "placeholder-text";
+    
+    if (attributeString == "AXSortDirection")
+        return "aria-sort";
 
     return String();
 }
@@ -692,10 +695,12 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
 {
-    // FIXME: implement
-    // We need a way to call WebCore::AccessibilityObject::helpText()
-    // from here, probably a new helper class in WebProcess/WebCoreSupport.
-    return JSStringCreateWithCharacters(0, 0);
+    if (!m_element || !ATK_IS_OBJECT(m_element.get()))
+        return JSStringCreateWithCharacters(0, 0);
+
+    String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), "aria-help");
+    GOwnPtr<char> axValue(g_strdup_printf("AXHelp: %s", attributeValue.utf8().data()));
+    return JSStringCreateWithUTF8CString(axValue.get());
 }
 
 double AccessibilityUIElement::x()