2009-04-22 04:22:36 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
2009-12-10 11:12:19 -08:00
|
|
|
<title>HTML text controls tests</title>
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
2009-04-22 04:22:36 -07:00
|
|
|
|
|
|
|
<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"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../common.js"></script>
|
2009-04-22 04:22:36 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../role.js"></script>
|
2009-04-22 04:22:36 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
function doTest()
|
|
|
|
{
|
2009-12-10 11:12:19 -08:00
|
|
|
// editable div
|
2009-04-22 04:22:36 -07:00
|
|
|
var accTree = {
|
|
|
|
role: ROLE_SECTION,
|
|
|
|
children: [
|
|
|
|
{ // text child
|
2009-12-10 11:12:19 -08:00
|
|
|
role: ROLE_TEXT_LEAF,
|
|
|
|
children: []
|
2009-04-22 04:22:36 -07:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
testAccessibleTree("txc1", accTree);
|
|
|
|
|
2011-01-28 00:42:22 -08:00
|
|
|
// input@type="text", value
|
2009-12-10 11:12:19 -08:00
|
|
|
accTree = {
|
|
|
|
role: ROLE_ENTRY,
|
|
|
|
children: [
|
|
|
|
{ // text child
|
|
|
|
role: ROLE_TEXT_LEAF,
|
|
|
|
children: []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
testAccessibleTree("txc2", accTree);
|
|
|
|
|
2011-01-28 00:42:22 -08:00
|
|
|
// input@type="text", no value
|
|
|
|
accTree =
|
2011-01-31 07:53:09 -08:00
|
|
|
{ ENTRY: [ ] };
|
2011-01-28 00:42:22 -08:00
|
|
|
|
|
|
|
testAccessibleTree("txc3", accTree);
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
// textarea
|
|
|
|
accTree = {
|
|
|
|
role: ROLE_ENTRY,
|
|
|
|
children: [
|
|
|
|
{
|
2010-07-12 20:02:03 -07:00
|
|
|
role: ROLE_TEXT_LEAF // hello1\nhello2 text
|
2009-12-10 11:12:19 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
role: ROLE_WHITESPACE
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2011-01-28 00:42:22 -08:00
|
|
|
testAccessibleTree("txc4", accTree);
|
2009-04-22 04:22:36 -07:00
|
|
|
|
2010-02-01 07:22:35 -08:00
|
|
|
// input@type="password"
|
|
|
|
accTree = {
|
|
|
|
role: ROLE_PASSWORD_TEXT,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
role: ROLE_TEXT_LEAF,
|
|
|
|
children: []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2011-01-28 00:42:22 -08:00
|
|
|
testAccessibleTree("txc5", accTree);
|
2010-02-01 07:22:35 -08:00
|
|
|
|
2009-04-22 04:22:36 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2009-04-22 04:22:36 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank"
|
|
|
|
title="overflowed content doesn't expose child text accessibles"
|
2010-02-01 07:22:35 -08:00
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=489306">
|
|
|
|
Mozilla Bug 489306
|
|
|
|
</a><br>
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=542824"
|
|
|
|
title="Create child accessibles for text controls from native anonymous content">
|
|
|
|
Mozilla Bug 542824
|
|
|
|
</a>
|
2011-01-28 00:42:22 -08:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652"
|
|
|
|
title="Make sure accessible tree is correct when rendered text is changed">
|
|
|
|
Mozilla Bug 625652
|
|
|
|
</a>
|
2010-02-01 07:22:35 -08:00
|
|
|
|
2009-04-22 04:22:36 -07:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
2009-12-10 11:12:19 -08:00
|
|
|
<div id="txc1" contentEditable="true">
|
|
|
|
1hellohello
|
2009-04-22 04:22:36 -07:00
|
|
|
</div>
|
2009-12-10 11:12:19 -08:00
|
|
|
<input id="txc2" value="hello">
|
2011-01-28 00:42:22 -08:00
|
|
|
<input id="txc3">
|
|
|
|
<textarea id="txc4">
|
2009-12-10 11:12:19 -08:00
|
|
|
hello1
|
|
|
|
hello2
|
|
|
|
</textarea>
|
2011-01-28 00:42:22 -08:00
|
|
|
<input id="txc5" type="password" value="hello">
|
2009-12-10 11:12:19 -08:00
|
|
|
|
2009-04-22 04:22:36 -07:00
|
|
|
</body>
|
|
|
|
</html>
|