Title: [139002] trunk
Revision
139002
Author
cfleiz...@apple.com
Date
2013-01-07 15:32:39 -0800 (Mon, 07 Jan 2013)

Log Message

AX: the text of render counters are not exposed to Accessibility
https://bugs.webkit.org/show_bug.cgi?id=103794

Reviewed by Ryosuke Niwa.

Source/WebCore: 

Support RenderText objects that don't have nodes (like RenderCounter).

Test: accessibility/render-counter-text.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement):

LayoutTests: 

* accessibility/render-counter-text-expected.txt: Added.
* accessibility/render-counter-text.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139001 => 139002)


--- trunk/LayoutTests/ChangeLog	2013-01-07 23:29:12 UTC (rev 139001)
+++ trunk/LayoutTests/ChangeLog	2013-01-07 23:32:39 UTC (rev 139002)
@@ -1,3 +1,13 @@
+2013-01-07  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: the text of render counters are not exposed to Accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=103794
+
+        Reviewed by Ryosuke Niwa.
+
+        * accessibility/render-counter-text-expected.txt: Added.
+        * accessibility/render-counter-text.html: Added.
+
 2013-01-07  Ojan Vafai  <o...@chromium.org>
 
         A couple more rebaselines for http://trac.webkit.org/changeset/138838.

Added: trunk/LayoutTests/accessibility/render-counter-text-expected.txt (0 => 139002)


--- trunk/LayoutTests/accessibility/render-counter-text-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/render-counter-text-expected.txt	2013-01-07 23:32:39 UTC (rev 139002)
@@ -0,0 +1,14 @@
+This tests that the text for RenderCounter is exposed correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS line1.childAtIndex(0).stringValue is 'AXValue: 1'
+PASS line1.childAtIndex(1).stringValue is 'AXValue: :'
+PASS line1.childAtIndex(2).stringValue is 'AXValue: line1'
+PASS line2.childAtIndex(0).stringValue is 'AXValue: 2'
+PASS line2.childAtIndex(1).stringValue is 'AXValue: :'
+PASS line2.childAtIndex(2).stringValue is 'AXValue: line2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/render-counter-text.html (0 => 139002)


--- trunk/LayoutTests/accessibility/render-counter-text.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/render-counter-text.html	2013-01-07 23:32:39 UTC (rev 139002)
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+<style>
+ol li::before { content: counter(l1) ":"; counter-increment: l1;}
+ol li { list-style-type: decimial; display: block; }
+</style>
+
+<div id="container" style="counter-reset:l1;">
+<ol style="list-style-type:decimal">
+<li id="line1">line1
+<li id="line2">line2
+<li>line3
+</ol>
+</div>
+
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+
+description("This tests that the text for RenderCounter is exposed correctly.")
+
+if (window.testRunner && window.accessibilityController) {
+    
+    var line1 = accessibilityController.accessibleElementById("line1");
+    shouldBe("line1.childAtIndex(0).stringValue", "'AXValue: 1'");
+    shouldBe("line1.childAtIndex(1).stringValue", "'AXValue: :'");
+    shouldBe("line1.childAtIndex(2).stringValue", "'AXValue: line1'");
+
+    var line2 = accessibilityController.accessibleElementById("line2");
+    shouldBe("line2.childAtIndex(0).stringValue", "'AXValue: 2'");
+    shouldBe("line2.childAtIndex(1).stringValue", "'AXValue: :'");
+    shouldBe("line2.childAtIndex(2).stringValue", "'AXValue: line2'");
+
+    document.getElementById("container").style.display = "none";
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (139001 => 139002)


--- trunk/Source/WebCore/ChangeLog	2013-01-07 23:29:12 UTC (rev 139001)
+++ trunk/Source/WebCore/ChangeLog	2013-01-07 23:32:39 UTC (rev 139002)
@@ -1,3 +1,17 @@
+2013-01-07  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: the text of render counters are not exposed to Accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=103794
+
+        Reviewed by Ryosuke Niwa.
+
+        Support RenderText objects that don't have nodes (like RenderCounter).
+
+        Test: accessibility/render-counter-text.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textUnderElement):
+
 2013-01-07  Tim Horton  <timothy_hor...@apple.com>
 
         Tiled-layer TileCaches shouldn't unparent offscreen tiles

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (139001 => 139002)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-01-07 23:29:12 UTC (rev 139001)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2013-01-07 23:32:39 UTC (rev 139002)
@@ -669,10 +669,12 @@
         }
     
         // Sometimes text fragments don't have Nodes associated with them (like when
-        // CSS content is used to insert text).
+        // CSS content is used to insert text or when a RenderCounter is used.)
         RenderText* renderTextObject = toRenderText(m_renderer);
         if (renderTextObject->isTextFragment())
             return String(static_cast<RenderTextFragment*>(m_renderer)->contentString());
+        else
+            return String(renderTextObject->text());
     }
     
     return AccessibilityNodeObject::textUnderElement();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to