2008-07-02 10:09:53 -07: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/tests/SimpleTest/SimpleTest.js" />
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="common.js" />
|
2009-03-07 03:23:25 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="role.js" />
|
2009-01-06 06:04:28 -08:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="states.js" />
|
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" />
|
2008-07-02 10:09:53 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
<![CDATA[
|
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// normal textbox without content and with no proper label
|
|
|
|
testThis("unlabelled_Textbox", // ID
|
2009-01-06 07:33:45 -08:00
|
|
|
null, // name
|
2008-07-02 10:09:53 -07:00
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// textarea without content and label
|
|
|
|
testThis("unlabelled_Textarea", // ID
|
2009-01-06 07:33:45 -08:00
|
|
|
null, // name
|
2008-07-02 10:09:53 -07:00
|
|
|
"", // value
|
|
|
|
"", // description
|
2009-01-06 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"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 06:04:28 -08:00
|
|
|
ROLE_ENTRY, // role
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2008-07-02 10:09:53 -07:00
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
|
2009-02-02 01:38:53 -08: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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2009-02-02 01:38:53 -08:00
|
|
|
"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
|
2012-05-26 08:47:22 -07:00
|
|
|
1, // actionCount
|
2009-02-02 01:38:53 -08:00
|
|
|
"activate", // ActionName
|
|
|
|
"Activate"); // ActionDescription
|
|
|
|
testStates("searchfield", 0, 0, 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
|
|
|
|
|
2008-07-02 10:09:53 -07:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2008-07-02 10:09:53 -07: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 01:38:53 -08:00
|
|
|
<hbox>
|
|
|
|
<label value="Search History:" accesskey="S"
|
|
|
|
control="search-box"/>
|
2009-04-13 10:40:00 -07:00
|
|
|
<textbox id="search-box" flex="1" type="search"
|
2009-02-02 01:38:53 -08:00
|
|
|
results="historyTree"/>
|
|
|
|
</hbox>
|
2010-03-03 23:13:27 -08:00
|
|
|
<textbox id="searchfield" placeholder="Search all add-ons"
|
2009-04-13 10:40:00 -07:00
|
|
|
type="search" searchbutton="true"/>
|
2008-07-02 10:09:53 -07:00
|
|
|
</vbox>
|
|
|
|
</window>
|