2008-07-02 21:09:53 +04:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
|
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
|
|
|
type="text/css"?>
|
|
|
|
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
title="nsIAccessible XUL textboxes chrome tests">
|
|
|
|
|
|
|
|
<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 type="application/javascript"
|
2008-09-16 18:38:48 +04:00
|
|
|
src="chrome://mochikit/content/a11y/accessible/common.js" />
|
2009-03-07 14:23:25 +03:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/role.js" />
|
2009-01-06 17:04:28 +03:00
|
|
|
<script type="application/javascript"
|
2009-05-22 20:09:51 +04:00
|
|
|
src="chrome://mochikit/content/a11y/accessible/states.js" />
|
2009-01-06 17:04:28 +03:00
|
|
|
|
2008-09-16 18:38:48 +04:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/testTextboxes.js" />
|
2008-07-02 21:09:53 +04:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// normal textbox without content and with no proper label
|
|
|
|
testThis("unlabelled_Textbox", // ID
|
2009-01-06 18:33:45 +03:00
|
|
|
null, // name
|
2008-07-02 21:09:53 +04:00
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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 17:04:28 +03:00
|
|
|
ROLE_PASSWORD_TEXT, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04:00
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// textarea without content and label
|
|
|
|
testThis("unlabelled_Textarea", // ID
|
2009-01-06 18:33:45 +03:00
|
|
|
null, // name
|
2008-07-02 21:09:53 +04:00
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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.", // value
|
|
|
|
"", // description
|
2009-01-06 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
|
|
|
(STATE_READONLY), // absentState
|
2008-07-02 21:09:53 +04: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 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE | STATE_READONLY), // state
|
2008-07-02 21:09:53 +04: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.", // value
|
|
|
|
"", // description
|
2009-01-06 17:04:28 +03:00
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE | STATE_READONLY), // state
|
|
|
|
(EXT_STATE_MULTI_LINE), // extState
|
2008-07-02 21:09:53 +04:00
|
|
|
(0), // absentState
|
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
2009-02-02 12:38:53 +03:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// Search textbox without search button, searches as you type and filters
|
|
|
|
// a separate control.
|
|
|
|
testThis("search-box", // ID
|
|
|
|
"Search History:", // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(EXT_STATE_SUPPORTS_AUTOCOMPLETION), // extState
|
|
|
|
(0), // absentState
|
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// Search textbox with search button, does not support autoCompletion.
|
|
|
|
testThis("searchfield", // ID
|
|
|
|
"Search all add-ons", // name
|
|
|
|
"", // value
|
|
|
|
"", // description
|
|
|
|
ROLE_ENTRY, // role
|
|
|
|
(STATE_FOCUSABLE), // state
|
|
|
|
(0), // extState
|
|
|
|
(0), // absentState
|
|
|
|
1, // numActions
|
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
testStates("searchfield", 0, 0, 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
|
|
|
|
|
2008-07-02 21:09:53 +04:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 18:21:47 +04:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-07-02 21:09:53 +04:00
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<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>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<vbox>
|
|
|
|
<hbox>
|
|
|
|
<label value="Text before input without labelling it:"/>
|
|
|
|
<textbox id="unlabelled_Textbox" size="50"/>
|
|
|
|
</hbox>
|
|
|
|
<hbox>
|
|
|
|
<label control="labelled_textbox">Second textbox:</label>
|
|
|
|
<textbox id="labelled_textbox"/>
|
|
|
|
</hbox>
|
|
|
|
<hbox>
|
|
|
|
<label control="prefilled_textbox">Textbox with predefined value:</label>
|
|
|
|
<textbox id="prefilled_textbox" value="I have some text" size="80"/>
|
|
|
|
</hbox>
|
|
|
|
<hbox>
|
|
|
|
<label control="password_textbox">Enter some password here:</label>
|
|
|
|
<textbox type="password" id="password_textbox"/>
|
|
|
|
</hbox>
|
|
|
|
<vbox>
|
|
|
|
<label value="Textarea without label:"/>
|
|
|
|
<textbox multiline="true" id="unlabelled_Textarea" cols="80" rows="5"/>
|
|
|
|
</vbox>
|
|
|
|
<vbox>
|
|
|
|
<label control="labelled_textarea">Labelled textarea:</label>
|
|
|
|
<textbox multiline="true" id="labelled_textarea" cols="80" rows="5"/>
|
|
|
|
</vbox>
|
|
|
|
<vbox>
|
|
|
|
<label control="prefilled_textarea">Pre-filled textarea:</label>
|
|
|
|
<textbox multiline="true" id="prefilled_textarea" cols="80" rows="5"
|
|
|
|
value="I also have some text."/>
|
|
|
|
</vbox>
|
|
|
|
<hbox>
|
|
|
|
<label control="readonly_textbox">The following is a read-only textbox:</label>
|
|
|
|
<textbox readonly="true" id="readonly_textbox"
|
|
|
|
value="You cannot change me."/>
|
|
|
|
</hbox>
|
|
|
|
<vbox>
|
|
|
|
<label control="readonly_textarea">This textarea is readonly, too:</label>
|
|
|
|
<textbox multiline="true" id="readonly_textarea" readonly="true" cols="80"
|
|
|
|
rows="5" value="You cannot change me, either."/>
|
|
|
|
</vbox>
|
2009-02-02 12:38:53 +03:00
|
|
|
<hbox>
|
|
|
|
<label value="Search History:" accesskey="S"
|
|
|
|
control="search-box"/>
|
2009-04-13 21:40:00 +04:00
|
|
|
<textbox id="search-box" flex="1" type="search"
|
2009-02-02 12:38:53 +03:00
|
|
|
results="historyTree"/>
|
|
|
|
</hbox>
|
2010-03-04 10:13:27 +03:00
|
|
|
<textbox id="searchfield" placeholder="Search all add-ons"
|
2009-04-13 21:40:00 +04:00
|
|
|
type="search" searchbutton="true"/>
|
2008-07-02 21:09:53 +04:00
|
|
|
</vbox>
|
|
|
|
</window>
|