AX: Implement missing/different accessibility API mappings for SVG
https://bugs.webkit.org/show_bug.cgi?id=155034
Reviewed by Chris Fleizach.
Source/WebCore:
Create an AccessibilitySVGElement class for the SVG-specific mappings;
fix name and description mappings for ATK; add new AccessibilityRole
types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
ATK and AX API.
Tests: accessibility/w3c-svg-description-calculation.html
accessibility/w3c-svg-elements-not-exposed.html
accessibility/w3c-svg-name-calculation.html
accessibility/w3c-svg-presentational-role.html
accessibility/w3c-svg-roles.html
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityAllInOne.cpp:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText): Deleted.
(WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isAccessibilitySVGElement):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
* accessibility/AccessibilitySVGElement.cpp: Added.
(WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
(WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
(WebCore::AccessibilitySVGElement::create):
(WebCore::AccessibilitySVGElement::targetForUseElement):
(WebCore::AccessibilitySVGElement::accessibilityText):
(WebCore::AccessibilitySVGElement::accessibilityDescription):
(WebCore::AccessibilitySVGElement::helpText):
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
(WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
(WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
(WebCore::AccessibilitySVGElement::determineAccessibilityRole):
* accessibility/AccessibilitySVGElement.h: Added.
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
* rendering/RenderObject.h:
(WebCore::RenderObject::isSVGTSpan):
* rendering/svg/RenderSVGTSpan.h:
LayoutTests:
* accessibility/svg-group-element-with-title.html: Modified to reflect correct ATK results.
* accessibility/svg-image.html: Modified to reflect correct ATK results.
* accessibility/svg-labelledby.html: Modified to reflect correct ATK results.
* accessibility/svg-remote-element.html: Modified to reflect correct ATK results.
* accessibility/w3c-svg-description-calculation.html: Added.
* accessibility/w3c-svg-elements-not-exposed.html: Added.
* accessibility/w3c-svg-name-calculation.html: Added.
* accessibility/w3c-svg-presentational-role.html: Added.
* accessibility/w3c-svg-roles.html: Added.
* platform/gtk/accessibility/svg-group-element-with-title-expected.txt: Added.
* platform/gtk/accessibility/svg-image-expected.txt: Added.
* platform/gtk/accessibility/svg-labelledby-expected.txt: Added.
* platform/gtk/accessibility/svg-remote-element-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt: Added.
* platform/gtk/accessibility/w3c-svg-roles-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-description-calculation-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-name-calculation-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-presentational-role-expected.txt: Added.
* platform/mac/accessibility/w3c-svg-roles-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 05b4544..39a084e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,34 @@
+2016-03-05 Joanmarie Diggs <jdiggs@igalia.com>
+
+ AX: Implement missing/different accessibility API mappings for SVG
+ https://bugs.webkit.org/show_bug.cgi?id=155034
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/svg-group-element-with-title.html: Modified to reflect correct ATK results.
+ * accessibility/svg-image.html: Modified to reflect correct ATK results.
+ * accessibility/svg-labelledby.html: Modified to reflect correct ATK results.
+ * accessibility/svg-remote-element.html: Modified to reflect correct ATK results.
+ * accessibility/w3c-svg-description-calculation.html: Added.
+ * accessibility/w3c-svg-elements-not-exposed.html: Added.
+ * accessibility/w3c-svg-name-calculation.html: Added.
+ * accessibility/w3c-svg-presentational-role.html: Added.
+ * accessibility/w3c-svg-roles.html: Added.
+ * platform/gtk/accessibility/svg-group-element-with-title-expected.txt: Added.
+ * platform/gtk/accessibility/svg-image-expected.txt: Added.
+ * platform/gtk/accessibility/svg-labelledby-expected.txt: Added.
+ * platform/gtk/accessibility/svg-remote-element-expected.txt: Added.
+ * platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt: Added.
+ * platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
+ * platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt: Added.
+ * platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt: Added.
+ * platform/gtk/accessibility/w3c-svg-roles-expected.txt: Added.
+ * platform/mac/accessibility/w3c-svg-description-calculation-expected.txt: Added.
+ * platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt: Added.
+ * platform/mac/accessibility/w3c-svg-name-calculation-expected.txt: Added.
+ * platform/mac/accessibility/w3c-svg-presentational-role-expected.txt: Added.
+ * platform/mac/accessibility/w3c-svg-roles-expected.txt: Added.
+
2016-03-04 Ryosuke Niwa <rniwa@webkit.org>
Add basic support for attributeChanged lifecycle callback
diff --git a/LayoutTests/accessibility/svg-group-element-with-title.html b/LayoutTests/accessibility/svg-group-element-with-title.html
index 202daed..17cf738 100644
--- a/LayoutTests/accessibility/svg-group-element-with-title.html
+++ b/LayoutTests/accessibility/svg-group-element-with-title.html
@@ -24,7 +24,10 @@
debug("Verify that the SVG group is returned as an accessible element.");
var group1 = accessibilityController.accessibleElementById("group1");
shouldBe("group1.role", "'AXRole: AXGroup'");
- shouldBe("group1.description", "'AXDescription: SVG TITLE 1'");
+ if (accessibilityController.platformName == "atk")
+ shouldBe("group1.title", "'AXTitle: SVG TITLE 1'");
+ else
+ shouldBe("group1.description", "'AXDescription: SVG TITLE 1'");
debug("\nVerify that you can hit-test to the SVG group.");
var hitTestElement = group1.elementAtPoint(group1.clickPointX, group1.clickPointY);
diff --git a/LayoutTests/accessibility/svg-image.html b/LayoutTests/accessibility/svg-image.html
index 0d7e194..ad56c34 100644
--- a/LayoutTests/accessibility/svg-image.html
+++ b/LayoutTests/accessibility/svg-image.html
@@ -27,10 +27,16 @@
document.getElementById("svgimage").focus();
var svgImage = accessibilityController.focusedElement;
shouldBe("svgImage.role", "realImage.role");
- shouldBe("svgImage.description", "realImage.description");
+ if (accessibilityController.platformName == "atk")
+ shouldBe("svgImage.title", "realImage.title");
+ else
+ shouldBe("svgImage.description", "realImage.description");
debug("SVG Image Role: " + svgImage.role);
- debug("SVG Image Description: " + svgImage.description);
+ if (accessibilityController.platformName == "atk")
+ debug("SVG Image Title: " + svgImage.title);
+ else
+ debug("SVG Image Description: " + svgImage.description);
}
</script>
diff --git a/LayoutTests/accessibility/svg-labelledby.html b/LayoutTests/accessibility/svg-labelledby.html
index 67fbf2a..d1d398f 100644
--- a/LayoutTests/accessibility/svg-labelledby.html
+++ b/LayoutTests/accessibility/svg-labelledby.html
@@ -28,7 +28,10 @@
if (window.accessibilityController) {
var image = accessibilityController.accessibleElementById("Sudan");
- debug("SVG Element: " + image.description);
+ if (accessibilityController.platformName == "atk")
+ debug("SVG Element: " + image.title);
+ else
+ debug("SVG Element: " + image.description);
}
</script>
diff --git a/LayoutTests/accessibility/svg-remote-element.html b/LayoutTests/accessibility/svg-remote-element.html
index fc55279..ace265e 100644
--- a/LayoutTests/accessibility/svg-remote-element.html
+++ b/LayoutTests/accessibility/svg-remote-element.html
@@ -21,6 +21,10 @@
return element.clickPointY - element.height/2;
}
+function label(axElement) {
+ return accessibilityController.platformName == "atk" ? axElement.title : axElement.description;
+}
+
function runAXTest() {
var container = accessibilityController.accessibleElementById("svg-image");
@@ -31,28 +35,28 @@
var face = container.childAtIndex(0);
debug('Face role: ' + face.role);
- debug('Face label: ' + face.description);
+ debug('Face label: ' + label(face));
debug('FaceX: ' + (pageX(face) - x));
debug('FaceY: ' + Math.abs(pageY(face) - y));
debug('<br>');
var eye = container.childAtIndex(1);
debug('Eye role: ' + eye.role);
- debug('Eye label: ' + eye.description);
+ debug('Eye label: ' + label(eye));
debug('EyeX: ' + (pageX(eye) - x));
debug('EyeY: ' + Math.abs(pageY(eye) - y));
debug('<br>');
var nose = container.childAtIndex(3);
debug('Nose role: ' + nose.role);
- debug('Nose label: ' + nose.description);
+ debug('Nose label: ' + label(nose));
debug('NoseX: ' + (pageX(nose) - x));
debug('NoseY: ' + Math.abs(pageY(nose) - y));
debug('<br>');
var mouth = container.childAtIndex(4);
debug('Mouth role: ' + mouth.role);
- debug('Mouth label: ' + mouth.description);
+ debug('Mouth label: ' + label(mouth));
debug('MouthX: ' + (pageX(mouth) - x));
debug('MouthY: ' + Math.floor(Math.abs(pageY(mouth) - y)));
debug('<br>');
diff --git a/LayoutTests/accessibility/w3c-svg-description-calculation.html b/LayoutTests/accessibility/w3c-svg-description-calculation.html
new file mode 100644
index 0000000..50ae155
--- /dev/null
+++ b/LayoutTests/accessibility/w3c-svg-description-calculation.html
@@ -0,0 +1,305 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<div id="content">
+<svg>
+ <circle id="test1" aria-describedby="t1" cx="50" cy="100" r="15" data-expected="description: end">
+ <title>abc</title>
+ <desc>123</desc>
+ </circle>
+ <text id="t1" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test2" aria-describedby="t2" cx="50" cy="100" r="15" data-expected="description: end">
+ <desc>123</desc>
+ </circle>
+ <text id="t2" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test3" aria-describedby="t3" cx="50" cy="100" r="15" data-expected="description: end">
+ <title>abc</title>
+ </circle>
+ <text id="t3" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test4" aria-describedby="t4" cx="50" cy="100" r="15" data-expected="description: end"/>
+ <text id="t4" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test5" cx="50" cy="100" r="15" data-expected="description: 123">
+ <title>abc</title>
+ <desc>123</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test6" cx="50" cy="100" r="15" data-expected="description: 123">
+ <desc>123</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test7" aria-describedby="t7" cx="50" cy="100" r="15" data-expected="description: end">
+ <title>abc</title>
+ <desc lang="en">123</desc>
+ <desc lang="es">456</desc>
+ </circle>
+ <text id="t7" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test8" cx="50" cy="100" r="15" data-expected="description: 554">
+ <title lang="en">abc</title>
+ <title lang="de">def</title>
+ <desc lang="fr">123</desc>
+ <desc lang="en">554</desc>
+ <desc lang="es">432</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test9" cx="50" cy="100" r="15" data-expected="description: 567">
+ <desc lang="es">432</desc>
+ <desc lang="fr">123</desc>
+ <desc lang="en">567</desc>
+ </circle>
+</svg>
+<svg>
+ <g lang="fr">
+ <circle id="test10" cx="50" cy="100" r="15" data-expected="description: 123">
+ <title lang="en">abc</title>
+ <title lang="de">def</title>
+ <desc lang="fr">123</desc>
+ <desc lang="en">554</desc>
+ <desc lang="es">432</desc>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <g lang="fr">
+ <circle id="test11" cx="50" cy="100" r="15" data-expected="description: 123">
+ <desc lang="es">432</desc>
+ <desc lang="fr">123</desc>
+ <desc lang="en">567</desc>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <circle id="test12" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 123">
+ <title>abc</title>
+ <desc>123</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test13" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 12">
+ <desc>12</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test14" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test15" aria-describedby="" cx="50" cy="100" r="15" tabindex="0" data-expected="description: (empty)"/>
+</svg>
+<svg>
+ <circle id="test16" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 222">
+ <title>abc</title>
+ <desc lang="fr">123</desc>
+ <desc lang="en">222</desc>
+ <desc lang="es">432</desc>
+ </circle>
+</svg>
+<svg>
+ <circle id="test17" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 911">
+ <desc lang="fr">123</desc>
+ <desc lang="es">444</desc>
+ <desc lang="en">911</desc>
+ </circle>
+</svg>
+<svg>
+ <g lang="fr">
+ <circle id="test18" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 123">
+ <title>abc</title>
+ <desc lang="fr">123</desc>
+ <desc lang="en">222</desc>
+ <desc lang="es">432</desc>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <g lang="fr">
+ <circle id="test19" aria-describedby="" cx="50" cy="100" r="15" data-expected="description: 123">
+ <desc lang="es">444</desc>
+ <desc lang="fr">123</desc>
+ <desc lang="en">911</desc>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <circle id="test20" aria-describedby="t20a t20b" cx="50" cy="100" r="15" data-expected="description: the end"/>
+ <text id="t20a" x="40" y="90">the</text>
+ <text id="t20b" x="140" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test21" aria-describedby="t21a t21b" cx="50" cy="100" r="15" data-expected="description: the end"/>
+ <text id="t21a" x="40" y="90">the</text>
+ <text id="t21b" x="140" y="90" aria-describedby="t2c">end</text>
+ <text id="t21c" x="180" y="90">finish</text>
+</svg>
+<svg>
+ <circle id="test22" aria-describedby="t22a t22b" cx="50" cy="100" r="15" data-expected="description: end"/>
+ <text id="t22b" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test23" aria-labelledby="t23" cx="50" cy="100" r="15" data-expected="description: abc">
+ <title>abc</title>
+ </circle>
+ <text id="t23" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test24" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: abc">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test25" aria-labelledby="t25" cx="50" cy="100" r="15" data-expected="description: counter">
+ <title lang="es">barra</title>
+ <title lang="en">counter</title>
+ <title lang="fr">guichet</title>
+ </circle>
+ <text id="t25" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test26" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: counter">
+ <title lang="fr">guichet</title>
+ <title lang="es">barra</title>
+ <title lang="en">counter</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test27" aria-labelledby="t27" cx="50" cy="100" r="15" lang="es" data-expected="description: barra">
+ <title lang="es">barra</title>
+ <title lang="en">counter</title>
+ <title lang="fr">guichet</title>
+ </circle>
+ <text id="t27" x="40" y="90">end</text>
+</svg>
+<svg>
+ <g lang="es" aria-label="hola">
+ <circle id="test28" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: barra">
+ <title lang="fr">guichet</title>
+ <title lang="es">barra</title>
+ <title lang="en">counter</title>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <circle id="test29" aria-labelledby="t29" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title>abc</title>
+ </circle>
+ <text id="t29" x="40" y="90">abc</text>
+</svg>
+<svg>
+ <circle id="test30" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title>bob</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test31" aria-labelledby="t31" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title lang="es">soy</title>
+ <title lang="en">abc</title>
+ <title lang="fr">le</title>
+ </circle>
+ <text id="t31" x="40" y="90">abc</text> then accessible description = BLANK
+</svg>
+<svg>
+ <circle id="test32" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title lang="en">bob</title>
+ <title lang="fr">dan</title>
+ <title lang="es">juan</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test33" aria-label="bob" cx="50" cy="100" r="15" data-expected="description: (empty)">
+ <title lang="fr">dan</title>
+ <title lang="es">juan</title>
+ <title lang="en">bob</title>
+ </circle>
+</svg>
+<svg>
+ <a id="test34" aria-labelledby="t34" aria-label="booth" href="../index.html" xlink:title="table" data-expected="description: (empty)"></a>
+ <text id="t34" x="40" y="90">end</text>
+</svg>
+<svg>
+ <a id="test35" aria-labelledby="t35" href="../index.html" xlink:title="table" data-expected="description: (empty)"></a>
+ <text id="t35" x="40" y="90">end</text>
+</svg>
+<svg>
+ <a id="test36" aria-label="booth" href="../index.html" xlink:title="table" data-expected="description: (empty)"></a>
+</svg>
+<svg>
+ <a id="test37" href="../index.html" xlink:title="table" data-expected="description: (empty)">
+ <title>counter</title>
+ </a>
+</svg>
+<svg>
+ <a id="test38" href="../index.html" xlink:title="table" data-expected="description: (empty)"></a>
+</svg>
+<svg>
+ <ellipse id="test39" cx="10" cy="100" rx="25" ry="15" data-expected="description: (empty)">
+ <title></title>
+ <desc></desc>
+ </ellipse>
+</svg>
+<svg>
+ <circle id="test40" cx="10" cy="10" r="5" data-expected="description: (empty)">
+ <title></title>
+ <desc> </desc>
+ </circle>
+</svg>
+<svg>
+ <line id="test41" x1="10" y1="10" x2="50" y2="10" data-expected="description: (empty)">
+ <title> </title>
+ <desc> </desc>
+ </line>
+</svg>
+<svg>
+ <polygon id="test42" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5" data-expected="description: (empty)">
+ <desc></desc>
+ </polygon>
+</svg>
+<svg>
+ <rect id="test43" x="10" y="10" width="50" height="30" data-expected="description: (empty)">
+ <desc> </desc>
+ </rect>
+</svg>
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ function textAlternatives(axElement) {
+ if (!axElement)
+ return "Element not exposed";
+
+ result = axElement.title + "\n\t" + axElement.description;
+ if (accessibilityController.platformName == "mac")
+ result += "\n\t" + axElement.helpText;
+ return result;
+ }
+
+ description("This tests the accessible text alternatives results for SVG.");
+ if (window.accessibilityController) {
+ for (var i = 1; i <= 43; i++) {
+ var element = document.getElementById("test" + i);
+ var axElement = accessibilityController.accessibleElementById("test" + i);
+ var result = textAlternatives(axElement);
+ debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n\t" + result);
+ }
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/accessibility/w3c-svg-elements-not-exposed.html b/LayoutTests/accessibility/w3c-svg-elements-not-exposed.html
new file mode 100644
index 0000000..c1c80d7
--- /dev/null
+++ b/LayoutTests/accessibility/w3c-svg-elements-not-exposed.html
@@ -0,0 +1,323 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<div id="content">
+<svg>
+ <rect x="5" y="5" width="20" height="15">
+ <animate id="test1" attributeName="opacity" from="1" to="0" dur="5s" repeatCount="indefinite"/>
+ </rect>
+</svg>
+<svg>
+ <path id="path2" d="M100,250 C 100,50 400,50 400,222" fill="none" stroke="blue" stroke-width="7.06" />
+ <path d="M-25,-12.5 L25,-12.5 L 0,-87.5 z" fill="yellow" stroke="red" stroke-width="7.06">
+ <animateMotion id="test2" dur="6s" repeatCount="indefinite" rotate="auto">
+ <mpath href="#path2"/>
+ </animateMotion>
+ </path>
+</svg>
+<svg>
+ <rect width="100" height="100">
+ <animateTransform id="test3" attributeName="transform" type="scale" from="2" to="3" repeatCount="3" dur="4s" fill="freeze"/>
+ </rect>
+</svg>
+<svg>
+ <defs>
+ <clipPath id="test4">
+ <rect x="0" y="0" width="200" height="100"/>
+ </clipPath>
+ </defs>
+ <circle cx="100" cy="100" r="100" clip-path="url(#test4)" />
+</svg>
+<svg>
+ <cursor id="test5" xlink:href="cursor.png" x="4" y="0"/>
+</svg>
+<svg>
+ <defs id="test6">
+ <solidColor id="MyLightPurple" solid-color="#a080ff" solid-opacity="0.5"/>
+ </defs>
+</svg>
+<svg>
+ <ellipse cx="98.5" cy="17.5" rx="20.5" ry="17.5" fill="blue" stroke="black" transform="translate(9 252) translate(3 -296)">
+ <animateTransform attributeName="transform" begin="0s" dur="2s" fill="remove" calcMode="linear" type="translate" additive="sum" from="0 0" to="-18 305"/>
+ <discard id="test7" begin="2s"/>
+ </ellipse>
+</svg>
+<svg>
+ <hatch id="test8" hatchUnits="userSpaceOnUse" pitch="5" rotate="17">
+ <hatchpath stroke="#a080ff" stroke-width="2"/>
+ </hatch>
+</svg>
+<svg>
+ <hatch hatchUnits="userSpaceOnUse" pitch="5" rotate="17">
+ <hatchpath id="test9" stroke="#a080ff" stroke-width="2"/>
+ </hatch>
+</svg>
+<svg>
+ <defs>
+ <linearGradient id="test10">
+ <stop offset="5%" stop-color="#A8F"/>
+ <stop offset="95%" stop-color="#FDC"/>
+ </linearGradient>
+ </defs>
+</svg>
+<svg>
+ <marker id="test11" orient="auto" overflow="visible">
+ <rect x="-1" y="-0.5" width="1" height="1" fill="green"/>
+ </marker>
+</svg>
+<svg>
+ <defs>
+ <linearGradient id="Gradient12">
+ <stop offset="0" stop-color="white" stop-opacity="0"/>
+ <stop offset="1" stop-color="white" stop-opacity="1"/>
+ </linearGradient>
+ <mask id="test12">
+ <rect x="0" y="0" width="200" height="200" fill="url(#Gradient12)"/>
+ </mask>
+ </defs>
+ <rect x="0" y="0" width="200" height="200" fill="red" mask="url(#test12)"/>
+</svg>
+<svg>
+ <mesh x="22" y="22" id="example13">
+ <meshrow>
+ <meshpatch id="test13">
+ <stop path="c 25,-25 75, 25 100,0" stop-color="lightblue"/>
+ <stop path="c 25, 25 -25, 75 0,100" stop-color="purple"/>
+ <stop path="c -25, 25 -75,-25 -100,0" stop-color="red"/>
+ <stop path="c -25,-25, 25,-75" stop-color="purple"/>
+ </meshpatch>
+ <meshpatch>
+ <stop path="c 25,-25 75, 25 100,0"/>
+ <stop path="c 25, 25 -25, 75 0,100" stop-color="lightblue"/>
+ <stop path="c -25, 25 -75,-25" stop-color="purple"/>
+ </meshpatch>
+ </meshrow>
+ <meshrow>
+ <meshpatch>
+ <stop path="c 25, 25 -25, 75 0,100"/>
+ <stop path="c -25, 25 -75,-25 -100,0" stop-color="purple"/>
+ <stop path="c -25,-25, 25,-75" stop-color="lightblue"/>
+ </meshpatch>
+ <meshpatch>
+ <stop path="c 25, 25 -25, 75 0,100"/>
+ <stop path="c -25, 25 -75,-25" stop-color="lightblue"/>
+ </meshpatch>
+ </meshrow>
+ </mesh>
+</svg>
+<svg>
+ <mesh x="22" y="22" id="example14">
+ <meshrow id="test14">
+ <meshpatch>
+ <stop path="c 25,-25 75, 25 100,0" stop-color="lightblue"/>
+ <stop path="c 25, 25 -25, 75 0,100" stop-color="purple"/>
+ <stop path="c -25, 25 -75,-25 -100,0" stop-color="red"/>
+ <stop path="c -25,-25, 25,-75" stop-color="purple"/>
+ </meshpatch>
+ <meshpatch>
+ <stop path="c 25,-25 75, 25 100,0"/>
+ <stop path="c 25, 25 -25, 75 0,100" stop-color="lightblue"/>
+ <stop path="c -25, 25 -75,-25" stop-color="purple"/>
+ </meshpatch>
+ </meshrow>
+ <meshrow>
+ <meshpatch>
+ <stop path="c 25, 25 -25, 75 0,100"/>
+ <stop path="c -25, 25 -75,-25 -100,0" stop-color="purple"/>
+ <stop path="c -25,-25, 25,-75" stop-color="lightblue"/>
+ </meshpatch>
+ <meshpatch>
+ <stop path="c 25, 25 -25, 75 0,100"/>
+ <stop path="c -25, 25 -75,-25" stop-color="lightblue"/>
+ </meshpatch>
+ </meshrow>
+ </mesh>
+</svg>
+<svg>
+ <metadata id="test15">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <rdf:Description about="http://example.org/myfoo" dc:title="MyFoo Financial Report" dc:language="en"></rdf:Description>
+ </rdf:RDF>
+ </metadata>
+</svg>
+<svg>
+ <path id="path16" d="M100,250 C 100,50 400,50 400,222" fill="none" stroke="blue" stroke-width="7.06"/>
+ <path d="M-25,-12.5 L25,-12.5 L 0,-87.5 z" fill="yellow" stroke="red" stroke-width="7.06">
+ <animateMotion dur="6s" repeatCount="indefinite" rotate="auto">
+ <mpath id="test16" xlink:href="#path16"/>
+ </animateMotion>
+ </path>
+</svg>
+<svg>
+ <pattern id="test17" x="10" y="10" width="20" height="20">
+ <rect x="5" y="5" width="10" height="10"/>
+ </pattern>
+</svg>
+<svg>
+ <radialGradient id="test18" gradientUnits="userSpaceOnUse" cx="122" cy="100" r="100">
+ <stop offset="0%" stop-color="#A8F"/>
+ <stop offset="50%" stop-color="#FDC"/>
+ <stop offset="100%" stop-color="#A8F"/>
+ </radialGradient>
+</svg>
+<svg>
+ <defs>
+ <solidColor id="test19" solid-color="#a080ff" solid-opacity="0.5"/>
+ </defs>
+</svg>
+<svg>
+ <defs>
+ <linearGradient id="lg20">
+ <stop id="test20" offset="5%" stop-color="#A8F"/>
+ <stop offset="95%" stop-color="#FDC"/>
+ </linearGradient>
+ </defs>
+</svg>
+<svg>
+ <style id="test21">@import url(mystyles.css);</style>
+</svg>
+<svg>
+ <symbol id="test22" viewBox="0 0 20 20">
+ <desc>MySymbol - four rectangles in a grid</desc>
+ <rect x="1" y="1" width="8" height="8"/>
+ <rect x="11" y="1" width="8" height="8"/>
+ <rect x="1" y="11" width="8" height="8"/>
+ <rect x="11" y="11" width="8" height="8"/>
+ </symbol>
+</svg>
+<svg>
+ <title id="test23">abc</title>
+</svg>
+<svg>
+ <path id="test24" d="M 100 100 L 300 100 L 200 300 z" fill="red" stroke="blue" stroke-width="3"/>
+</svg>
+<svg>
+ <rect id="test25" x="10" y="10" width="50" height="30"/>
+</svg>
+<svg>
+ <circle id="test26" cx="10" cy="10" r="5"/>
+</svg>
+<svg>
+ <ellipse id="test27" cx="10" cy="100" rx="25" ry="15"/>
+</svg>
+<svg>
+ <line id="test28" x1="10" y1="10" x2="50" y2="10"/>
+</svg>
+<svg>
+ <polyline id="test29" fill="none" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375"/>
+</svg>
+<svg>
+ <polygon id="test30" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5"/>
+</svg>
+<svg>
+ <defs>
+ <filter id="test31" filterUnits="userSpaceOnUse" x="0" y="0" width="200" height="120">
+ <feGaussianBlur id="test32" in="SourceAlpha" stdDeviation="4" result="blur"/>
+ <feOffset id="test33" in="blur" dx="4" dy="4" result="offsetBlur"/>
+ <feSpecularLighting id="test34" in="blur" surfaceScale="5" specularConstant=".75"
+ specularExponent="20" lighting-color="#bbbbbb"
+ result="specOut">
+ <fePointLight id="test35" x="-5000" y="-10000" z="20000"/>
+ </feSpecularLighting>
+ <feComposite id="test36" in="specOut" in2="SourceAlpha" operator="in" result="specOut"/>
+ <feComposite in="SourceGraphic" in2="specOut" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litPaint"/>
+ <feMerge id="test37">
+ <feMergeNode id="test38" in="offsetBlur"/>
+ <feMergeNode in="litPaint"/>
+ </feMerge>
+ </filter>
+ </defs>
+ <rect x="1" y="1" width="198" height="118" fill="#888888" stroke="blue"/>
+ <g filter="url(#test31)" >
+ <g>
+ <path fill="none" stroke="#D90000" stroke-width="10" d="M50,90 C0,90 0,30 50,30 L150,30 C200,30 200,90 150,90 z"/>
+ <path fill="#D90000" d="M60,80 C30,80 30,40 60,40 L140,40 C170,40 170,80 140,80 z"/>
+ <g fill="#FFFFFF" stroke="black" font-size="45" font-family="Verdana">
+ <text x="52" y="76">SVG</text>
+ </g>
+ </g>
+ </g>
+</svg>
+<svg>
+ <g aria-hidden="true">
+ <rect id="test39" aria-label="hello" x="10" y="10" width="50" height="30"/>
+ </g>
+</svg>
+<svg>
+ <g aria-hidden="true">
+ <ellipse id="test40" cx="10" cy="100" rx="25" ry="15">
+ <title>abc</title>
+ </ellipse>
+ </g>
+</svg>
+<svg>
+ <g aria-hidden="true">
+ <line id="test41" aria-label="hello" x1="10" y1="10" x2="50" y2="10"/>
+ </g>
+</svg>
+<svg>
+ <g aria-hidden="true">
+ <polyline id="test42" aria-label="hello" fill="none" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375"/>
+ </g>
+</svg>
+<svg>
+ <g aria-hidden="true">
+ <polygon id="test43" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5">
+ <desc>built up area</desc>
+ </polygon>
+ </g>
+</svg>
+<svg>
+ <rect id="test44" aria-label="hello" x="10" y="10" width="50" height="30" aria-hidden="true"/>
+</svg>
+<svg>
+ <ellipse id="test45" cx="10" cy="100" rx="25" ry="15" aria-hidden="true">
+ <title>abc</title>
+ </ellipse>
+</svg>
+<svg>
+ <line id="test46" aria-label="hello" x1="10" y1="10" x2="50" y2="10" aria-hidden="true"/>
+</svg>
+<svg>
+ <polyline id="test47" aria-label="hello" fill="none" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375" aria-hidden="true"/>
+</svg>
+<svg>
+ <polygon id="test48" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5" aria-hidden="true">
+ <desc>built up area</desc>
+ </polygon>
+</svg>
+<svg>
+ <circle cx="50" cy="50" r="40" id="test49" style="display: none;">
+ <title>Mars</title>
+ </circle>
+</svg>
+<svg>
+ <style>
+ /* <![CDATA[ */
+ circle {display: none; }
+ /* ]]> */
+ </style>
+ <circle cx="50" cy="50" r="40" id="test50">
+ <title>Mars</title>
+ </circle>
+</svg>
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ description("This tests that SVG elements which should not be exposed are not exposed.");
+ if (window.accessibilityController) {
+ for (var i = 1; i <= 50; i++) {
+ var element = document.getElementById("test" + i);
+ var axElement = accessibilityController.accessibleElementById("test" + i);
+ debug("test" + i + ": " + (axElement ? axElement.role : "Element not exposed"));
+ }
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/accessibility/w3c-svg-name-calculation.html b/LayoutTests/accessibility/w3c-svg-name-calculation.html
new file mode 100644
index 0000000..9d8dfdf
--- /dev/null
+++ b/LayoutTests/accessibility/w3c-svg-name-calculation.html
@@ -0,0 +1,336 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<div id="content">
+<svg>
+ <circle id="test1" aria-labelledby="t1" aria-label="bob" cx="50" cy="100" r="15" data-expected="name: end">
+ <title>abc</title>
+ </circle>
+ <text id="t1" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test2" aria-labelledby="t2" aria-label="bob" cx="50" cy="100" r="15" data-expected="name: end"/>
+ <text id="t2" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test3" aria-labelledby="t3" cx="50" cy="100" r="15" data-expected="name: end">
+ <title>abc</title>
+ </circle>
+ <text id="t3" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test4" aria-labelledby="t4" cx="50" cy="100" r="15" data-expected="name: end"/>
+ <text id="t4" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test5" aria-label="hello" cx="10" cy="10" r="5" data-expected="name: hello">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test6" aria-label="hello" cx="10" cy="10" r="5" data-expected="name: hello"/>
+</svg>
+<svg>
+ <circle id="test7" cx="10" cy="100" r="5" data-expected="name: abc">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test8" cx="10" cy="100" r="5" data-expected="name: hi">
+ <title lang="es">hola</title>
+ <title lang="en">hi</title>
+ <title lang="de">Hallo</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test9" cx="10" cy="100" r="5" data-expected="name: hi">
+ <title lang="en">hi</title>
+ <title lang="es">hola</title>
+ <title lang="de">Hallo</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test10" cx="10" cy="100" r="5" data-expected="name: hi">
+ <title lang="es">hola</title>
+ <title lang="de">Hallo</title>
+ <title lang="en">hi</title>
+ </circle>
+</svg>
+<svg>
+ <g lang="es">
+ <circle id="test11" cx="10" cy="100" r="5" data-expected="name: hola">
+ <title lang="es">hola</title>
+ <title lang="en">hi</title>
+ <title lang="de">Hallo</title>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <g lang="es" aria-label="123">
+ <circle id="test12" cx="10" cy="100" r="5" data-expected="name: hola">
+ <title lang="en">hi</title>
+ <title lang="es">hola</title>
+ <title lang="de">Hallo</title>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <g lang="es" aria-label="123">
+ <circle id="test13" cx="10" cy="100" r="5" data-expected="name: hola">
+ <title lang="es">hola</title>
+ <title lang="de">Hallo</title>
+ <title lang="en">hi</title>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <circle id="test14" aria-labelledby="" aria-label="bob" cx="50" cy="100" r="15" data-expected="name: bob">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test15" aria-labelledby="" aria-label="bob" cx="50" cy="100" r="15" data-expected="name: bob"/>
+</svg>
+<svg>
+ <circle id="test16" aria-labelledby="" cx="50" cy="100" r="15" data-expected="name: abc">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test17" aria-labelledby="" cx="50" cy="100" r="15" tabindex="0" data-expected="name: (empty)"/>
+</svg>
+<svg>
+ <circle id="test18" aria-labelledby="" cx="50" cy="100" r="15" data-expected="name: waz up">
+ <title lang="es">hola</title>
+ <title lang="fr">bonjour</title>
+ <title lang="en">waz up</title>
+ <title lang="de">Hallo</title>
+ </circle>
+</svg>
+<svg>
+ <g lang="de" aria-label="123">
+ <circle id="test19" aria-labelledby="" cx="50" cy="100" r="15" data-expected="name: Hallo">
+ <title lang="es">hola</title>
+ <title lang="fr">bonjour</title>
+ <title lang="en">waz up</title>
+ <title lang="de">Hallo</title>
+ </circle>
+ </g>
+</svg>
+<svg>
+ <circle id="test20" aria-labelledby="20a 20b" cx="50" cy="100" r="15" data-expected="name: the end"/>
+ <text id="20a" x="40" y="90">the</text>
+ <text id="20b" x="140" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test21" aria-labelledby="21a 21b" cx="50" cy="100" r="15" data-expected="name: big end"/>
+ <text id="21a" x="40" y="90" aria-label="big">the</text>
+ <text id="21b" x="140" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test22" aria-labelledby="22a 22b" cx="50" cy="100" r="15" data-expected="name: big end"/>
+ <text id="22a" x="40" y="90" aria-label="big">the</text>
+ <text id="22b" x="140" y="90" aria-labelledby="3c">end</text>
+ <text id="22c" x="180" y="90">finish</text>
+</svg>
+<svg>
+ <circle id="test23" aria-labelledby="23a 23b" cx="50" cy="100" r="15" data-expected="name: end"/>
+ <text id="23b" x="40" y="90">end</text>
+</svg>
+<svg>
+ <text id="test24" x="40" y="90" data-expected="name: end">end</text>
+</svg>
+<svg>
+ <a id="test25" aria-label="booth" href="../index.html" xlink:title="table" data-expected="name: booth"></a>
+</svg>
+<svg>
+ <a id="test26" href="../index.html" xlink:title="table" data-expected="name: table"></a>
+</svg>
+<svg>
+ <a id="test27" href="../index.html" data-expected="name: counter">
+ <title>counter</title>
+ </a>
+</svg>
+<svg>
+ <a id="test28" href="../index.html" xlink:title="table" data-expected="name: counter">
+ <title>counter</title>
+ </a>
+</svg>
+<svg>
+ <a id="test29" href="../index.html" xlink:title="table" data-expected="name: counter">
+ <title lang="es">barra</title>
+ <title lang="en">counter</title>
+ <title lang="fr">guichet</title>
+ </a>
+</svg>
+<svg>
+ <defs>
+ <path id="r30" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title>rock</title>
+ </path>
+ </defs>
+ <use id="test30" transform="translate(30 345)" xlink:href="#r30" aria-labelledby="b1" data-expected="name: boulder"/>
+ <text id="b1" x="35" y="90">boulder</text>
+</svg>
+<svg>
+ <defs>
+ <path id="r31" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title>rock</title>
+ </path>
+ </defs>
+ <use id="test31" transform="translate(30 345)" xlink:href="#31" aria-label="stone" data-expected="name: stone"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r32" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title>rock</title>
+ </path>
+ </defs>
+ <use id="test32" transform="translate(30 345)" xlink:href="#r32" data-expected="name: pebble">
+ <title>pebble</title>
+ </use>
+</svg>
+<svg>
+ <defs>
+ <path id="r33" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title>rock</title>
+ </path>
+ </defs>
+ <use id="test33" transform="translate(30 345)" xlink:href="#r33" data-expected="name: rock"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r34" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title>rock</title>
+ </path>
+ </defs>
+ <use id="test34" transform="translate(30 345)" href="#r34" data-expected="name: rock"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r35" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title lang="en">stone</title>
+ </path>
+ </defs>
+ <use id="test35" transform="translate(30 345)" xlink:href="#r35" data-expected="name: stone"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r36" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title lang="en">stone</title>
+ <title lang="es">piedra</title>
+ <title lang="de">Stein</title>
+ </path>
+ </defs>
+ <use id="test36" transform="translate(30 345)" href="#r36" data-expected="name: stone"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r37" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z" lang="es">
+ <title lang="es">piedra</title>
+ <title lang="en">stone</title>
+ <title lang="de">Stein</title>
+ </path>
+ </defs>
+ <use id="test37" transform="translate(30 345)" xlink:href="#r37" data-expected="name: piedra"/>
+</svg>
+<svg>
+ <defs lang="es">
+ <path id="r38" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title lang="en">stone</title>
+ <title lang="es">piedra</title>
+ <title lang="de">Stein</title>
+ </path>
+ </defs>
+ <use id="test38" transform="translate(30 345)" href="#r38" data-expected="name: piedra"/>
+</svg>
+<svg>
+ <defs>
+ <path id="r39" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title lang="es">piedra</title>
+ <title lang="en">stone</title>
+ <title lang="de">Stein</title>
+ </path>
+ </defs>
+ <g lang="es">
+ <use id="test39" transform="translate(30 345)" xlink:href="#r39" data-expected="name: stone"/>
+ </g>
+</svg>
+<svg>
+ <defs>
+ <path id="r40" d="M 8,2 L 10,0 L 7,-5 L 3,-7 L 3,-8 L -9,1 L -5,4 L 1,3 L 2,2 L 5,3 z">
+ <title lang="en">stone</title>
+ <title lang="es">piedra</title>
+ <title lang="de">Stein</title>
+ </path>
+ </defs>
+ <g lang="es">
+ <use id="test40" transform="translate(30 345)" href="#r40" lang="es" data-expected="name: stone"/>
+ </g>
+</svg>
+<svg>
+ <path id="test41" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="name: (empty)">
+ <title></title>
+ </path>
+</svg>
+<svg>
+ <circle id="test42" cx="10" cy="10" r="5" data-expected="name: (empty)">
+ <title> </title>
+ </circle>
+</svg>
+<svg>
+ <ellipse id="test43" cx="10" cy="100" rx="25" ry="15" data-expected="name: (empty)">
+ <title></title>
+ <desc></desc>
+ </ellipse>
+</svg>
+<svg>
+ <line id="test44" x1="10" y1="10" x2="50" y2="10" data-expected="name: (empty)">
+ <title> </title>
+ <desc></desc>
+ </line>
+</svg>
+<svg>
+ <circle id="test45" cx="10" cy="10" r="5" data-expected="name: (empty)">
+ <title></title>
+ <desc> </desc>
+ </circle>
+</svg>
+<svg>
+ <line id="test46" x1="10" y1="10" x2="50" y2="10" data-expected="name: (empty)">
+ <title> </title>
+ <desc> </desc>
+ </line>
+</svg>
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ function textAlternatives(axElement) {
+ if (!axElement)
+ return "Element not exposed";
+
+ result = axElement.title + "\n\t" + axElement.description;
+ if (accessibilityController.platformName == "mac")
+ result += "\n\t" + axElement.helpText;
+ return result;
+ }
+
+ description("This tests the accessible text alternatives results for SVG.");
+ if (window.accessibilityController) {
+ for (var i = 1; i <= 46; i++) {
+ var element = document.getElementById("test" + i);
+ var axElement = accessibilityController.accessibleElementById("test" + i);
+ var result = textAlternatives(axElement);
+ debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n\t" + result);
+ }
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/accessibility/w3c-svg-presentational-role.html b/LayoutTests/accessibility/w3c-svg-presentational-role.html
new file mode 100644
index 0000000..7c27d4b
--- /dev/null
+++ b/LayoutTests/accessibility/w3c-svg-presentational-role.html
@@ -0,0 +1,153 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<div id="content">
+<svg>
+ <foreignObject id="test1" role="presentation" width="100" height="50" aria-label="word wrap example">
+ <body xmlns="http://www.w3.org/1999/xhtml">Here is a paragraph that requires word wrap</body>
+ </foreignObject>
+</svg>
+<svg>
+ <g id="test2" role="presentation">
+ <title>Venn Diagram</title>
+ <circle cx="50" cy="50" r="20" aria-label="set A"/>
+ <circle cx="50" cy="75" r="20" aria-label="set B"/>
+ </g>
+</svg>
+<svg>
+ <image id="test3" x="200" y="200" width="100px" height="100px" href="myimage.png" role="presentation">
+ <title>My image</title>
+ </image>
+</svg>
+<svg id="test4" width="4in" height="3in" xmlns="http://www.w3.org/2000/svg" role="presentation">
+ <desc>This graphic links to an external image</desc>
+ <image x="200" y="200" width="100px" height="100px" href="myimage.png">
+ <title>My image</title>
+ </image>
+</svg>
+<svg>
+ <defs>
+ <rect id="MyRect5" width="60" height="10"/>
+ </defs>
+ <use id="test5" role="presentation" x="20" y="10" href="#MyRect5" aria-label="black bar"/>
+</svg>
+<svg>
+ <path id="test6" d="M 100 100 L 300 100 L 200 300 z" fill="red" role="presentation" ><desc>abc</desc></path>
+</svg>
+<svg>
+ <rect id="test7" aria-label="hello" x="10" y="10" width="50" height="30" role="presentation"/>
+</svg>
+<svg>
+ <ellipse id="test8" cx="10" cy="100" rx="25" ry="15" role="presentation">
+ <title>abc</title>
+ </ellipse>
+</svg>
+<svg>
+ <line id="test9" aria-label="hello" x1="10" y1="10" x2="50" y2="10" role="presentation"/>
+</svg>
+<svg>
+ <polyline id="test10" aria-label="hello" fill="presentation" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375" role="presentation"/>
+</svg>
+<svg>
+ <polygon id="test11" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5" role="presentation">
+ <desc>built up area</desc>
+ </polygon>
+</svg>
+<svg>
+ <text id="test12" x="250" y="180" font-family="Verdana" font-size="64" fill="blue" role="presentation">Hello, out there!</text>
+</svg>
+<svg>
+ <text transform="rotate(45)" role="presentation">
+ <textPath id="test13" href="#path13">Text on a path</textPath>
+ </text>
+</svg>
+<svg>
+ <text x="100" y="180" fill="blue" role="presentation">But you
+ <tspan id="test14" dx="2em" dy="-50" font-weight="bold" fill="red"> are a peach </tspan>
+ </text>
+</svg>
+<svg>
+ <foreignObject id="test15" role="none" width="100" height="50" aria-label="word wrap example">
+ <body xmlns="http://www.w3.org/1999/xhtml">Here is a paragraph that requires word wrap</body>
+ </foreignObject>
+</svg>
+<svg>
+ <g id="test16" role="none">
+ <title>Venn Diagram</title>
+ <circle cx="50" cy="50" r="20" aria-label="set A"/>
+ <circle cx="50" cy="75" r="20" aria-label="set B"/>
+ </g>
+</svg>
+<svg>
+ <image id="test17" x="200" y="200" width="100px" height="100px" href="myimage.png" role="none">
+ <title>My image</title>
+ </image>
+</svg>
+<svg id="test18" width="4in" height="3in" xmlns="http://www.w3.org/2000/svg" role="none">
+ <desc>This graphic links to an external image</desc>
+ <image x="200" y="200" width="100px" height="100px" href="myimage.png">
+ <title>My image</title>
+ </image>
+</svg>
+<svg>
+ <defs>
+ <rect id="MyRect19" width="60" height="10"/>
+ </defs>
+ <use id="test19" role="none" x="20" y="10" href="#MyRect19" aria-label="black bar"/>
+</svg>
+<svg>
+ <path id="test20" d="M 100 100 L 300 100 L 200 300 z" fill="red" role="none" ><desc>abc</desc></path>
+</svg>
+<svg>
+ <rect id="test21" aria-label="hello" x="10" y="10" width="50" height="30" role="none"/>
+</svg>
+<svg>
+ <ellipse id="test22" cx="10" cy="100" rx="25" ry="15" role="none">
+ <title>abc</title>
+ </ellipse>
+</svg>
+<svg>
+ <line id="test23" aria-label="hello" x1="10" y1="10" x2="50" y2="10" role="none"/>
+</svg>
+<svg>
+ <polyline id="test24" aria-label="hello" fill="none" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375" role="none"/>
+</svg>
+<svg>
+ <polygon id="test25" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5" role="none">
+ <desc>built up area</desc>
+ </polygon>
+</svg>
+<svg>
+ <text id="test26" x="250" y="180" font-family="Verdana" font-size="64" fill="blue" role="none">Hello, out there!</text>
+</svg>
+<svg>
+ <text transform="rotate(45)" role="none">
+ <textPath id="test27" href="#path27">Text on a path</textPath>
+ </text>
+</svg>
+<svg>
+ <text x="100" y="180" fill="blue" role="none">But you
+ <tspan id="test28" dx="2em" dy="-50" font-weight="bold" fill="red"> are a peach </tspan>
+ </text>
+</svg>
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ description("This tests that SVG elements with role presentation are not exposed.");
+ if (window.accessibilityController) {
+ for (var i = 1; i <= 28; i++) {
+ var element = document.getElementById("test" + i);
+ var axElement = accessibilityController.accessibleElementById("test" + i);
+ debug("test" + i + ": " + (axElement ? axElement.role : "Element not exposed"));
+ }
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/accessibility/w3c-svg-roles.html b/LayoutTests/accessibility/w3c-svg-roles.html
new file mode 100644
index 0000000..c496230
--- /dev/null
+++ b/LayoutTests/accessibility/w3c-svg-roles.html
@@ -0,0 +1,186 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+<div id="content">
+<svg>
+ <path id="test1" aria-labelledby="t1" aria-label="down" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <title>abc</title>
+ <desc>down</desc>
+ </path>
+ <text id="t1" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test2" aria-labelledby="t2" aria-label="down" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <title>abc</title>
+ </path>
+ <text id="t2" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test3" aria-labelledby="t3" aria-label="down" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <desc>abc</desc>
+ </path>
+ <text id="t3" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test4" aria-labelledby="t4" aria-label="bob" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img"/>
+ <text id="t4" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test5" aria-labelledby="t5" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <title>abc</title>
+ </path>
+ <text id="t5" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test6" aria-labelledby="t6" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <desc>abc</desc>
+ </path>
+ <text id="t6" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test7" aria-labelledby="t1" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img"/>
+ <text id="t7" x="40" y="90">end</text>
+</svg>
+<svg>
+ <path id="test8" aria-label="hello" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <title>abc</title>
+ </path>
+</svg>
+<svg>
+ <path id="test9" aria-label="hello" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img"/>
+</svg>
+<svg>
+ <path id="test10" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <title>abc</title>
+ </path>
+</svg>
+<svg>
+ <path id="test11" d="M 100 100 L 300 100 L 200 300 z" fill="red" data-expected="role: img">
+ <desc>abc</desc>
+ </path>
+</svg>
+<svg>
+ <circle id="test12" aria-labelledby="t12" aria-label="bob" cx="50" cy="100" r="4" data-expected="role: img">
+ <title>abc</title>
+ </circle>
+ <text id="t12" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test13" aria-labelledby="t13" aria-label="bob" cx="50" cy="100" r="4" data-expected="role: img"/>
+ <text id="t13" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test14" aria-labelledby="t14" cx="50" cy="100" r="4" data-expected="role: img">
+ <title>abc</title>
+ </circle>
+ <text id="t14" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test15" aria-labelledby="t15" cx="50" cy="100" r="4" data-expected="role: img"/>
+ <text id="t15" x="40" y="90">end</text>
+</svg>
+<svg>
+ <circle id="test16" aria-label="hello" cx="10" cy="10" r="5" data-expected="role: img">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <circle id="test17" aria-label="hello" cx="10" cy="10" r="5" data-expected="role: img"/>
+</svg>
+<svg>
+ <circle id="test18" cx="10" cy="100" r="5" data-expected="role: img">
+ <title>abc</title>
+ </circle>
+</svg>
+<svg>
+ <rect id="test19" aria-label="hello" x="10" y="10" width="50" height="30" data-expected="role: img"/>
+</svg>
+<svg>
+ <ellipse id="test20" cx="10" cy="100" rx="25" ry="15" data-expected="role: img">
+ <title>abc</title>
+ </ellipse>
+</svg>
+<svg>
+ <line id="test21" aria-label="hello" x1="10" y1="10" x2="50" y2="10" data-expected="role: img"/>
+</svg>
+<svg>
+ <polyline id="test22" aria-label="hello" fill="none" stroke="blue" stroke-width="10" points="50,375 150,375 150,325 250,325 250,375 350,375 350,250 450,250 450,375 550,375 550,175 650,175 650,375 750,375 750,100 850,100 850,375 950,375 950,25 1050,25 1050,375 1150,375" data-expected="role: img"/>
+</svg>
+<svg>
+ <polygon id="test23" fill="magenta" points="850,75 958,137.5 958,262.5 850,325 742,262.6 742,137.5" data-expected="role: img">
+ <desc>built up area</desc>
+ </polygon>
+</svg>
+<svg>
+ <foreignObject id="test24" width="100" height="50" aria-label="word wrap example" data-expected="role: group">
+ <body xmlns="http://www.w3.org/1999/xhtml">Here is a paragraph that requires word wrap</body>
+ </foreignObject>
+</svg>
+<svg>
+ <g id="test25" data-expected="role: group">
+ <title>Venn Diagram</title>
+ <circle cx="50" cy="50" r="20" aria-label="set A"/>
+ <circle cx="50" cy="75" r="20" aria-label="set B"/>
+ </g>
+</svg>
+<svg>
+ <image id="test26" x="200" y="200" width="100px" height="100px" href="myimage.png" data-expected="role: img">
+ <title>My image</title>
+ </image>
+</svg>
+<svg id="test27" width="4in" height="3in" xmlns="http://www.w3.org/2000/svg" data-expected="role: group">
+ <desc>This graphic links to an external image</desc>
+ <image x="200" y="200" width="100px" height="100px" href="myimage.png">
+ <title>My image</title>
+ </image>
+</svg>
+<svg>
+ <defs>
+ <rect id="MyRect28" width="60" height="10"/>
+ </defs>
+ <use id="test28" x="20" y="10" href="#MyRect28" aria-label="black bar" data-expected="role: img"/>
+</svg>
+<svg>
+ <text id="test29" x="250" y="180" font-family="Verdana" font-size="64" fill="blue" data-expected="role: group">Hello, out there!</text>
+</svg>
+<svg>
+ <text transform="rotate(45)">
+ <textPath id="test30" href="#path1" data-expected="role: group">Text on a path1</textPath>
+ </text>
+</svg>
+<svg>
+ <text x="100" y="180" fill="blue" >But you
+ <tspan id="test31" dx="2em" dy="-50" font-weight="bold" fill="red" tabindex="0" data-expected="role: group"> are a peach </tspan>
+ </text>
+</svg>
+<svg>
+ <text x="100" y="180" fill="blue" >But you
+ <tspan id="test32" dx="2em" dy="-50" font-weight="bold" fill="red" data-expected="(not exposed)"> are a peach </tspan>
+ </text>
+</svg>
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ description("This tests the exposure and role mapping of SVG path elements with properties requiring exposure.");
+ if (window.accessibilityController) {
+ var platform = accessibilityController.platformName;
+ for (var i = 1; i <= 32; i++) {
+ var element = document.getElementById("test" + i);
+ var axElement = accessibilityController.accessibleElementById("test" + i);
+ if (axElement)
+ result = axElement.role;
+ else
+ result = "Element not exposed";
+ debug("test" + i + ":\n\tExpected " + element.getAttribute("data-expected") + "\n\t" + result);
+ }
+ document.getElementById("content").style.visibility = "hidden";
+ }
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/platform/gtk/accessibility/svg-group-element-with-title-expected.txt b/LayoutTests/platform/gtk/accessibility/svg-group-element-with-title-expected.txt
new file mode 100644
index 0000000..813a30b
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/svg-group-element-with-title-expected.txt
@@ -0,0 +1,15 @@
+This tests SVG group elements are accessible and that the svg:title element is returned properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Verify that the SVG group is returned as an accessible element.
+PASS group1.role is 'AXRole: AXGroup'
+PASS group1.title is 'AXTitle: SVG TITLE 1'
+
+Verify that you can hit-test to the SVG group.
+PASS hitTestElement.isEqual(group1) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/svg-image-expected.txt b/LayoutTests/platform/gtk/accessibility/svg-image-expected.txt
new file mode 100644
index 0000000..adba759
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/svg-image-expected.txt
@@ -0,0 +1,14 @@
+
+This tests that SVG images are accessible elements and they have the same attributes as real images.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS svgImage.role is realImage.role
+PASS svgImage.title is realImage.title
+SVG Image Role: AXRole: AXImage
+SVG Image Title: AXTitle: TestImage
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/svg-labelledby-expected.txt b/LayoutTests/platform/gtk/accessibility/svg-labelledby-expected.txt
new file mode 100644
index 0000000..a701d01
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/svg-labelledby-expected.txt
@@ -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: AXTitle: Sudan
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/svg-remote-element-expected.txt b/LayoutTests/platform/gtk/accessibility/svg-remote-element-expected.txt
new file mode 100644
index 0000000..d9371dc
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/svg-remote-element-expected.txt
@@ -0,0 +1,35 @@
+
+This test ensures that accessibility elements can be created out of what a remote SVG image defines.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+container location: (7, 7)
+Face role: AXRole: AXButton
+Face label: AXTitle: face
+FaceX: 0
+FaceY: 0
+
+
+Eye role: AXRole: AXButton
+Eye label: AXTitle: left-eye
+EyeX: 103
+EyeY: 148
+
+
+Nose role: AXRole: AXButton
+Nose label: AXTitle: nose
+NoseX: 193
+NoseY: 206
+
+
+Mouth role: AXRole: AXButton
+Mouth label: AXTitle: smile
+MouthX: 116
+MouthY: 276
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt b/LayoutTests/platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt
new file mode 100644
index 0000000..655793e
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/w3c-svg-description-calculation-expected.txt
@@ -0,0 +1,181 @@
+This tests the accessible text alternatives results for SVG.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected description: end
+ AXTitle: abc
+ AXDescription: end
+test2:
+ Expected description: end
+ AXTitle:
+ AXDescription: end
+test3:
+ Expected description: end
+ AXTitle: abc
+ AXDescription: end
+test4:
+ Expected description: end
+ AXTitle:
+ AXDescription: end
+test5:
+ Expected description: 123
+ AXTitle: abc
+ AXDescription: 123
+test6:
+ Expected description: 123
+ AXTitle:
+ AXDescription: 123
+test7:
+ Expected description: end
+ AXTitle: abc
+ AXDescription: end
+test8:
+ Expected description: 554
+ AXTitle: abc
+ AXDescription: 554
+test9:
+ Expected description: 567
+ AXTitle:
+ AXDescription: 567
+test10:
+ Expected description: 123
+ AXTitle:
+ AXDescription: 123
+test11:
+ Expected description: 123
+ AXTitle:
+ AXDescription: 123
+test12:
+ Expected description: 123
+ AXTitle: abc
+ AXDescription: 123
+test13:
+ Expected description: 12
+ AXTitle:
+ AXDescription: 12
+test14:
+ Expected description: (empty)
+ AXTitle: abc
+ AXDescription:
+test15:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+test16:
+ Expected description: 222
+ AXTitle: abc
+ AXDescription: 222
+test17:
+ Expected description: 911
+ AXTitle:
+ AXDescription: 911
+test18:
+ Expected description: 123
+ AXTitle: abc
+ AXDescription: 123
+test19:
+ Expected description: 123
+ AXTitle:
+ AXDescription: 123
+test20:
+ Expected description: the end
+ AXTitle:
+ AXDescription: the end
+test21:
+ Expected description: the end
+ AXTitle:
+ AXDescription: the end
+test22:
+ Expected description: end
+ AXTitle:
+ AXDescription: end
+test23:
+ Expected description: abc
+ AXTitle: end
+ AXDescription: abc
+test24:
+ Expected description: abc
+ AXTitle: bob
+ AXDescription: abc
+test25:
+ Expected description: counter
+ AXTitle: end
+ AXDescription: counter
+test26:
+ Expected description: counter
+ AXTitle: bob
+ AXDescription: counter
+test27:
+ Expected description: barra
+ AXTitle: end
+ AXDescription: barra
+test28:
+ Expected description: barra
+ AXTitle: bob
+ AXDescription: barra
+test29:
+ Expected description: (empty)
+ AXTitle: abc
+ AXDescription:
+test30:
+ Expected description: (empty)
+ AXTitle: bob
+ AXDescription:
+test31:
+ Expected description: (empty)
+ AXTitle: abc
+ AXDescription:
+test32:
+ Expected description: (empty)
+ AXTitle: bob
+ AXDescription:
+test33:
+ Expected description: (empty)
+ AXTitle: bob
+ AXDescription:
+test34:
+ Expected description: (empty)
+ AXTitle: end
+ AXDescription:
+test35:
+ Expected description: (empty)
+ AXTitle: end
+ AXDescription:
+test36:
+ Expected description: (empty)
+ AXTitle: booth
+ AXDescription:
+test37:
+ Expected description: (empty)
+ AXTitle: counter
+ AXDescription:
+test38:
+ Expected description: (empty)
+ AXTitle: table
+ AXDescription:
+test39:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+test40:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+test41:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+test42:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+test43:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt b/LayoutTests/platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt
new file mode 100644
index 0000000..2097998
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/w3c-svg-elements-not-exposed-expected.txt
@@ -0,0 +1,59 @@
+This tests that SVG elements which should not be exposed are not exposed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1: Element not exposed
+test2: Element not exposed
+test3: Element not exposed
+test4: Element not exposed
+test5: Element not exposed
+test6: Element not exposed
+test7: Element not exposed
+test8: Element not exposed
+test9: Element not exposed
+test10: Element not exposed
+test11: Element not exposed
+test12: Element not exposed
+test13: Element not exposed
+test14: Element not exposed
+test15: Element not exposed
+test16: Element not exposed
+test17: Element not exposed
+test18: Element not exposed
+test19: Element not exposed
+test20: Element not exposed
+test21: Element not exposed
+test22: Element not exposed
+test23: Element not exposed
+test24: Element not exposed
+test25: Element not exposed
+test26: Element not exposed
+test27: Element not exposed
+test28: Element not exposed
+test29: Element not exposed
+test30: Element not exposed
+test31: Element not exposed
+test32: Element not exposed
+test33: Element not exposed
+test34: Element not exposed
+test35: Element not exposed
+test36: Element not exposed
+test37: Element not exposed
+test38: Element not exposed
+test39: Element not exposed
+test40: Element not exposed
+test41: Element not exposed
+test42: Element not exposed
+test43: Element not exposed
+test44: Element not exposed
+test45: Element not exposed
+test46: Element not exposed
+test47: Element not exposed
+test48: Element not exposed
+test49: Element not exposed
+test50: Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt b/LayoutTests/platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt
new file mode 100644
index 0000000..496bdad
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/w3c-svg-name-calculation-expected.txt
@@ -0,0 +1,193 @@
+This tests the accessible text alternatives results for SVG.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected name: end
+ AXTitle: end
+ AXDescription: abc
+test2:
+ Expected name: end
+ AXTitle: end
+ AXDescription:
+test3:
+ Expected name: end
+ AXTitle: end
+ AXDescription: abc
+test4:
+ Expected name: end
+ AXTitle: end
+ AXDescription:
+test5:
+ Expected name: hello
+ AXTitle: hello
+ AXDescription: abc
+test6:
+ Expected name: hello
+ AXTitle: hello
+ AXDescription:
+test7:
+ Expected name: abc
+ AXTitle: abc
+ AXDescription:
+test8:
+ Expected name: hi
+ AXTitle: hi
+ AXDescription:
+test9:
+ Expected name: hi
+ AXTitle: hi
+ AXDescription:
+test10:
+ Expected name: hi
+ AXTitle: hi
+ AXDescription:
+test11:
+ Expected name: hola
+ AXTitle: hola
+ AXDescription:
+test12:
+ Expected name: hola
+ AXTitle: hola
+ AXDescription:
+test13:
+ Expected name: hola
+ AXTitle: hola
+ AXDescription:
+test14:
+ Expected name: bob
+ AXTitle: bob
+ AXDescription: abc
+test15:
+ Expected name: bob
+ AXTitle: bob
+ AXDescription:
+test16:
+ Expected name: abc
+ AXTitle: abc
+ AXDescription:
+test17:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test18:
+ Expected name: waz up
+ AXTitle: waz up
+ AXDescription:
+test19:
+ Expected name: Hallo
+ AXTitle: Hallo
+ AXDescription:
+test20:
+ Expected name: the end
+ AXTitle: the end
+ AXDescription:
+test21:
+ Expected name: big end
+ AXTitle: big end
+ AXDescription:
+test22:
+ Expected name: big end
+ AXTitle: big end
+ AXDescription:
+test23:
+ Expected name: end
+ AXTitle: end
+ AXDescription:
+test24:
+ Expected name: end
+ AXTitle: end
+ AXDescription:
+test25:
+ Expected name: booth
+ AXTitle: booth
+ AXDescription:
+test26:
+ Expected name: table
+ AXTitle: table
+ AXDescription:
+test27:
+ Expected name: counter
+ AXTitle: counter
+ AXDescription:
+test28:
+ Expected name: counter
+ AXTitle: counter
+ AXDescription:
+test29:
+ Expected name: counter
+ AXTitle: counter
+ AXDescription:
+test30:
+ Expected name: boulder
+ AXTitle: boulder
+ AXDescription:
+test31:
+ Expected name: stone
+ AXTitle: stone
+ AXDescription:
+test32:
+ Expected name: pebble
+ AXTitle: pebble
+ AXDescription:
+test33:
+ Expected name: rock
+ AXTitle: rock
+ AXDescription:
+test34:
+ Expected name: rock
+ AXTitle: rock
+ AXDescription:
+test35:
+ Expected name: stone
+ AXTitle: stone
+ AXDescription:
+test36:
+ Expected name: stone
+ AXTitle: stone
+ AXDescription:
+test37:
+ Expected name: piedra
+ AXTitle: piedra
+ AXDescription:
+test38:
+ Expected name: piedra
+ AXTitle: piedra
+ AXDescription:
+test39:
+ Expected name: stone
+ AXTitle: stone
+ AXDescription:
+test40:
+ Expected name: stone
+ AXTitle: stone
+ AXDescription:
+test41:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test42:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test43:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test44:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test45:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+test46:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt b/LayoutTests/platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt
new file mode 100644
index 0000000..d96ee05
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt
@@ -0,0 +1,37 @@
+This tests that SVG elements with role presentation are not exposed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1: Element not exposed
+test2: Element not exposed
+test3: Element not exposed
+test4: Element not exposed
+test5: Element not exposed
+test6: Element not exposed
+test7: Element not exposed
+test8: Element not exposed
+test9: Element not exposed
+test10: Element not exposed
+test11: Element not exposed
+test12: Element not exposed
+test13: Element not exposed
+test14: Element not exposed
+test15: Element not exposed
+test16: Element not exposed
+test17: Element not exposed
+test18: Element not exposed
+test19: Element not exposed
+test20: Element not exposed
+test21: Element not exposed
+test22: Element not exposed
+test23: Element not exposed
+test24: Element not exposed
+test25: Element not exposed
+test26: Element not exposed
+test27: Element not exposed
+test28: Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/accessibility/w3c-svg-roles-expected.txt b/LayoutTests/platform/gtk/accessibility/w3c-svg-roles-expected.txt
new file mode 100644
index 0000000..0981c19
--- /dev/null
+++ b/LayoutTests/platform/gtk/accessibility/w3c-svg-roles-expected.txt
@@ -0,0 +1,105 @@
+This tests the exposure and role mapping of SVG path elements with properties requiring exposure.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected role: img
+ AXRole: AXImage
+test2:
+ Expected role: img
+ AXRole: AXImage
+test3:
+ Expected role: img
+ AXRole: AXImage
+test4:
+ Expected role: img
+ AXRole: AXImage
+test5:
+ Expected role: img
+ AXRole: AXImage
+test6:
+ Expected role: img
+ AXRole: AXImage
+test7:
+ Expected role: img
+ AXRole: AXImage
+test8:
+ Expected role: img
+ AXRole: AXImage
+test9:
+ Expected role: img
+ AXRole: AXImage
+test10:
+ Expected role: img
+ AXRole: AXImage
+test11:
+ Expected role: img
+ AXRole: AXImage
+test12:
+ Expected role: img
+ AXRole: AXImage
+test13:
+ Expected role: img
+ AXRole: AXImage
+test14:
+ Expected role: img
+ AXRole: AXImage
+test15:
+ Expected role: img
+ AXRole: AXImage
+test16:
+ Expected role: img
+ AXRole: AXImage
+test17:
+ Expected role: img
+ AXRole: AXImage
+test18:
+ Expected role: img
+ AXRole: AXImage
+test19:
+ Expected role: img
+ AXRole: AXImage
+test20:
+ Expected role: img
+ AXRole: AXImage
+test21:
+ Expected role: img
+ AXRole: AXImage
+test22:
+ Expected role: img
+ AXRole: AXImage
+test23:
+ Expected role: img
+ AXRole: AXImage
+test24:
+ Expected role: group
+ AXRole: AXGroup
+test25:
+ Expected role: group
+ AXRole: AXGroup
+test26:
+ Expected role: img
+ AXRole: AXImage
+test27:
+ Expected role: group
+ Element not exposed
+test28:
+ Expected role: img
+ AXRole: AXImage
+test29:
+ Expected role: group
+ AXRole: AXSection
+test30:
+ Expected role: group
+ AXRole: AXStatic
+test31:
+ Expected role: group
+ AXRole: AXStatic
+test32:
+ Expected (not exposed)
+ Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/w3c-svg-description-calculation-expected.txt b/LayoutTests/platform/mac/accessibility/w3c-svg-description-calculation-expected.txt
new file mode 100644
index 0000000..08df84d
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/w3c-svg-description-calculation-expected.txt
@@ -0,0 +1,224 @@
+This tests the accessible text alternatives results for SVG.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected description: end
+ AXTitle:
+ AXDescription: abc
+ AXHelp: end
+test2:
+ Expected description: end
+ AXTitle:
+ AXDescription:
+ AXHelp: end
+test3:
+ Expected description: end
+ AXTitle:
+ AXDescription: abc
+ AXHelp: end
+test4:
+ Expected description: end
+ AXTitle:
+ AXDescription:
+ AXHelp: end
+test5:
+ Expected description: 123
+ AXTitle:
+ AXDescription: abc
+ AXHelp: 123
+test6:
+ Expected description: 123
+ AXTitle:
+ AXDescription:
+ AXHelp: 123
+test7:
+ Expected description: end
+ AXTitle:
+ AXDescription: abc
+ AXHelp: end
+test8:
+ Expected description: 554
+ AXTitle:
+ AXDescription: abc
+ AXHelp: 554
+test9:
+ Expected description: 567
+ AXTitle:
+ AXDescription:
+ AXHelp: 567
+test10:
+ Expected description: 123
+ AXTitle:
+ AXDescription:
+ AXHelp: 123
+test11:
+ Expected description: 123
+ AXTitle:
+ AXDescription:
+ AXHelp: 123
+test12:
+ Expected description: 123
+ AXTitle:
+ AXDescription: abc
+ AXHelp: 123
+test13:
+ Expected description: 12
+ AXTitle:
+ AXDescription:
+ AXHelp: 12
+test14:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: abc
+ AXHelp:
+test15:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test16:
+ Expected description: 222
+ AXTitle:
+ AXDescription: abc
+ AXHelp: 222
+test17:
+ Expected description: 911
+ AXTitle:
+ AXDescription:
+ AXHelp: 911
+test18:
+ Expected description: 123
+ AXTitle:
+ AXDescription: abc
+ AXHelp: 123
+test19:
+ Expected description: 123
+ AXTitle:
+ AXDescription:
+ AXHelp: 123
+test20:
+ Expected description: the end
+ AXTitle:
+ AXDescription:
+ AXHelp: the end
+test21:
+ Expected description: the end
+ AXTitle:
+ AXDescription:
+ AXHelp: the end
+test22:
+ Expected description: end
+ AXTitle:
+ AXDescription:
+ AXHelp: end
+test23:
+ Expected description: abc
+ AXTitle:
+ AXDescription: end
+ AXHelp: abc
+test24:
+ Expected description: abc
+ AXTitle:
+ AXDescription: bob
+ AXHelp: abc
+test25:
+ Expected description: counter
+ AXTitle:
+ AXDescription: end
+ AXHelp: counter
+test26:
+ Expected description: counter
+ AXTitle:
+ AXDescription: bob
+ AXHelp: counter
+test27:
+ Expected description: barra
+ AXTitle:
+ AXDescription: end
+ AXHelp: barra
+test28:
+ Expected description: barra
+ AXTitle:
+ AXDescription: bob
+ AXHelp: barra
+test29:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: abc
+ AXHelp:
+test30:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: bob
+ AXHelp:
+test31:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: abc
+ AXHelp:
+test32:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: bob
+ AXHelp:
+test33:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: bob
+ AXHelp:
+test34:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test35:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test36:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: booth
+ AXHelp:
+test37:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: counter
+ AXHelp:
+test38:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription: table
+ AXHelp:
+test39:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test40:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test41:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test42:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test43:
+ Expected description: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt b/LayoutTests/platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt
new file mode 100644
index 0000000..2097998
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/w3c-svg-elements-not-exposed-expected.txt
@@ -0,0 +1,59 @@
+This tests that SVG elements which should not be exposed are not exposed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1: Element not exposed
+test2: Element not exposed
+test3: Element not exposed
+test4: Element not exposed
+test5: Element not exposed
+test6: Element not exposed
+test7: Element not exposed
+test8: Element not exposed
+test9: Element not exposed
+test10: Element not exposed
+test11: Element not exposed
+test12: Element not exposed
+test13: Element not exposed
+test14: Element not exposed
+test15: Element not exposed
+test16: Element not exposed
+test17: Element not exposed
+test18: Element not exposed
+test19: Element not exposed
+test20: Element not exposed
+test21: Element not exposed
+test22: Element not exposed
+test23: Element not exposed
+test24: Element not exposed
+test25: Element not exposed
+test26: Element not exposed
+test27: Element not exposed
+test28: Element not exposed
+test29: Element not exposed
+test30: Element not exposed
+test31: Element not exposed
+test32: Element not exposed
+test33: Element not exposed
+test34: Element not exposed
+test35: Element not exposed
+test36: Element not exposed
+test37: Element not exposed
+test38: Element not exposed
+test39: Element not exposed
+test40: Element not exposed
+test41: Element not exposed
+test42: Element not exposed
+test43: Element not exposed
+test44: Element not exposed
+test45: Element not exposed
+test46: Element not exposed
+test47: Element not exposed
+test48: Element not exposed
+test49: Element not exposed
+test50: Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/w3c-svg-name-calculation-expected.txt b/LayoutTests/platform/mac/accessibility/w3c-svg-name-calculation-expected.txt
new file mode 100644
index 0000000..e01df5c
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/w3c-svg-name-calculation-expected.txt
@@ -0,0 +1,239 @@
+This tests the accessible text alternatives results for SVG.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp: abc
+test2:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test3:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp: abc
+test4:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test5:
+ Expected name: hello
+ AXTitle:
+ AXDescription: hello
+ AXHelp: abc
+test6:
+ Expected name: hello
+ AXTitle:
+ AXDescription: hello
+ AXHelp:
+test7:
+ Expected name: abc
+ AXTitle:
+ AXDescription: abc
+ AXHelp:
+test8:
+ Expected name: hi
+ AXTitle:
+ AXDescription: hi
+ AXHelp:
+test9:
+ Expected name: hi
+ AXTitle:
+ AXDescription: hi
+ AXHelp:
+test10:
+ Expected name: hi
+ AXTitle:
+ AXDescription: hi
+ AXHelp:
+test11:
+ Expected name: hola
+ AXTitle:
+ AXDescription: hola
+ AXHelp:
+test12:
+ Expected name: hola
+ AXTitle:
+ AXDescription: hola
+ AXHelp:
+test13:
+ Expected name: hola
+ AXTitle:
+ AXDescription: hola
+ AXHelp:
+test14:
+ Expected name: bob
+ AXTitle:
+ AXDescription: bob
+ AXHelp: abc
+test15:
+ Expected name: bob
+ AXTitle:
+ AXDescription: bob
+ AXHelp:
+test16:
+ Expected name: abc
+ AXTitle:
+ AXDescription: abc
+ AXHelp:
+test17:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test18:
+ Expected name: waz up
+ AXTitle:
+ AXDescription: waz up
+ AXHelp:
+test19:
+ Expected name: Hallo
+ AXTitle:
+ AXDescription: Hallo
+ AXHelp:
+test20:
+ Expected name: the end
+ AXTitle:
+ AXDescription: the end
+ AXHelp:
+test21:
+ Expected name: big end
+ AXTitle:
+ AXDescription: big end
+ AXHelp:
+test22:
+ Expected name: big end
+ AXTitle:
+ AXDescription: big end
+ AXHelp:
+test23:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test24:
+ Expected name: end
+ AXTitle:
+ AXDescription: end
+ AXHelp:
+test25:
+ Expected name: booth
+ AXTitle:
+ AXDescription: booth
+ AXHelp:
+test26:
+ Expected name: table
+ AXTitle:
+ AXDescription: table
+ AXHelp:
+test27:
+ Expected name: counter
+ AXTitle:
+ AXDescription: counter
+ AXHelp:
+test28:
+ Expected name: counter
+ AXTitle:
+ AXDescription: counter
+ AXHelp:
+test29:
+ Expected name: counter
+ AXTitle:
+ AXDescription: counter
+ AXHelp:
+test30:
+ Expected name: boulder
+ AXTitle:
+ AXDescription: boulder
+ AXHelp:
+test31:
+ Expected name: stone
+ AXTitle:
+ AXDescription: stone
+ AXHelp:
+test32:
+ Expected name: pebble
+ AXTitle:
+ AXDescription: pebble
+ AXHelp:
+test33:
+ Expected name: rock
+ AXTitle:
+ AXDescription: rock
+ AXHelp:
+test34:
+ Expected name: rock
+ AXTitle:
+ AXDescription: rock
+ AXHelp:
+test35:
+ Expected name: stone
+ AXTitle:
+ AXDescription: stone
+ AXHelp:
+test36:
+ Expected name: stone
+ AXTitle:
+ AXDescription: stone
+ AXHelp:
+test37:
+ Expected name: piedra
+ AXTitle:
+ AXDescription: piedra
+ AXHelp:
+test38:
+ Expected name: piedra
+ AXTitle:
+ AXDescription: piedra
+ AXHelp:
+test39:
+ Expected name: stone
+ AXTitle:
+ AXDescription: stone
+ AXHelp:
+test40:
+ Expected name: stone
+ AXTitle:
+ AXDescription: stone
+ AXHelp:
+test41:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test42:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test43:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test44:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test45:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+test46:
+ Expected name: (empty)
+ AXTitle:
+ AXDescription:
+ AXHelp:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/w3c-svg-presentational-role-expected.txt b/LayoutTests/platform/mac/accessibility/w3c-svg-presentational-role-expected.txt
new file mode 100644
index 0000000..d96ee05
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/w3c-svg-presentational-role-expected.txt
@@ -0,0 +1,37 @@
+This tests that SVG elements with role presentation are not exposed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1: Element not exposed
+test2: Element not exposed
+test3: Element not exposed
+test4: Element not exposed
+test5: Element not exposed
+test6: Element not exposed
+test7: Element not exposed
+test8: Element not exposed
+test9: Element not exposed
+test10: Element not exposed
+test11: Element not exposed
+test12: Element not exposed
+test13: Element not exposed
+test14: Element not exposed
+test15: Element not exposed
+test16: Element not exposed
+test17: Element not exposed
+test18: Element not exposed
+test19: Element not exposed
+test20: Element not exposed
+test21: Element not exposed
+test22: Element not exposed
+test23: Element not exposed
+test24: Element not exposed
+test25: Element not exposed
+test26: Element not exposed
+test27: Element not exposed
+test28: Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/w3c-svg-roles-expected.txt b/LayoutTests/platform/mac/accessibility/w3c-svg-roles-expected.txt
new file mode 100644
index 0000000..f37ab8f
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/w3c-svg-roles-expected.txt
@@ -0,0 +1,105 @@
+This tests the exposure and role mapping of SVG path elements with properties requiring exposure.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+test1:
+ Expected role: img
+ AXRole: AXImage
+test2:
+ Expected role: img
+ AXRole: AXImage
+test3:
+ Expected role: img
+ AXRole: AXImage
+test4:
+ Expected role: img
+ AXRole: AXImage
+test5:
+ Expected role: img
+ AXRole: AXImage
+test6:
+ Expected role: img
+ AXRole: AXImage
+test7:
+ Expected role: img
+ AXRole: AXImage
+test8:
+ Expected role: img
+ AXRole: AXImage
+test9:
+ Expected role: img
+ AXRole: AXImage
+test10:
+ Expected role: img
+ AXRole: AXImage
+test11:
+ Expected role: img
+ AXRole: AXImage
+test12:
+ Expected role: img
+ AXRole: AXImage
+test13:
+ Expected role: img
+ AXRole: AXImage
+test14:
+ Expected role: img
+ AXRole: AXImage
+test15:
+ Expected role: img
+ AXRole: AXImage
+test16:
+ Expected role: img
+ AXRole: AXImage
+test17:
+ Expected role: img
+ AXRole: AXImage
+test18:
+ Expected role: img
+ AXRole: AXImage
+test19:
+ Expected role: img
+ AXRole: AXImage
+test20:
+ Expected role: img
+ AXRole: AXImage
+test21:
+ Expected role: img
+ AXRole: AXImage
+test22:
+ Expected role: img
+ AXRole: AXImage
+test23:
+ Expected role: img
+ AXRole: AXImage
+test24:
+ Expected role: group
+ AXRole: AXGroup
+test25:
+ Expected role: group
+ AXRole: AXGroup
+test26:
+ Expected role: img
+ AXRole: AXImage
+test27:
+ Expected role: group
+ Element not exposed
+test28:
+ Expected role: img
+ AXRole: AXImage
+test29:
+ Expected role: group
+ AXRole: AXGroup
+test30:
+ Expected role: group
+ AXRole: AXGroup
+test31:
+ Expected role: group
+ AXRole: AXGroup
+test32:
+ Expected (not exposed)
+ Element not exposed
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 5658897..38b19c0 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -1060,6 +1060,7 @@
accessibility/AccessibilityObject.cpp
accessibility/AccessibilityProgressIndicator.cpp
accessibility/AccessibilityRenderObject.cpp
+ accessibility/AccessibilitySVGElement.cpp
accessibility/AccessibilitySVGRoot.cpp
accessibility/AccessibilityScrollView.cpp
accessibility/AccessibilityScrollbar.cpp
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index dd2b3ce..fd1f6eb 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,58 @@
+2016-03-05 Joanmarie Diggs <jdiggs@igalia.com>
+
+ AX: Implement missing/different accessibility API mappings for SVG
+ https://bugs.webkit.org/show_bug.cgi?id=155034
+
+ Reviewed by Chris Fleizach.
+
+ Create an AccessibilitySVGElement class for the SVG-specific mappings;
+ fix name and description mappings for ATK; add new AccessibilityRole
+ types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
+ ATK and AX API.
+
+ Tests: accessibility/w3c-svg-description-calculation.html
+ accessibility/w3c-svg-elements-not-exposed.html
+ accessibility/w3c-svg-name-calculation.html
+ accessibility/w3c-svg-presentational-role.html
+ accessibility/w3c-svg-roles.html
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::createFromRenderer):
+ * accessibility/AccessibilityAllInOne.cpp:
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::alternativeText): Deleted.
+ (WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isAccessibilitySVGElement):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
+ * accessibility/AccessibilitySVGElement.cpp: Added.
+ (WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
+ (WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
+ (WebCore::AccessibilitySVGElement::create):
+ (WebCore::AccessibilitySVGElement::targetForUseElement):
+ (WebCore::AccessibilitySVGElement::accessibilityText):
+ (WebCore::AccessibilitySVGElement::accessibilityDescription):
+ (WebCore::AccessibilitySVGElement::helpText):
+ (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
+ (WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
+ (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
+ (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
+ * accessibility/AccessibilitySVGElement.h: Added.
+ * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+ (webkitAccessibleGetName):
+ (webkitAccessibleGetDescription):
+ (atkRole):
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (createAccessibilityRoleMap):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isSVGTSpan):
+ * rendering/svg/RenderSVGTSpan.h:
+
2016-03-05 Yusuke Suzuki <utatane.tea@gmail.com>
[ES6] Support Reflect.construct
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index 3db9b77..459261d 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2503,6 +2503,8 @@
65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
+ 69A6CBAC1C6BE42C00B836E9 /* AccessibilitySVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */; };
+ 69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */; };
6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
6B693A341C51A95D00B03BEF /* ResourceLoadObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */; };
@@ -10091,6 +10093,8 @@
65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWrapper.h; sourceTree = "<group>"; };
65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
+ 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGElement.cpp; sourceTree = "<group>"; };
+ 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGElement.h; sourceTree = "<group>"; };
6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; };
6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadObserver.h; sourceTree = "<group>"; };
6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadObserver.cpp; sourceTree = "<group>"; };
@@ -16469,6 +16473,8 @@
0709FC4D1025DEE30059CDBA /* AccessibilitySlider.h */,
29D7BCF51444AF580070619C /* AccessibilitySpinButton.cpp */,
29D7BCF91444AF7D0070619C /* AccessibilitySpinButton.h */,
+ 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */,
+ 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */,
AAC08CF015F941FC00F1E188 /* AccessibilitySVGRoot.cpp */,
AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */,
2981CAAA131822EC00D12F2A /* AccessibilityTable.cpp */,
@@ -26265,6 +26271,8 @@
5148453F1BB9D07E006A72ED /* IDBError.h in Headers */,
5185FC8B1BB4C4E80012898F /* IDBEventDispatcher.h in Headers */,
5185FC8D1BB4C4E80012898F /* IDBFactory.h in Headers */,
+ 51F41A721BA73B5B002E053B /* IDBFactoryBackendInterface.h in Headers */,
+ 69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */,
510310501BA8CC03003329C0 /* IDBFactoryImpl.h in Headers */,
5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */,
5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */,
@@ -30065,6 +30073,7 @@
FDA15E9D12B03EE1003A583A /* JSAudioBuffer.cpp in Sources */,
FDF7E9C313AC21DB00A51EAC /* JSAudioBufferCallback.cpp in Sources */,
FDA15E9F12B03EE1003A583A /* JSAudioBufferSourceNode.cpp in Sources */,
+ 69A6CBAC1C6BE42C00B836E9 /* AccessibilitySVGElement.cpp in Sources */,
FDEAAAF312B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp in Sources */,
FDA15EA512B03EE1003A583A /* JSAudioContext.cpp in Sources */,
FDEAAAF412B02EE400DCF33B /* JSAudioContextCustom.cpp in Sources */,
diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp
index 2b3f6a87..9d64a61 100644
--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp
@@ -45,6 +45,7 @@
#include "AccessibilityMenuListPopup.h"
#include "AccessibilityProgressIndicator.h"
#include "AccessibilityRenderObject.h"
+#include "AccessibilitySVGElement.h"
#include "AccessibilitySVGRoot.h"
#include "AccessibilityScrollView.h"
#include "AccessibilityScrollbar.h"
@@ -80,6 +81,7 @@
#include "RenderTableCell.h"
#include "RenderTableRow.h"
#include "RenderView.h"
+#include "SVGElement.h"
#include "ScrollView.h"
#include "TextBoundaries.h"
#include "TextIterator.h"
@@ -404,6 +406,9 @@
if (is<RenderSVGRoot>(*renderer))
return AccessibilitySVGRoot::create(renderer);
+ if (is<SVGElement>(node))
+ return AccessibilitySVGElement::create(renderer);
+
if (is<RenderBoxModelObject>(*renderer)) {
RenderBoxModelObject& cssBox = downcast<RenderBoxModelObject>(*renderer);
if (is<RenderListBox>(cssBox))
diff --git a/Source/WebCore/accessibility/AccessibilityAllInOne.cpp b/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
index 06afd8b..1bb76ea 100644
--- a/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
+++ b/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
@@ -42,6 +42,7 @@
#include "AccessibilityObject.cpp"
#include "AccessibilityProgressIndicator.cpp"
#include "AccessibilityRenderObject.cpp"
+#include "AccessibilitySVGElement.cpp"
#include "AccessibilitySVGRoot.cpp"
#include "AccessibilityScrollView.cpp"
#include "AccessibilityScrollbar.cpp"
diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
index a00df3d..7dd9c3d 100644
--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
@@ -1320,10 +1320,6 @@
textOrder.append(AccessibilityText(accessibleNameForNode(object->node()), AlternativeText));
}
- // SVG elements all can have a <svg:title> element inside which should act as the descriptive text.
- if (node->isSVGElement())
- textOrder.append(AccessibilityText(downcast<SVGElement>(*node).title(), AlternativeText));
-
#if ENABLE(MATHML)
if (node->isMathMLElement())
textOrder.append(AccessibilityText(getAttribute(MathMLNames::alttextAttr), AlternativeText));
@@ -1506,10 +1502,6 @@
if (!alt.isNull())
return alt;
}
-
- // SVG elements all can have a <svg:title> element inside which should act as the descriptive text.
- if (m_node && m_node->isSVGElement())
- return downcast<SVGElement>(*m_node).title();
#if ENABLE(MATHML)
if (is<MathMLElement>(m_node))
diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h
index 26385c5..b891604 100644
--- a/Source/WebCore/accessibility/AccessibilityObject.h
+++ b/Source/WebCore/accessibility/AccessibilityObject.h
@@ -202,6 +202,9 @@
SwitchRole,
SystemWideRole,
SVGRootRole,
+ SVGTextRole,
+ SVGTSpanRole,
+ SVGTextPathRole,
TabGroupRole,
TabListRole,
TabPanelRole,
@@ -465,6 +468,7 @@
virtual bool isAccessibilityScrollbar() const { return false; }
virtual bool isAccessibilityScrollView() const { return false; }
virtual bool isAccessibilitySVGRoot() const { return false; }
+ virtual bool isAccessibilitySVGElement() const { return false; }
bool accessibilityObjectContainsText(String *) const;
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index c37d6ed..d2f4c1a 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2578,12 +2578,8 @@
if (headingLevel())
return HeadingRole;
- if (m_renderer->isSVGImage())
- return ImageRole;
if (m_renderer->isSVGRoot())
return SVGRootRole;
- if (node && node->hasTagName(SVGNames::gTag))
- return GroupRole;
if (isStyleFormatGroup())
return GroupRole;
diff --git a/Source/WebCore/accessibility/AccessibilitySVGElement.cpp b/Source/WebCore/accessibility/AccessibilitySVGElement.cpp
new file mode 100644
index 0000000..94ca5236
--- /dev/null
+++ b/Source/WebCore/accessibility/AccessibilitySVGElement.cpp
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2016 Igalia, S.L.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AccessibilitySVGElement.h"
+
+#include "AXObjectCache.h"
+#include "ElementIterator.h"
+#include "HTMLNames.h"
+#include "Language.h"
+#include "RenderIterator.h"
+#include "RenderText.h"
+#include "SVGDescElement.h"
+#include "SVGTitleElement.h"
+#include "SVGUseElement.h"
+#include "XLinkNames.h"
+
+namespace WebCore {
+
+AccessibilitySVGElement::AccessibilitySVGElement(RenderObject* renderer)
+ : AccessibilityRenderObject(renderer)
+{
+}
+
+AccessibilitySVGElement::~AccessibilitySVGElement()
+{
+}
+
+Ref<AccessibilitySVGElement> AccessibilitySVGElement::create(RenderObject* renderer)
+{
+ return adoptRef(*new AccessibilitySVGElement(renderer));
+}
+
+AccessibilityObject* AccessibilitySVGElement::targetForUseElement() const
+{
+ if (!is<SVGUseElement>(element()))
+ return nullptr;
+
+ SVGUseElement& use = downcast<SVGUseElement>(*element());
+ String href = use.href();
+ if (href.isEmpty())
+ href = getAttribute(HTMLNames::hrefAttr);
+
+ Element* target = SVGURIReference::targetElementFromIRIString(href, use.document());
+ if (target)
+ return axObjectCache()->getOrCreate(target);
+
+ return nullptr;
+}
+
+void AccessibilitySVGElement::accessibilityText(Vector<AccessibilityText>& textOrder)
+{
+ String description = accessibilityDescription();
+ if (!description.isEmpty())
+ textOrder.append(AccessibilityText(description, AlternativeText));
+
+ String helptext = helpText();
+ if (!helptext.isEmpty())
+ textOrder.append(AccessibilityText(helptext, HelpText));
+}
+
+String AccessibilitySVGElement::accessibilityDescription() const
+{
+ // According to the SVG Accessibility API Mappings spec, the order of priority is:
+ // 1. aria-labelledby
+ // 2. aria-label
+ // 3. a direct child title element (selected according to language)
+ // 4. xlink:title attribute
+ // 5. for a use element, the accessible name calculated for the re-used content
+ // 6. for text container elements, the text content
+
+ String ariaDescription = ariaAccessibilityDescription();
+ if (!ariaDescription.isEmpty())
+ return ariaDescription;
+
+ String lang = language();
+ if (lang.isEmpty())
+ lang = defaultLanguage().substring(0, 2);
+
+ String childLang;
+ for (const auto& child : childrenOfType<SVGTitleElement>(*element())) {
+ childLang = child.getAttribute(SVGNames::langAttr);
+ if (childLang == lang || childLang.isEmpty())
+ return child.textContent();
+ }
+
+ if (is<SVGAElement>(element())) {
+ String xlinkTitle = element()->fastGetAttribute(XLinkNames::titleAttr);
+ if (!xlinkTitle.isEmpty())
+ return xlinkTitle;
+ }
+
+ if (m_renderer->isSVGText()) {
+ AccessibilityTextUnderElementMode mode;
+ String text = textUnderElement(mode);
+ if (!text.isEmpty())
+ return text;
+ }
+
+ if (is<SVGUseElement>(element())) {
+ if (AccessibilityObject* target = targetForUseElement())
+ return target->accessibilityDescription();
+ }
+
+ // FIXME: This is here to not break the svg-image.html test. But 'alt' is not
+ // listed as a supported attribute of the 'image' element in the SVG spec:
+ // https://www.w3.org/TR/SVG/struct.html#ImageElement
+ if (m_renderer->isSVGImage()) {
+ const AtomicString& alt = getAttribute(HTMLNames::altAttr);
+ if (!alt.isNull())
+ return alt;
+ }
+
+ return String();
+}
+
+String AccessibilitySVGElement::helpText() const
+{
+ // According to the SVG Accessibility API Mappings spec, the order of priority is:
+ // 1. aria-describedby
+ // 2. a direct child desc element
+ // 3. for a use element, the accessible description calculated for the re-used content
+ // 4. for text container elements, the text content, if not used for the name
+ // 5. a direct child title element that provides a tooltip, if not used for the name
+
+ String describedBy = ariaDescribedByAttribute();
+ if (!describedBy.isEmpty())
+ return describedBy;
+
+ String lang = language();
+ if (lang.isEmpty())
+ lang = defaultLanguage().substring(0, 2);
+
+ String childLang;
+ for (const auto& child : childrenOfType<SVGDescElement>(*element())) {
+ childLang = child.getAttribute(SVGNames::langAttr);
+ if (childLang == lang || childLang.isEmpty())
+ return child.textContent();
+ }
+
+ if (is<SVGUseElement>(element())) {
+ AccessibilityObject* target = targetForUseElement();
+ if (target)
+ return target->helpText();
+ }
+
+ String description = accessibilityDescription();
+
+ if (m_renderer->isSVGText()) {
+ AccessibilityTextUnderElementMode mode;
+ String text = textUnderElement(mode);
+ if (!text.isEmpty() && text != description)
+ return text;
+ }
+
+ for (const auto& child : childrenOfType<SVGTitleElement>(*element())) {
+ childLang = child.getAttribute(SVGNames::langAttr);
+ if ((childLang == lang || childLang.isEmpty()) && child.textContent() != description)
+ return child.textContent();
+ }
+
+ return String();
+}
+
+bool AccessibilitySVGElement::computeAccessibilityIsIgnored() const
+{
+ // According to the SVG Accessibility API Mappings spec, items should be excluded if:
+ // * They would be excluded according to the Core Accessibility API Mappings.
+ // * They are neither perceivable nor interactive.
+ // * Their first mappable role is presentational, regardless of other ARIA attributes.
+ // * They have an ancestor with Children Presentational: True (covered by Core AAM)
+
+ AccessibilityObjectInclusion decision = defaultObjectInclusion();
+ if (decision == IgnoreObject)
+ return true;
+
+ if (m_renderer->isSVGHiddenContainer())
+ return true;
+
+ if (roleValue() == PresentationalRole || inheritsPresentationalRole())
+ return true;
+
+ if (ariaRoleAttribute() != UnknownRole)
+ return false;
+
+ // The SVG AAM states objects with at least one 'title' or 'desc' element MUST be included.
+ for (const auto& child : childrenOfType<SVGElement>(*element())) {
+ if ((is<SVGTitleElement>(child) || is<SVGDescElement>(child)))
+ return false;
+ }
+
+ // The SVG AAM states text elements should also be included, if they have content.
+ if (m_renderer->isSVGText() || m_renderer->isSVGTextPath()) {
+ for (auto& child : childrenOfType<RenderText>(downcast<RenderElement>(*m_renderer))) {
+ if (!child.isAllCollapsibleWhitespace())
+ return false;
+ }
+ }
+
+ // SVG shapes should not be included unless there's a concrete reason for inclusion.
+ // https://rawgit.com/w3c/aria/master/svg-aam/svg-aam.html#exclude_elements
+ if (m_renderer->isSVGShape())
+ return !(hasAttributesRequiredForInclusion() || canSetFocusAttribute() || element()->hasEventListeners());
+
+ return AccessibilityRenderObject::computeAccessibilityIsIgnored();
+}
+
+bool AccessibilitySVGElement::inheritsPresentationalRole() const
+{
+ if (canSetFocusAttribute())
+ return false;
+
+ AccessibilityRole role = roleValue();
+ if (role != SVGTextPathRole && role != SVGTSpanRole)
+ return false;
+
+ for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
+ if (is<AccessibilityRenderObject>(*parent) && parent->element()->hasTagName(SVGNames::textTag))
+ return parent->roleValue() == PresentationalRole;
+ }
+
+ return false;
+}
+
+AccessibilityRole AccessibilitySVGElement::determineAriaRoleAttribute() const
+{
+ // Presentational roles are normally invalidated by the presence of ARIA attributes
+ // if the element is focusable. As a result, an UnknownRole might be an invalidated
+ // PresentationalRole. We need to check because in SVG the PresentationalRole is
+ // expected to trump ARIA attributes.
+ // See https://github.com/w3c/aria/issues/136#issuecomment-170557956.
+
+ AccessibilityRole role = AccessibilityRenderObject::determineAriaRoleAttribute();
+ if (role != UnknownRole || canSetFocusAttribute())
+ return role;
+
+ const AtomicString& ariaRole = getAttribute(HTMLNames::roleAttr);
+ if (ariaRole.isNull() || ariaRole.isEmpty())
+ return UnknownRole;
+
+ return ariaRoleToWebCoreRole(ariaRole);
+}
+
+AccessibilityRole AccessibilitySVGElement::determineAccessibilityRole()
+{
+ if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
+ return m_ariaRole;
+
+ Element* svgElement = element();
+
+ if (m_renderer->isSVGShape() || m_renderer->isSVGPath() || m_renderer->isSVGImage() || is<SVGUseElement>(svgElement))
+ return ImageRole;
+ if (m_renderer->isSVGForeignObject() || is<SVGGElement>(svgElement))
+ return GroupRole;
+ if (m_renderer->isSVGText())
+ return SVGTextRole;
+ if (m_renderer->isSVGTextPath())
+ return SVGTextPathRole;
+ if (m_renderer->isSVGTSpan())
+ return SVGTSpanRole;
+ if (is<SVGAElement>(svgElement))
+ return WebCoreLinkRole;
+
+ return AccessibilityRenderObject::determineAccessibilityRole();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/accessibility/AccessibilitySVGElement.h b/Source/WebCore/accessibility/AccessibilitySVGElement.h
new file mode 100644
index 0000000..cdbc733
--- /dev/null
+++ b/Source/WebCore/accessibility/AccessibilitySVGElement.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 Igalia, S.L.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AccessibilitySVGElement_h
+#define AccessibilitySVGElement_h
+
+#include "AccessibilityRenderObject.h"
+
+namespace WebCore {
+
+class AccessibilitySVGElement final : public AccessibilityRenderObject {
+
+public:
+ static Ref<AccessibilitySVGElement> create(RenderObject*);
+ virtual ~AccessibilitySVGElement();
+
+ String accessibilityDescription() const override;
+ String helpText() const override;
+
+protected:
+ explicit AccessibilitySVGElement(RenderObject*);
+ bool isAccessibilitySVGElement() const override { return true; }
+ bool computeAccessibilityIsIgnored() const override;
+ AccessibilityRole determineAriaRoleAttribute() const;
+
+private:
+ void accessibilityText(Vector<AccessibilityText>&) override;
+ AccessibilityRole determineAccessibilityRole() override;
+ bool inheritsPresentationalRole() const override;
+
+ AccessibilityObject* targetForUseElement() const;
+};
+
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilitySVGElement, isAccessibilitySVGElement())
+
+#endif // AccessibilitySVGElement_h
diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
index 75fc9e3..5ffe2ea 100644
--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
@@ -45,6 +45,7 @@
#include "HTMLTableElement.h"
#include "HostWindow.h"
#include "RenderObject.h"
+#include "SVGElement.h"
#include "Settings.h"
#include "TextIterator.h"
#include "VisibleUnits.h"
@@ -132,6 +133,19 @@
return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, textUnder);
}
+ if (is<SVGElement>(coreObject->element())) {
+ Vector<AccessibilityText> textOrder;
+ coreObject->accessibilityText(textOrder);
+
+ for (const auto& text : textOrder) {
+ if (text.textSource != HelpText && text.textSource != SummaryText)
+ return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, text.text);
+ }
+ // FIXME: This is to keep the next blocks from returning duplicate text.
+ // This behavior should be extended to all elements; not just SVG.
+ return cacheAndReturnAtkProperty(object, AtkCachedAccessibleName, "");
+ }
+
if (coreObject->isImage() || coreObject->isInputImage() || coreObject->isImageMap() || coreObject->isImageMapLink()) {
Node* node = coreObject->node();
if (is<HTMLElement>(node)) {
@@ -167,6 +181,20 @@
Node* node = nullptr;
if (coreObject->isAccessibilityRenderObject())
node = coreObject->node();
+
+ if (is<SVGElement>(node)) {
+ Vector<AccessibilityText> textOrder;
+ coreObject->accessibilityText(textOrder);
+
+ for (const auto& text : textOrder) {
+ if (text.textSource == HelpText || text.textSource == SummaryText || text.textSource == TitleTagText)
+ return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, text.text);
+ }
+ // FIXME: This is to keep the next blocks from returning duplicate text.
+ // This behavior should be extended to all elements; not just SVG.
+ return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, "");
+ }
+
if (!is<HTMLElement>(node) || coreObject->ariaRoleAttribute() != UnknownRole || coreObject->isImage())
return cacheAndReturnAtkProperty(object, AtkCachedAccessibleDescription, accessibilityDescription(coreObject));
@@ -572,6 +600,7 @@
case DocumentRegionRole:
case GroupRole:
case RadioGroupRole:
+ case SVGRootRole:
case TabPanelRole:
return ATK_ROLE_PANEL;
case RowHeaderRole:
@@ -620,6 +649,7 @@
#endif
case DivRole:
case PreRole:
+ case SVGTextRole:
return ATK_ROLE_SECTION;
case FooterRole:
return ATK_ROLE_FOOTER;
@@ -696,6 +726,8 @@
#endif
#if ATK_CHECK_VERSION(2, 15, 2)
case InlineRole:
+ case SVGTextPathRole:
+ case SVGTSpanRole:
return ATK_ROLE_STATIC;
#endif
default:
diff --git a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm b/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
index a6f836e..5a7fe33 100644
--- a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
+++ b/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
@@ -857,6 +857,9 @@
case SummaryRole:
case SystemWideRole:
case SVGRootRole:
+ case SVGTextPathRole:
+ case SVGTextRole:
+ case SVGTSpanRole:
case TabGroupRole:
case TabListRole:
case TabPanelRole:
diff --git a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
index b8d0dcd..248d398d 100644
--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
+++ b/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
@@ -2181,6 +2181,9 @@
{ RubyTextRole, NSAccessibilityGroupRole },
{ DetailsRole, NSAccessibilityGroupRole },
{ SummaryRole, NSAccessibilityGroupRole },
+ { SVGTextPathRole, NSAccessibilityGroupRole },
+ { SVGTextRole, NSAccessibilityGroupRole },
+ { SVGTSpanRole, NSAccessibilityGroupRole },
};
AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index 73c38bb..920f849 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -413,6 +413,7 @@
virtual bool isSVGShape() const { return false; }
virtual bool isSVGText() const { return false; }
virtual bool isSVGTextPath() const { return false; }
+ virtual bool isSVGTSpan() const { return false; }
virtual bool isSVGInline() const { return false; }
virtual bool isSVGInlineText() const { return false; }
virtual bool isSVGImage() const { return false; }
diff --git a/Source/WebCore/rendering/svg/RenderSVGTSpan.h b/Source/WebCore/rendering/svg/RenderSVGTSpan.h
index 2720b17..cbd5172 100644
--- a/Source/WebCore/rendering/svg/RenderSVGTSpan.h
+++ b/Source/WebCore/rendering/svg/RenderSVGTSpan.h
@@ -38,7 +38,10 @@
private:
void graphicsElement() const = delete;
const char* renderName() const override { return "RenderSVGTSpan"; }
+ bool isSVGTSpan() const override { return true; }
};
}
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGTSpan, isSVGTSpan())
+
#endif // !RenderSVGTSpan_h