AX: VoiceOver double speaks all items in <li> nodes
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Oct 2013 21:00:02 +0000 (21:00 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Oct 2013 21:00:02 +0000 (21:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122564

Reviewed by Brent Fulgham.

Source/WebCore:

Test: platform/mac/accessibility/native-list-item-should-not-expose-label.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):

LayoutTests:

Make a mac specific expectation for listitem-title on Mac.
Make a more directed test for Mac regarding listitem labeling.

* platform/mac/accessibility/lists-expected.txt:
* platform/mac/accessibility/listitem-title-expected.txt: Added.
* platform/mac/accessibility/native-list-item-should-not-expose-label-expected.txt: Added.
* platform/mac/accessibility/native-list-item-should-not-expose-label.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/listitem-title-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/lists-expected.txt
LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp

index 0caa2b2..d01d08a 100644 (file)
@@ -1,3 +1,18 @@
+2013-10-09  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: VoiceOver double speaks all items in <li> nodes
+        https://bugs.webkit.org/show_bug.cgi?id=122564
+
+        Reviewed by Brent Fulgham.
+
+        Make a mac specific expectation for listitem-title on Mac.
+        Make a more directed test for Mac regarding listitem labeling.
+
+        * platform/mac/accessibility/lists-expected.txt:
+        * platform/mac/accessibility/listitem-title-expected.txt: Added.
+        * platform/mac/accessibility/native-list-item-should-not-expose-label-expected.txt: Added.
+        * platform/mac/accessibility/native-list-item-should-not-expose-label.html: Added.
+
 2013-10-09  Gustavo Noronha Silva  <gns@gnome.org>
 
         Unreviewed gardening. Many inspector protocol tests are timing out on the bots, unreproducible locally.
diff --git a/LayoutTests/platform/mac/accessibility/listitem-title-expected.txt b/LayoutTests/platform/mac/accessibility/listitem-title-expected.txt
new file mode 100644 (file)
index 0000000..eabe73c
--- /dev/null
@@ -0,0 +1,13 @@
+test1
+test2
+test1
+test2
+
+
+
+
+il in ul title: AXTitle: 
+
+il in ol title: AXTitle: 
+
+
index 0cb67c0..f9b90a2 100644 (file)
@@ -167,22 +167,22 @@ AXSubrole: (null)
 AXRoleDescription: group
 AXChildren: <array of size 2>
 AXHelp: 
-AXParent: <AXGroup: 'test 1'>
+AXParent: <AXGroup>
 AXSize: NSSize: {729, 18}
-AXTitle: test 1
+AXTitle: 
 AXDescription: 
 AXValue: 
 AXFocused: 0
 AXEnabled: 1
-AXWindow: <AXGroup: 'test 1'>
+AXWindow: <AXGroup>
 AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: <AXGroup: 'test 1'>
-AXEndTextMarker: <AXGroup: 'test 1'>
+AXStartTextMarker: <AXGroup>
+AXEndTextMarker: <AXGroup>
 AXVisited: 0
 AXLinkedUIElements: (null)
 AXSelected: 0
 AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXGroup: 'test 1'>
+AXTopLevelUIElement: <AXGroup>
 AXLanguage: 
 AXDOMIdentifier: 
 AXDOMClassList: <array of size 0>
@@ -195,22 +195,22 @@ AXSubrole: (null)
 AXRoleDescription: group
 AXChildren: <array of size 2>
 AXHelp: 
-AXParent: <AXGroup: 'test 2'>
+AXParent: <AXGroup>
 AXSize: NSSize: {729, 18}
-AXTitle: test 2
+AXTitle: 
 AXDescription: 
 AXValue: 
 AXFocused: 0
 AXEnabled: 1
-AXWindow: <AXGroup: 'test 2'>
+AXWindow: <AXGroup>
 AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: <AXGroup: 'test 2'>
-AXEndTextMarker: <AXGroup: 'test 2'>
+AXStartTextMarker: <AXGroup>
+AXEndTextMarker: <AXGroup>
 AXVisited: 0
 AXLinkedUIElements: (null)
 AXSelected: 0
 AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXGroup: 'test 2'>
+AXTopLevelUIElement: <AXGroup>
 AXLanguage: 
 AXDOMIdentifier: 
 AXDOMClassList: <array of size 0>
@@ -225,22 +225,22 @@ AXSubrole: (null)
 AXRoleDescription: group
 AXChildren: <array of size 2>
 AXHelp: 
-AXParent: <AXGroup: 'test 1'>
+AXParent: <AXGroup>
 AXSize: NSSize: {729, 18}
-AXTitle: test 1
+AXTitle: 
 AXDescription: 
 AXValue: 
 AXFocused: 0
 AXEnabled: 1
-AXWindow: <AXGroup: 'test 1'>
+AXWindow: <AXGroup>
 AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: <AXGroup: 'test 1'>
-AXEndTextMarker: <AXGroup: 'test 1'>
+AXStartTextMarker: <AXGroup>
+AXEndTextMarker: <AXGroup>
 AXVisited: 0
 AXLinkedUIElements: (null)
 AXSelected: 0
 AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXGroup: 'test 1'>
+AXTopLevelUIElement: <AXGroup>
 AXLanguage: 
 AXDOMIdentifier: 
 AXDOMClassList: <array of size 0>
@@ -253,22 +253,22 @@ AXSubrole: (null)
 AXRoleDescription: group
 AXChildren: <array of size 2>
 AXHelp: 
-AXParent: <AXGroup: 'test 2'>
+AXParent: <AXGroup>
 AXSize: NSSize: {729, 18}
-AXTitle: test 2
+AXTitle: 
 AXDescription: 
 AXValue: 
 AXFocused: 0
 AXEnabled: 1
-AXWindow: <AXGroup: 'test 2'>
+AXWindow: <AXGroup>
 AXSelectedTextMarkerRange: (null)
-AXStartTextMarker: <AXGroup: 'test 2'>
-AXEndTextMarker: <AXGroup: 'test 2'>
+AXStartTextMarker: <AXGroup>
+AXEndTextMarker: <AXGroup>
 AXVisited: 0
 AXLinkedUIElements: (null)
 AXSelected: 0
 AXBlockQuoteLevel: 0
-AXTopLevelUIElement: <AXGroup: 'test 2'>
+AXTopLevelUIElement: <AXGroup>
 AXLanguage: 
 AXDOMIdentifier: 
 AXDOMClassList: <array of size 0>
diff --git a/LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label-expected.txt b/LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label-expected.txt
new file mode 100644 (file)
index 0000000..6e585b2
--- /dev/null
@@ -0,0 +1,12 @@
+Some text. Like
+This tests that list items on MacOS do not expose labeling information. MacOS expects only leaf-node type elements to do that.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS listitem.description is 'AXDescription: '
+PASS listitem.title is 'AXTitle: '
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label.html b/LayoutTests/platform/mac/accessibility/native-list-item-should-not-expose-label.html
new file mode 100644 (file)
index 0000000..b6981e6
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<ul>
+  <li id="listitem">
+    Some text.
+    <a href="#" role="button">Like</a>
+  </li>
+</ul>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that list items on MacOS do not expose labeling information. MacOS expects only leaf-node type elements to do that.");
+
+    if (window.accessibilityController) {
+
+          // Both the title and description should be empty for the list item.
+          var listitem = accessibilityController.accessibleElementById("listitem");
+          shouldBe("listitem.description", "'AXDescription: '");
+          shouldBe("listitem.title", "'AXTitle: '");
+    }
+
+</script>
+
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
index 484a6fd..b2f83a4 100644 (file)
@@ -1,3 +1,15 @@
+2013-10-09  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: VoiceOver double speaks all items in <li> nodes
+        https://bugs.webkit.org/show_bug.cgi?id=122564
+
+        Reviewed by Brent Fulgham.
+
+        Test: platform/mac/accessibility/native-list-item-should-not-expose-label.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::visibleText):
+
 2013-10-09  Sergio Correia  <sergio.correia@openbossa.org>
 
         CoordinatedGraphics: Fix integer rounding when computing pixel alignment
index 07d72d4..1c6f875 100644 (file)
@@ -1293,7 +1293,10 @@ void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder)
     case ToggleButtonRole:
     case CheckBoxRole:
     case ListBoxOptionRole:
+    // MacOS does not expect native <li> elements to expose label information, it only expects leaf node elements to do that.
+#if !PLATFORM(MAC)
     case ListItemRole:
+#endif
     case MenuButtonRole:
     case MenuItemRole:
     case MenuItemCheckboxRole: