Bug 822988: Create HyperTextAccessibleWrap for SVG text objects for correct role assignment. r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D49202

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Morgan Reschenberg 2019-10-14 21:51:58 +00:00
Родитель a964c79cd0
Коммит c157ae77f0
3 изменённых файлов: 50 добавлений и 0 удалений

Просмотреть файл

@ -1115,6 +1115,8 @@ Accessible* nsAccessibilityService::CreateAccessible(nsINode* aNode,
// polyline and image. A 'use' and 'text' graphic elements require
// special support.
newAcc = new EnumRoleAccessible<roles::GRAPHIC>(content, document);
} else if (content->IsSVGElement(nsGkAtoms::text)) {
newAcc = new HyperTextAccessibleWrap(content->AsElement(), document);
} else if (content->IsSVGElement(nsGkAtoms::svg)) {
newAcc = new EnumRoleAccessible<roles::DIAGRAM>(content, document);
}

Просмотреть файл

@ -43,6 +43,7 @@ skip-if = true # Bug 561508
[test_map.html]
[test_media.html]
[test_select.html]
[test_svg.html]
[test_tabbox.xul]
[test_tabbrowser.xul]
skip-if = (os == 'linux' && debug) || (os == 'win' && ccov) # Bug 1389365 || bug 1423218

Просмотреть файл

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>SVG Tree Tests</title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../role.js"></script>
<script type="application/javascript">
function doTest() {
var accTree = {
role: ROLE_DIAGRAM,
children: [
{
role: ROLE_TEXT_CONTAINER,
children: [
{
role: ROLE_TEXT_LEAF,
},
],
},
],
};
testAccessibleTree("svgItem", accTree);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<svg id="svgItem">
<text>This is some text</text>
</svg>
</body>
</html>