Title: [141212] trunk
Revision
141212
Author
[email protected]
Date
2013-01-29 19:41:58 -0800 (Tue, 29 Jan 2013)

Log Message

AX: VoiceOver not reading bullets correctly in the text of notes
https://bugs.webkit.org/show_bug.cgi?id=107980

Reviewed by Ryosuke Niwa.

Source/WebCore:

Accessibility code should not assume that all list markers end with the same "." suffix.
We need to use the actual suffix.

Test: platform/mac/accessibility/listmarker-suffix.html

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

LayoutTests:

* platform/mac/accessibility/listmarker-suffix-expected.txt: Added.
* platform/mac/accessibility/listmarker-suffix.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141211 => 141212)


--- trunk/LayoutTests/ChangeLog	2013-01-30 03:36:13 UTC (rev 141211)
+++ trunk/LayoutTests/ChangeLog	2013-01-30 03:41:58 UTC (rev 141212)
@@ -1,3 +1,13 @@
+2013-01-29  Chris Fleizach  <[email protected]>
+
+        AX: VoiceOver not reading bullets correctly in the text of notes
+        https://bugs.webkit.org/show_bug.cgi?id=107980
+
+        Reviewed by Ryosuke Niwa.
+
+        * platform/mac/accessibility/listmarker-suffix-expected.txt: Added.
+        * platform/mac/accessibility/listmarker-suffix.html: Added.
+
 2013-01-29  Keishi Hattori  <[email protected]>
 
         [Chromium] fast/workers/storage crashing after r141166

Added: trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix-expected.txt (0 => 141212)


--- trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix-expected.txt	2013-01-30 03:41:58 UTC (rev 141212)
@@ -0,0 +1,13 @@
+item 1
+item 2
+This test makes sure the right suffix is returned when fetching text marker strings for list items.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS list1.stringForTextMarkerRange(textRange) is bulletString + ' item 1'
+PASS list2.stringForTextMarkerRange(textRange) is '1. item 2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix.html (0 => 141212)


--- trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/listmarker-suffix.html	2013-01-30 03:41:58 UTC (rev 141212)
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+if (window.testRunner)
+   testRunner.dumpAsText();
+</script>
+</head>
+<body>
+
+<ul style="disc">
+<li id="listitem1">item 1</li>
+</ul>
+
+<ol>
+<li id="listitem2">item 2</li>
+</ol>
+
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This test makes sure the right suffix is returned when fetching text marker strings for list items.");
+
+    if (window.accessibilityController) {
+        var list1 = accessibilityController.accessibleElementById("listitem1");
+        var textRange = list1.textMarkerRangeForElement(list1);
+        var bulletString = String.fromCharCode(0x2022);
+        shouldBe("list1.stringForTextMarkerRange(textRange)", "bulletString + ' item 1'");
+
+        var list2 = accessibilityController.accessibleElementById("listitem2");
+        var textRange = list2.textMarkerRangeForElement(list2);
+        shouldBe("list2.stringForTextMarkerRange(textRange)", "'1. item 2'");
+    }
+
+</script>
+
+<script src=""
+
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (141211 => 141212)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 03:36:13 UTC (rev 141211)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 03:41:58 UTC (rev 141212)
@@ -1,3 +1,18 @@
+2013-01-29  Chris Fleizach  <[email protected]>
+
+        AX: VoiceOver not reading bullets correctly in the text of notes
+        https://bugs.webkit.org/show_bug.cgi?id=107980
+
+        Reviewed by Ryosuke Niwa.
+
+        Accessibility code should not assume that all list markers end with the same "." suffix.
+        We need to use the actual suffix.
+
+        Test: platform/mac/accessibility/listmarker-suffix.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
+
 2013-01-29  Mark Lam  <[email protected]>
 
         Rename AbstractDatabase to DatabaseBackend.

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (141211 => 141212)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-01-30 03:36:13 UTC (rev 141211)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2013-01-30 03:41:58 UTC (rev 141212)
@@ -828,14 +828,7 @@
     // If this is in a list item, we need to manually add the text for the list marker 
     // because a RenderListMarker does not have a Node equivalent and thus does not appear
     // when iterating text.
-    const String& markerText = listItem->markerText();
-    if (markerText.isEmpty())
-        return String();
-                
-    // Append text, plus the period that follows the text.
-    // FIXME: Not all list marker styles are followed by a period, but this
-    // sounds much better when there is a synthesized pause because of a period.
-    return markerText + ". ";
+    return listItem->markerTextWithSuffix();
 }
     
 String AccessibilityObject::stringForVisiblePositionRange(const VisiblePositionRange& visiblePositionRange) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to