gecko/accessible/tests/mochitest/tree/test_txtctrl.html

103 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>HTML text controls tests</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript">
function doTest()
{
// editable div
var accTree = {
role: ROLE_SECTION,
children: [
{ // text child
role: ROLE_TEXT_LEAF,
children: []
}
]
};
testAccessibleTree("txc1", accTree);
// input@type="text"
accTree = {
role: ROLE_ENTRY,
children: [
{ // text child
role: ROLE_TEXT_LEAF,
children: []
}
]
};
testAccessibleTree("txc2", accTree);
// textarea
accTree = {
role: ROLE_ENTRY,
children: [
{
role: ROLE_TEXT_LEAF // hello1 text
},
{
role: ROLE_WHITESPACE
},
{
role: ROLE_TEXT_LEAF, // hello2 text
},
{
role: ROLE_WHITESPACE
},
{
role: ROLE_TEXT_LEAF, // whitepsace text
},
{
role: ROLE_WHITESPACE
}
]
};
testAccessibleTree("txc3", accTree);
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
title="overflowed content doesn't expose child text accessibles"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">Mozilla Bug 489306</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="txc1" contentEditable="true">
1hellohello
</div>
<input id="txc2" value="hello">
<textarea id="txc3">
hello1
hello2
</textarea>
</body>
</html>