AX: Expose aria-current status to children
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 21:49:26 +0000 (21:49 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Mar 2016 21:49:26 +0000 (21:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155469

Reviewed by Chris Fleizach.

Source/WebCore:

Added aria-current to the global ARIA attributes list.

Test: accessibility/aria-current-global-attribute.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):

LayoutTests:

* accessibility/aria-current-global-attribute-expected.txt: Added.
* accessibility/aria-current-global-attribute.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/accessibility/aria-current-global-attribute-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/aria-current-global-attribute.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp

index a37b0d8..cfee3f4 100644 (file)
@@ -1,3 +1,13 @@
+2016-03-16  Nan Wang  <n_wang@apple.com>
+
+        AX: Expose aria-current status to children
+        https://bugs.webkit.org/show_bug.cgi?id=155469
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/aria-current-global-attribute-expected.txt: Added.
+        * accessibility/aria-current-global-attribute.html: Added.
+
 2016-03-16  Tim Horton  <timothy_horton@apple.com>
 
         [mac] Printing test snapshots are upside-down after r198242
diff --git a/LayoutTests/accessibility/aria-current-global-attribute-expected.txt b/LayoutTests/accessibility/aria-current-global-attribute-expected.txt
new file mode 100644 (file)
index 0000000..58e0a55
--- /dev/null
@@ -0,0 +1,12 @@
+text1 text2
+This tests that aria-current is a global attribute.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS spanAccessible('text1') is false
+PASS spanAccessible('text2') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/aria-current-global-attribute.html b/LayoutTests/accessibility/aria-current-global-attribute.html
new file mode 100644 (file)
index 0000000..22abf92
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+
+<body id="body">
+
+<span id="text1">text1</span>
+<span aria-current="true" id="text2">text2</span>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that aria-current is a global attribute.");
+
+    if (window.accessibilityController) {
+        shouldBeFalse("spanAccessible('text1')");
+        shouldBeTrue("spanAccessible('text2')");
+    }
+    
+    function spanAccessible(sh) {
+        var spanObj = accessibilityController.accessibleElementById(sh);
+        
+        if (!spanObj)
+            return false;
+        
+        return !spanObj.isIgnored;
+    }
+
+</script>
+
+
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
\ No newline at end of file
index e20dca3..e8c1fea 100644 (file)
@@ -1,3 +1,17 @@
+2016-03-16  Nan Wang  <n_wang@apple.com>
+
+        AX: Expose aria-current status to children
+        https://bugs.webkit.org/show_bug.cgi?id=155469
+
+        Reviewed by Chris Fleizach.
+
+        Added aria-current to the global ARIA attributes list.
+
+        Test: accessibility/aria-current-global-attribute.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::supportsARIAAttributes):
+
 2016-03-16  Tim Horton  <timothy_horton@apple.com>
 
         [mac] Printing test snapshots are upside-down after r198242
index dd03536..3c80a13 100644 (file)
@@ -2245,6 +2245,7 @@ bool AccessibilityObject::supportsARIAAttributes() const
         || hasAttribute(aria_atomicAttr)
         || hasAttribute(aria_busyAttr)
         || hasAttribute(aria_controlsAttr)
+        || hasAttribute(aria_currentAttr)
         || hasAttribute(aria_describedbyAttr)
         || hasAttribute(aria_disabledAttr)
         || hasAttribute(aria_flowtoAttr)