Title: [132404] trunk
Revision
132404
Author
cfleiz...@apple.com
Date
2012-10-24 14:48:16 -0700 (Wed, 24 Oct 2012)

Log Message

AX:When aria-label is used, the text under an element is still appearing as the AXTitle
https://bugs.webkit.org/show_bug.cgi?id=98167

Reviewed by Beth Dakin.

Source/WebCore: 

According to WAI-ARIA text computation, the presence of aria-label and alternative text
should override the visible text within an element.

Test: platform/mac/accessibility/aria-label-overrides-visible-text.html

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

LayoutTests: 

* platform/mac/accessibility/aria-label-overrides-visible-text-expected.txt: Added.
* platform/mac/accessibility/aria-label-overrides-visible-text.html: Added.
* platform/mac/accessibility/aria-labelledby-overrides-aria-label-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (132403 => 132404)


--- trunk/LayoutTests/ChangeLog	2012-10-24 21:41:46 UTC (rev 132403)
+++ trunk/LayoutTests/ChangeLog	2012-10-24 21:48:16 UTC (rev 132404)
@@ -1,3 +1,14 @@
+2012-10-24  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX:When aria-label is used, the text under an element is still appearing as the AXTitle
+        https://bugs.webkit.org/show_bug.cgi?id=98167
+
+        Reviewed by Beth Dakin.
+
+        * platform/mac/accessibility/aria-label-overrides-visible-text-expected.txt: Added.
+        * platform/mac/accessibility/aria-label-overrides-visible-text.html: Added.
+        * platform/mac/accessibility/aria-labelledby-overrides-aria-label-expected.txt:
+
 2012-10-24  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r132303 and r132312.

Added: trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text-expected.txt (0 => 132404)


--- trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text-expected.txt	2012-10-24 21:48:16 UTC (rev 132404)
@@ -0,0 +1,14 @@
+test1 test1
+This tests ensures that if aria-label is used, the AXTitle will not expose its children on Mac.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS link1.description is 'AXDescription: '
+PASS link1.title is 'AXTitle: test1'
+PASS link2.description is 'AXDescription: LINK'
+PASS link2.title is 'AXTitle: '
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text.html (0 => 132404)


--- trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-label-overrides-visible-text.html	2012-10-24 21:48:16 UTC (rev 132404)
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+<a tabindex="0" id="link1" href=""
+<a tabindex="0" id="link2" href="" aria-label="LINK">test1</a>
+
+<div id="console"></div>
+<script>
+description("This tests ensures that if aria-label is used, the AXTitle will not expose its children on Mac.")
+
+if (window.testRunner && window.accessibilityController) {
+   var link1 = accessibilityController.accessibleElementById("link1");
+   shouldBe("link1.description", "'AXDescription: '");
+   shouldBe("link1.title", "'AXTitle: test1'");
+
+   var link2 = accessibilityController.accessibleElementById("link2");
+   shouldBe("link2.description", "'AXDescription: LINK'");
+   shouldBe("link2.title", "'AXTitle: '");
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac/accessibility/aria-labelledby-overrides-aria-label-expected.txt (132403 => 132404)


--- trunk/LayoutTests/platform/mac/accessibility/aria-labelledby-overrides-aria-label-expected.txt	2012-10-24 21:41:46 UTC (rev 132403)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-labelledby-overrides-aria-label-expected.txt	2012-10-24 21:48:16 UTC (rev 132404)
@@ -3,10 +3,10 @@
 Alpha Beta Delta Eta Epsilon Theta
 usingNone.title: [AXTitle: Alpha]
 usingNone.description: [AXDescription: ]
-usingLabel.title: [AXTitle: Beta]
+usingLabel.title: [AXTitle: ]
 usingLabel.description: [AXDescription: Gamma]
-usingLabelledby.title: [AXTitle: Delta]
+usingLabelledby.title: [AXTitle: ]
 usingLabelledby.description: [AXDescription: Epsilon]
-usingLabeledby.title: [AXTitle: Eta]
+usingLabeledby.title: [AXTitle: ]
 usingLabeledby.description: [AXDescription: Theta]
 

Modified: trunk/Source/WebCore/ChangeLog (132403 => 132404)


--- trunk/Source/WebCore/ChangeLog	2012-10-24 21:41:46 UTC (rev 132403)
+++ trunk/Source/WebCore/ChangeLog	2012-10-24 21:48:16 UTC (rev 132404)
@@ -1,3 +1,18 @@
+2012-10-24  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX:When aria-label is used, the text under an element is still appearing as the AXTitle
+        https://bugs.webkit.org/show_bug.cgi?id=98167
+
+        Reviewed by Beth Dakin.
+
+        According to WAI-ARIA text computation, the presence of aria-label and alternative text
+        should override the visible text within an element.
+
+        Test: platform/mac/accessibility/aria-label-overrides-visible-text.html
+
+        * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityTitle]):
+
 2012-10-24  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r132303 and r132312.

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm (132403 => 132404)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-10-24 21:41:46 UTC (rev 132403)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-10-24 21:48:16 UTC (rev 132404)
@@ -1849,6 +1849,10 @@
     for (unsigned k = 0; k < length; k++) {
         const AccessibilityText& text = textOrder[k];
         
+        // If we have alternative text, then we should not expose a title.
+        if (text.textSource == AlternativeText)
+            break;
+        
         // Once we encounter visible text, or the text from our children that should be used foremost.
         if (text.textSource == VisibleText || text.textSource == ChildrenText)
             return text.text;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to