AX: AXARIACurrent exposed but not displayed in Accessibility Inspector
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Mar 2016 17:48:14 +0000 (17:48 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Mar 2016 17:48:14 +0000 (17:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155600

Reviewed by Chris Fleizach.

Source/WebCore:

AXARIACurrent attribute was added to a temporary array that was never returned.

Test: accessibility/mac/aria-current-attribute-exposed.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):

LayoutTests:

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

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

LayoutTests/ChangeLog
LayoutTests/accessibility/mac/aria-current-attribute-exposed-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/aria-current-attribute-exposed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

index 9485975e223698432ced7e8abe808e8bdc1766b1..db9b7e3d6d01498eb96577cd7f89a4bed260257e 100644 (file)
@@ -1,3 +1,13 @@
+2016-03-18  Nan Wang  <n_wang@apple.com>
+
+        AX: AXARIACurrent exposed but not displayed in Accessibility Inspector
+        https://bugs.webkit.org/show_bug.cgi?id=155600
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/aria-current-attribute-exposed-expected.txt: Added.
+        * accessibility/mac/aria-current-attribute-exposed.html: Added.
+
 2016-03-18  Nan Wang  <n_wang@apple.com>
 
         AX: Typing broken on form input field while using VoiceOver
 2016-03-18  Nan Wang  <n_wang@apple.com>
 
         AX: Typing broken on form input field while using VoiceOver
diff --git a/LayoutTests/accessibility/mac/aria-current-attribute-exposed-expected.txt b/LayoutTests/accessibility/mac/aria-current-attribute-exposed-expected.txt
new file mode 100644 (file)
index 0000000..65b3dc7
--- /dev/null
@@ -0,0 +1,12 @@
+Link Current Link
+This tests that aria-current attribute is correctly exposed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS link1.allAttributes().includes('AXARIACurrent: true') is false
+PASS link2.allAttributes().includes('AXARIACurrent: true') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/mac/aria-current-attribute-exposed.html b/LayoutTests/accessibility/mac/aria-current-attribute-exposed.html
new file mode 100644 (file)
index 0000000..49e5657
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body>
+
+<div id="container">
+<a id="link1" href="/">Link</a>
+<a id="link2" aria-current="true" href="/">Current Link</a>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that aria-current attribute is correctly exposed.");
+    
+    if (window.accessibilityController) {
+        var link1 = accessibilityController.accessibleElementById("link1");
+        var link2 = accessibilityController.accessibleElementById("link2");
+        
+        // Attributes of link1 shouldn't contain AXARIACurrent
+        shouldBeFalse("link1.allAttributes().includes('AXARIACurrent: true')");
+        // Attributes of link2 should contain AXARIACurrent
+        shouldBeTrue("link2.allAttributes().includes('AXARIACurrent: true')");
+    }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index 9f7615f1af124c2b5a3f321e0539a4b83bcded47..b11d2160ccefc2d0f044627b653f2dcf72248ecc 100644 (file)
@@ -1,3 +1,17 @@
+2016-03-18  Nan Wang  <n_wang@apple.com>
+
+        AX: AXARIACurrent exposed but not displayed in Accessibility Inspector
+        https://bugs.webkit.org/show_bug.cgi?id=155600
+
+        Reviewed by Chris Fleizach.
+
+        AXARIACurrent attribute was added to a temporary array that was never returned.
+
+        Test: accessibility/mac/aria-current-attribute-exposed.html
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
+
 2016-03-18  Nan Wang  <n_wang@apple.com>
 
         AX: Typing broken on form input field while using VoiceOver
 2016-03-18  Nan Wang  <n_wang@apple.com>
 
         AX: Typing broken on form input field while using VoiceOver
index 59bfa1a024efdc648779b1068e82db0c46d7b808..7110acb069110044ce4e3908e370b9e07dbc9d8d 100644 (file)
@@ -1895,7 +1895,7 @@ static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, const Visibl
     
     // Only expose AXARIACurrent attribute when the element is set to be current item.
     if (m_object->ariaCurrentState() != ARIACurrentFalse)
     
     // Only expose AXARIACurrent attribute when the element is set to be current item.
     if (m_object->ariaCurrentState() != ARIACurrentFalse)
-        [objectAttributes arrayByAddingObjectsFromArray:@[ NSAccessibilityARIACurrentAttribute ]];
+        objectAttributes = [objectAttributes arrayByAddingObjectsFromArray:@[ NSAccessibilityARIACurrentAttribute ]];
     
     return objectAttributes;
 }
     
     return objectAttributes;
 }