Title: [151079] trunk
Revision
151079
Author
[email protected]
Date
2013-06-01 21:42:57 -0700 (Sat, 01 Jun 2013)

Log Message

WebKit ignores aria-hidden when traversing nodes for name calculation
https://bugs.webkit.org/show_bug.cgi?id=117101

Reviewed by Tim Horton.

Source/WebCore:

When calculating the inner text, aria-hidden should be considered.

Test: accessibility/text-role-with-aria-hidden-inside.html

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

LayoutTests:

* accessibility/text-role-with-aria-hidden-inside-expected.txt: Added.
* accessibility/text-role-with-aria-hidden-inside.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (151078 => 151079)


--- trunk/LayoutTests/ChangeLog	2013-06-01 23:41:23 UTC (rev 151078)
+++ trunk/LayoutTests/ChangeLog	2013-06-02 04:42:57 UTC (rev 151079)
@@ -1,3 +1,13 @@
+2013-06-01  Chris Fleizach  <[email protected]>
+
+        WebKit ignores aria-hidden when traversing nodes for name calculation
+        https://bugs.webkit.org/show_bug.cgi?id=117101
+
+        Reviewed by Tim Horton.
+
+        * accessibility/text-role-with-aria-hidden-inside-expected.txt: Added.
+        * accessibility/text-role-with-aria-hidden-inside.html: Added.
+
 2013-05-31  Gyuyoung Kim  <[email protected]>
 
         Unreviewed, EFL gardening. Remove passed accessibility test from EFL WK1.

Added: trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside-expected.txt (0 => 151079)


--- trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside-expected.txt	2013-06-02 04:42:57 UTC (rev 151079)
@@ -0,0 +1,10 @@
+This tests that when calculating the text under an element, aria-hidden is observed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text.stringValue is 'AXValue: Song TitleArtist Name(4 stars, 1,234 ratings) '
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside.html (0 => 151079)


--- trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/text-role-with-aria-hidden-inside.html	2013-06-02 04:42:57 UTC (rev 151079)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+<div id="content">
+
+<div role="text" id="text">
+	<div>Song Title</div>
+	<div>Artist Name</div>
+	<span role="text" aria-label="(4 stars, 1,234 ratings)">★★★★☆</span>
+	<span aria-hidden="true">(1,234)</span>
+</div>
+</div>
+
+<div id="console"></div>
+<script>
+
+description("This tests that when calculating the text under an element, aria-hidden is observed.")
+
+if (window.testRunner && window.accessibilityController) {
+    var text = accessibilityController.accessibleElementById("text");
+    shouldBe("text.stringValue", "'AXValue: Song TitleArtist Name(4 stars, 1,234 ratings) '");
+    document.getElementById("content").style.visibility = 'hidden';    
+}
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (151078 => 151079)


--- trunk/Source/WebCore/ChangeLog	2013-06-01 23:41:23 UTC (rev 151078)
+++ trunk/Source/WebCore/ChangeLog	2013-06-02 04:42:57 UTC (rev 151079)
@@ -1,3 +1,17 @@
+2013-06-01  Chris Fleizach  <[email protected]>
+
+        WebKit ignores aria-hidden when traversing nodes for name calculation
+        https://bugs.webkit.org/show_bug.cgi?id=117101
+
+        Reviewed by Tim Horton.
+
+        When calculating the inner text, aria-hidden should be considered.
+
+        Test: accessibility/text-role-with-aria-hidden-inside.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::shouldUseAccessiblityObjectInnerText):
+
 2013-06-01  Darin Adler  <[email protected]>
 
         window.speechSynthesis needs to be cheap

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (151078 => 151079)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-01 23:41:23 UTC (rev 151078)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2013-06-02 04:42:57 UTC (rev 151079)
@@ -1497,6 +1497,9 @@
     // quite long. As a heuristic, skip links, controls, and elements that are usually
     // containers with lots of children.
 
+    if (equalIgnoringCase(obj->getAttribute(aria_hiddenAttr), "true"))
+        return false;
+    
     // If something doesn't expose any children, then we can always take the inner text content.
     // This is what we want when someone puts an <a> inside a <button> for example.
     if (obj->isDescendantOfBarrenParent())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to