[ATK] Expose aria-haspopup and aria-sort without the 'aria-' prefix
https://bugs.webkit.org/show_bug.cgi?id=121495

Reviewed by Chris Fleizach.

Source/WebCore:

Removed the 'aria-' prefix from the exposed ATK object attributes
for WAI-ARIA attributes 'aria-haspopup' and 'aria-sort'.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes): Removed the prefix.

Tools:

Adapted DRT and WKTR to deal with the new names for the ATK object
attributes being exposed for 'aria-haspopup' and 'aria-sort'.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(coreAttributeToAtkAttribute): Updated translation between ATK and DRT.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::hasPopup): Ditto.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::coreAttributeToAtkAttribute): Updated translation between ATK and WKTR.
(WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
(WTR::AccessibilityUIElement::hasPopup): Ditto.

LayoutTests:

Rebaseline test expectations that were displaying the 'aria-sort'
attributes incorrectly, when they shouldn't due to that ARIA
attribute not being explicitly used in the HTML.

* platform/efl-wk1/accessibility/lists-expected.txt: Removed output for 'aria-sort'.
* platform/efl-wk1/accessibility/plugin-expected.txt: Ditto.
* platform/efl-wk1/accessibility/table-with-aria-role-expected.txt: Ditto.
* platform/efl-wk1/accessibility/transformed-element-expected.txt: Ditto.
* platform/efl-wk2/accessibility/image-link-expected.txt: Ditto.
* platform/efl-wk2/accessibility/image-map2-expected.txt: Ditto.
* platform/efl-wk2/accessibility/lists-expected.txt: Ditto.
* platform/efl-wk2/accessibility/plugin-expected.txt: Ditto.
* platform/efl-wk2/accessibility/table-cell-spans-expected.txt: Ditto.
* platform/efl-wk2/accessibility/table-cells-expected.txt: Ditto.
* platform/efl-wk2/accessibility/table-with-aria-role-expected.txt: Ditto.
* platform/efl-wk2/accessibility/transformed-element-expected.txt: Ditto.
* platform/gtk/accessibility/image-link-expected.txt: Ditto.
* platform/gtk/accessibility/image-map2-expected.txt: Ditto.
* platform/gtk/accessibility/lists-expected.txt: Ditto.
* platform/gtk/accessibility/plugin-expected.txt: Ditto.
* platform/gtk/accessibility/table-cell-spans-expected.txt: Ditto.
* platform/gtk/accessibility/table-cells-expected.txt: Ditto.
* platform/gtk/accessibility/table-detection-expected.txt: Ditto.
* platform/gtk/accessibility/table-one-cell-expected.txt: Ditto.
* platform/gtk/accessibility/table-with-aria-role-expected.txt: Ditto.
* platform/gtk/accessibility/table-with-rules-expected.txt: Ditto.
* platform/gtk/accessibility/transformed-element-expected.txt: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5e49279..2c005f3 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2013-09-18  Mario Sanchez Prada  <mario.prada@samsung.com>
+
+        [ATK] Expose aria-haspopup and aria-sort without the 'aria-' prefix
+        https://bugs.webkit.org/show_bug.cgi?id=121495
+
+        Reviewed by Chris Fleizach.
+
+        Removed the 'aria-' prefix from the exposed ATK object attributes
+        for WAI-ARIA attributes 'aria-haspopup' and 'aria-sort'.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes): Removed the prefix.
+
 2013-09-17  Antti Koivisto  <antti@apple.com>
 
         Rename InlineBox::isText()
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index 95c9e61..76b760d 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -489,7 +489,7 @@
         attributeSet = addToAtkAttributeSet(attributeSet, "placeholder-text", placeholder.utf8().data());
 
     if (coreObject->ariaHasPopup())
-        attributeSet = addToAtkAttributeSet(attributeSet, "aria-haspopup", "true");
+        attributeSet = addToAtkAttributeSet(attributeSet, "haspopup", "true");
 
     String invalidStatus = coreObject->invalidStatus().string();
     if (!invalidStatus.isEmpty() && invalidStatus != "false")
@@ -499,14 +499,11 @@
     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);
+    if (sortDirection != SortDirectionNone) {
+        attributeSet = addToAtkAttributeSet(attributeSet, "sort",
+            sortDirection == SortDirectionAscending ? "ascending" : "descending");
+    }
 
     return attributeSet;
 }