2008-07-02 10:09:53 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>nsIAccessible textboxes chrome tests</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
|
|
|
|
2008-09-16 07:38:48 -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>
|
2008-07-02 10:09:53 -07:00
|
|
|
|
2008-09-16 07:38:48 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="common.js"></script>
|
2009-03-07 03:23:25 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="role.js"></script>
|
2009-01-06 06:04:28 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="states.js"></script>
|
2009-01-06 06:04:28 -08:00
|
|
|
|
2008-09-16 07:38:48 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="testTextboxes.js"></script>
|
2008-07-02 10:09:53 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// normal textbox without content and with no proper label
|
|
|
|
testThis("unlabelled_Textbox", // ID
|
|
|
|
null, // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// normal textbox without content and with a proper label
|
|
|
|
testThis("labelled_textbox", // ID
|
|
|
|
"Second textbox:", // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// normal textbox with content and with a proper label
|
|
|
|
testThis("prefilled_textbox", // ID
|
|
|
|
"Textbox with predefined value:", // name
|
|
|
|
"I have some text", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// password textbox with a proper label
|
|
|
|
testThis("password_textbox", // ID
|
|
|
|
"Enter some password here:", // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_PASSWORD_TEXT, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// textarea without content and label
|
|
|
|
testThis("unlabelled_Textarea", // ID
|
|
|
|
null, // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// textarea without content and with proper label
|
|
|
|
testThis("labelled_textarea", // ID
|
|
|
|
"Labelled textarea:", // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// textarea with content and with proper label
|
|
|
|
testThis("prefilled_textarea", // ID
|
|
|
|
"Pre-filled textarea:", // name
|
|
|
|
" I also have some text.\n ", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 10:09:53 -07:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// readonly textbox with content and with proper label
|
|
|
|
testThis("readonly_textbox", // ID
|
|
|
|
"The following is a read-only textbox:", // name
|
|
|
|
"You cannot change me.", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE | STATE_READONLY), // state
|
2008-07-02 10:09:53 -07:00
|
|
|
(0), // extState
|
|
|
|
(0), // absentState
|
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// readonly textarea with content and with proper label
|
|
|
|
testThis("readonly_textarea", // ID
|
|
|
|
"This textarea is readonly, too:", // name
|
|
|
|
" You cannot change me, either.\n ", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE | STATE_READONLY), // state
|
|
|
|
(EXT_STATE_MULTI_LINE), // extState
|
2008-07-02 10:09:53 -07:00
|
|
|
(0), // absentState
|
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-07-02 10:09:53 -07:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=442648">Mozilla Bug 442648</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
<form action="test.php" method="post">
|
|
|
|
Text before input without labelling it:
|
|
|
|
<input type="text" name="unlabelled_Textbox" id="unlabelled_Textbox" size="50"/>
|
|
|
|
<br><label for="labelled_textbox">Second textbox:</label>
|
|
|
|
<input type="text" name="labelled_Textbox" id="labelled_textbox"/>
|
|
|
|
<br><label for="prefilled_textbox">Textbox with predefined value:</label>
|
|
|
|
<input type="text" name="prefilled_Textbox" id="prefilled_textbox" value="I have some text" size="80"/>
|
|
|
|
<br><label for="password_textbox">Enter some password here:</label>
|
|
|
|
<input type="password" name="password_Textbox" id="password_textbox"/>
|
|
|
|
<br>Textarea without label:<br>
|
|
|
|
<textarea id="unlabelled_Textarea" name="unlabelled_Textarea" cols="80" rows="5"></textarea>
|
|
|
|
<br><label for="labelled_textarea">Labelled textarea:</label><br>
|
|
|
|
<textarea id="labelled_textarea" name="labelled_Textarea" cols="80" rows="5"></textarea>
|
|
|
|
<br><label for="prefilled_textarea">Pre-filled textarea:</label><br>
|
|
|
|
<textarea id="prefilled_textarea" name="prefilled_Textarea" cols="80" rows="5">
|
|
|
|
I also have some text.
|
|
|
|
</textarea>
|
|
|
|
<br><label for="readonly_textbox">The following is a read-only textbox:</label>
|
|
|
|
<input type="text" readonly="true" name="readonly_Textbox" id="readonly_textbox" value="You cannot change me."/>
|
|
|
|
<br><label for="readonly_textarea">This textarea is readonly, too:</label><br>
|
|
|
|
<textarea name="readonly_Textarea" id="readonly_textarea" readonly="true" cols="80" rows="5">
|
|
|
|
You cannot change me, either.
|
|
|
|
</textarea>
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|