Title: [173459] trunk
Revision
173459
Author
[email protected]
Date
2014-09-10 07:47:00 -0700 (Wed, 10 Sep 2014)

Log Message

AX: aria-labelledby is not honoring sub-node text
https://bugs.webkit.org/show_bug.cgi?id=136689

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Test: accessibility/aria-labelledby-with-descendants.html

When aria-labelledby retrieves the textUnderElements it needs to consider
all sub-children, including focusable content.

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

LayoutTests:

* accessibility/aria-labelledby-with-descendants-expected.txt: Added.
* accessibility/aria-labelledby-with-descendants.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (173458 => 173459)


--- trunk/LayoutTests/ChangeLog	2014-09-10 13:23:42 UTC (rev 173458)
+++ trunk/LayoutTests/ChangeLog	2014-09-10 14:47:00 UTC (rev 173459)
@@ -1,3 +1,13 @@
+2014-09-10  Chris Fleizach  <[email protected]>
+
+        AX: aria-labelledby is not honoring sub-node text
+        https://bugs.webkit.org/show_bug.cgi?id=136689
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/aria-labelledby-with-descendants-expected.txt: Added.
+        * accessibility/aria-labelledby-with-descendants.html: Added.
+
 2014-09-09  Jer Noble  <[email protected]>
 
         [MSE] http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html failing after r173318

Added: trunk/LayoutTests/accessibility/aria-labelledby-with-descendants-expected.txt (0 => 173459)


--- trunk/LayoutTests/accessibility/aria-labelledby-with-descendants-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/aria-labelledby-with-descendants-expected.txt	2014-09-10 14:47:00 UTC (rev 173459)
@@ -0,0 +1,10 @@
+This tests that if aria-labelledby is pointing to nodes with descendants, it returns all text.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+aria-labelledby description: AXDescription: hello link world test1 test2 test3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/aria-labelledby-with-descendants.html (0 => 173459)


--- trunk/LayoutTests/accessibility/aria-labelledby-with-descendants.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/aria-labelledby-with-descendants.html	2014-09-10 14:47:00 UTC (rev 173459)
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="content">
+
+<div aria-labelledby="a b" id="group" role="group">
+group text
+</div>
+
+<div id="a">
+hello <a href="" world
+</div>
+
+<div id="b">
+<button>test1</button> 
+<p tabindex=0>test2 <span aria-hidden="true">hidden</span> test3</p>
+</div>
+
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that if aria-labelledby is pointing to nodes with descendants, it returns all text.");
+
+    if (window.accessibilityController) {
+          var group = accessibilityController.accessibleElementById("group");
+          debug("aria-labelledby description: " + group.description);
+          document.getElementById("content").style.visibility = "hidden";
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (173458 => 173459)


--- trunk/Source/WebCore/ChangeLog	2014-09-10 13:23:42 UTC (rev 173458)
+++ trunk/Source/WebCore/ChangeLog	2014-09-10 14:47:00 UTC (rev 173459)
@@ -1,3 +1,18 @@
+2014-09-10  Chris Fleizach  <[email protected]>
+
+        AX: aria-labelledby is not honoring sub-node text
+        https://bugs.webkit.org/show_bug.cgi?id=136689
+
+        Reviewed by Mario Sanchez Prada.
+
+        Test: accessibility/aria-labelledby-with-descendants.html
+
+        When aria-labelledby retrieves the textUnderElements it needs to consider
+        all sub-children, including focusable content.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::accessibleNameForNode):
+
 2014-09-10  Gyuyoung Kim  <[email protected]>
 
         Use toDocument instead of static_cast<Document*>

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (173458 => 173459)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-09-10 13:23:42 UTC (rev 173458)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-09-10 14:47:00 UTC (rev 173459)
@@ -1857,7 +1857,7 @@
     AccessibilityObject* axObject = node->document().axObjectCache()->getOrCreate(node);
     String text;
     if (axObject)
-        text = axObject->textUnderElement();
+        text = axObject->textUnderElement(AccessibilityTextUnderElementMode(AccessibilityTextUnderElementMode::TextUnderElementModeSkipIgnoredChildren, true));
     else
         text = element->innerText();
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to