Title: [166917] trunk
Revision
166917
Author
cfleiz...@apple.com
Date
2014-04-08 00:59:22 -0700 (Tue, 08 Apr 2014)

Log Message

Regression: AX: image labels no longer exposed to AX API in SVG test case
https://bugs.webkit.org/show_bug.cgi?id=131208

Reviewed by Daniel Bates.

Source/WebCore: 

accessibleNameForNode should work on any Element, not just HTML elements.

Test: accessibility/svg-labelledby.html

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

LayoutTests: 

* accessibility/svg-labelledby-expected.txt: Added.
* accessibility/svg-labelledby.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (166916 => 166917)


--- trunk/LayoutTests/ChangeLog	2014-04-08 07:37:37 UTC (rev 166916)
+++ trunk/LayoutTests/ChangeLog	2014-04-08 07:59:22 UTC (rev 166917)
@@ -1,3 +1,13 @@
+2014-04-07  Chris Fleizach  <cfleiz...@apple.com>
+
+        Regression: AX: image labels no longer exposed to AX API in SVG test case
+        https://bugs.webkit.org/show_bug.cgi?id=131208
+
+        Reviewed by Daniel Bates.
+
+        * accessibility/svg-labelledby-expected.txt: Added.
+        * accessibility/svg-labelledby.html: Added.
+
 2014-04-07  Martin Robinson  <mrobin...@igalia.com>
 
         Skipped some HighDPI tests for GTK+

Added: trunk/LayoutTests/accessibility/svg-labelledby-expected.txt (0 => 166917)


--- trunk/LayoutTests/accessibility/svg-labelledby-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/svg-labelledby-expected.txt	2014-04-08 07:59:22 UTC (rev 166917)
@@ -0,0 +1,11 @@
+
+This tests that aria-labelledby works on SVG elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+SVG Element: AXDescription: Sudan
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/svg-labelledby.html (0 => 166917)


--- trunk/LayoutTests/accessibility/svg-labelledby.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/svg-labelledby.html	2014-04-08 07:59:22 UTC (rev 166917)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+<g>
+<path xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="label_Sudan" id="Sudan" class="land sd" d="M463.9996,262.5474 C464.6068,261.08 464.8456,259.8488 466.2004,258.8924 C467.4688,257.9972 468.4984,257.3418 467.6728,255.7866 C465.5044,251.7018 467.4568,250.881 470.4796,248.463 C469.6648,247.6832 468.3076,244.3892 469.6348,243.686 C471.7432,242.5664 472.0024,240.5502 473.458,238.6974 C475.2736,236.3838 472.2136,234.2072 475.1188,232.7696">
+   <set attributeName="opacity" from="1" to="0.5" begin="mouseover" end="mouseout"/>
+</path>
+</g>
+
+<text xmlns="http://www.w3.org/2000/svg" id="label_Sudan" x="80" y="790" font-size="24" visibility="hidden">
+   Sudan
+   <set attributeName="visibility" from="hidden" to="visible" begin="Sudan.mouseover" end="Sudan.mouseout"/>
+  </text>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that aria-labelledby works on SVG elements.");
+
+    if (window.accessibilityController) {
+        var image = accessibilityController.accessibleElementById("Sudan");
+        debug("SVG Element: " + image.description);
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (166916 => 166917)


--- trunk/Source/WebCore/ChangeLog	2014-04-08 07:37:37 UTC (rev 166916)
+++ trunk/Source/WebCore/ChangeLog	2014-04-08 07:59:22 UTC (rev 166917)
@@ -1,3 +1,17 @@
+2014-04-07  Chris Fleizach  <cfleiz...@apple.com>
+
+        Regression: AX: image labels no longer exposed to AX API in SVG test case
+        https://bugs.webkit.org/show_bug.cgi?id=131208
+
+        Reviewed by Daniel Bates.
+
+        accessibleNameForNode should work on any Element, not just HTML elements.
+
+        Test: accessibility/svg-labelledby.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::accessibleNameForNode):
+
 2014-04-08  Andres Gomez  <ago...@igalia.com>
 
         [GTK] [EFL] Build fails with GCC < 4.8.x

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (166916 => 166917)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-04-08 07:37:37 UTC (rev 166916)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2014-04-08 07:59:22 UTC (rev 166917)
@@ -1848,11 +1848,11 @@
 // ARIA Implementer's Guide.                                                                                            
 static String accessibleNameForNode(Node* node)
 {
-    if (!node->isHTMLElement())
+    assert(node);
+    if (!node || !node->isElementNode())
         return String();
     
-    HTMLElement* element = toHTMLElement(node);
-    
+    Element* element = toElement(node);
     const AtomicString& ariaLabel = element->fastGetAttribute(aria_labelAttr);
     if (!ariaLabel.isEmpty())
         return ariaLabel;
@@ -1870,8 +1870,8 @@
     String text;
     if (axObject)
         text = axObject->textUnderElement();
-    else if (node->isElementNode())
-        text = toElement(node)->innerText();
+    else
+        text = element->innerText();
     
     if (!text.isEmpty())
         return text;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to