AX: WebKit doesn't map aria-sort=other on OS X
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2013 18:21:02 +0000 (18:21 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2013 18:21:02 +0000 (18:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118511

Patch by Sam White <samuel_white@apple.com> on 2013-09-25
Reviewed by Chris Fleizach.

Source/WebCore:

No new tests, updated existing aria-sort test to validate addition of "other"
sort order per http://www.w3.org/TR/wai-aria/complete#aria-sort.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::sortDirection):
* accessibility/AccessibilityObject.h:

LayoutTests:

Updated test to check "other" aria-sort order. Also added additional checks to
determine which elements expose aria-sort so our "none" case is more clear.

* accessibility/aria-sort-expected.txt:
* accessibility/aria-sort.html:

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

LayoutTests/ChangeLog
LayoutTests/accessibility/aria-sort-expected.txt
LayoutTests/accessibility/aria-sort.html
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h

index 240f6f0eb702fa982ddf95c85e3d3359a3d11d2e..18051cdf4315bde48ac8ba801dd0892f5c4f907b 100644 (file)
@@ -1,3 +1,16 @@
+2013-09-25  Sam White  <samuel_white@apple.com>
+
+        AX: WebKit doesn't map aria-sort=other on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=118511
+
+        Reviewed by Chris Fleizach.
+
+        Updated test to check "other" aria-sort order. Also added additional checks to
+        determine which elements expose aria-sort so our "none" case is more clear.
+
+        * accessibility/aria-sort-expected.txt:
+        * accessibility/aria-sort.html:
+
 2013-09-25  Antti Koivisto  <antti@apple.com>
 
         REGRESSION (r156355) Links / interactive elements inside nested tables are unclickable
index d09abdb65155dcad42d2f403183ff8d3412f9297..18381ebc85ff2f266909b942f7bec7b3a7ae5cae 100644 (file)
@@ -1,14 +1,17 @@
-button
-column
+column column column
 row
-This tests that aria-sort will be exposed correctly to the Mac accessibility API.
+This tests that aria-sort is exposed correctly to the Mac accessibility API.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS accessibilityController.focusedElement.stringAttributeValue('AXSortDirection') is 'AXUnknownSortDirection'
-PASS accessibilityController.focusedElement.stringAttributeValue('AXSortDirection') is 'AXAscendingSortDirection'
-PASS accessibilityController.focusedElement.stringAttributeValue('AXSortDirection') is 'AXDescendingSortDirection'
+PASS col1.isAttributeSupported('AXSortDirection') is true
+PASS col1.stringAttributeValue('AXSortDirection') is 'AXAscendingSortDirection'
+PASS col2.isAttributeSupported('AXSortDirection') is true
+PASS col2.stringAttributeValue('AXSortDirection') is 'AXDescendingSortDirection'
+PASS col3.isAttributeSupported('AXSortDirection') is true
+PASS col3.stringAttributeValue('AXSortDirection') is 'AXUnknownSortDirection'
+PASS row1.isAttributeSupported('AXSortDirection') is false
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 71568b80d863bfd716d084eda240e5c85df7685f..e8013fda88243bb3aaaeb811f488a72c02a175c7 100644 (file)
@@ -1,16 +1,27 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
 <html>
 <head>
 <script src="../resources/js-test-pre.js"></script>
+<title>aria-sort</title>
 </head>
-<body id="body">
-
-<div tabindex="0" id="button" role="button">button</div>
+<body>
 
 <div role="grid">
 <div role="row">
-<div role="columnheader" aria-sort="ascending" tabindex="0" id="column">column</div>
-<div role="rowheader" aria-sort="descending" tabindex="0" id="row">row</div> 
+<span role="gridcell"></span>
+<!-- Ascending aria-sort direction. -->
+<span aria-sort="ascending" id="col1" role="columnheader">column</span>
+<!-- Descending aria-sort direction. -->
+<span aria-sort="descending" id="col2" role="columnheader">column</span>
+<!-- Other aria-sort direction. -->
+<span aria-sort="other" id="col3" role="columnheader">column</span>
+</div>
+<div role="row">
+<!-- No aria-sort direction. -->
+<span id="row1" role="rowheader">row</span>
+<span role="gridcell"></span>
+<span role="gridcell"></span>
+<span role="gridcell"></span>
 </div>
 </div>
 
 <div id="console"></div>
 
 <script>
-
-    description("This tests that aria-sort will be exposed correctly to the Mac accessibility API.");
-
+    description("This tests that aria-sort is exposed correctly to the Mac accessibility API.");
+    
     if (window.accessibilityController) {
-
-        document.getElementById("button").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXUnknownSortDirection'");
-
-        document.getElementById("column").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXAscendingSortDirection'");
-
-        document.getElementById("row").focus();
-        shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXSortDirection')", "'AXDescendingSortDirection'");
+        var col1 = accessibilityController.accessibleElementById("col1");
+        shouldBe("col1.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col1.stringAttributeValue('AXSortDirection')", "'AXAscendingSortDirection'");
+        
+        var col2 = accessibilityController.accessibleElementById("col2");
+        shouldBe("col2.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col2.stringAttributeValue('AXSortDirection')", "'AXDescendingSortDirection'");
+        
+        var col3 = accessibilityController.accessibleElementById("col3");
+        shouldBe("col3.isAttributeSupported('AXSortDirection')", "true");
+        shouldBe("col3.stringAttributeValue('AXSortDirection')", "'AXUnknownSortDirection'");
+        
+        var row1 = accessibilityController.accessibleElementById("row1");
+        shouldBe("row1.isAttributeSupported('AXSortDirection')", "false");
     }
-
 </script>
 
 <script src="../resources/js-test-post.js"></script>
index 3cb73943a25fd52c81fe868c2ec2100908ef4512..a779ca131620603828f1324576be5f67164a263d 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-25  Sam White  <samuel_white@apple.com>
+
+        AX: WebKit doesn't map aria-sort=other on OS X
+        https://bugs.webkit.org/show_bug.cgi?id=118511
+
+        Reviewed by Chris Fleizach.
+
+        No new tests, updated existing aria-sort test to validate addition of "other"
+        sort order per http://www.w3.org/TR/wai-aria/complete#aria-sort.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::sortDirection):
+        * accessibility/AccessibilityObject.h:
+
 2013-09-24  Sam Weinig  <sam@webkit.org>
 
         CTTE: More Document references please
index 57d107ca6df5d553d8d02ee39400252a1f4cdb14..13da8005f07ff9467810559a71939e3173882ee8 100644 (file)
@@ -1627,6 +1627,8 @@ AccessibilitySortDirection AccessibilityObject::sortDirection() const
         return SortDirectionAscending;
     if (equalIgnoringCase(sortAttribute, "descending"))
         return SortDirectionDescending;
+    if (equalIgnoringCase(sortAttribute, "other"))
+        return SortDirectionOther;
     
     return SortDirectionNone;
 }
index 9e75988b0fca7c3eb7327140bcd96a06aa1216e8..527dd4ad1cc1e3dd608df82cb95d273186ef995c 100644 (file)
@@ -278,6 +278,7 @@ enum AccessibilitySortDirection {
     SortDirectionNone,
     SortDirectionAscending,
     SortDirectionDescending,
+    SortDirectionOther
 };
 
 enum AccessibilitySearchDirection {