mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 733382 - editable state bit should be presented on readonly inputs, r=davidb
--HG-- rename : accessible/tests/mochitest/states/test_inputs.xul => accessible/tests/mochitest/states/test_controls.xul
This commit is contained in:
parent
2a6c344efd
commit
b186e2ce6d
@ -98,7 +98,8 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
states::READONLY
|
||||
kNoReqStates,
|
||||
eReadonlyUntilEditable
|
||||
},
|
||||
{
|
||||
"button",
|
||||
@ -168,7 +169,8 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
states::READONLY
|
||||
kNoReqStates,
|
||||
eReadonlyUntilEditable
|
||||
},
|
||||
{
|
||||
"grid",
|
||||
@ -661,7 +663,10 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
||||
|
||||
// eARIASelectable
|
||||
nsStateMapEntry(&nsGkAtoms::aria_selected, kBoolType,
|
||||
states::SELECTABLE, states::SELECTED, 0, true)
|
||||
states::SELECTABLE, states::SELECTED, 0, true),
|
||||
|
||||
// eReadonlyUntilEditable
|
||||
nsStateMapEntry(states::READONLY, states::EDITABLE)
|
||||
};
|
||||
|
||||
/**
|
||||
@ -742,6 +747,23 @@ nsStateMapEntry::nsStateMapEntry() :
|
||||
mDefinedIfAbsent(false)
|
||||
{}
|
||||
|
||||
nsStateMapEntry::nsStateMapEntry(PRUint64 aDefaultState,
|
||||
PRUint64 aExclusingState) :
|
||||
mAttributeName(nsnull),
|
||||
mIsToken(false),
|
||||
mPermanentState(0),
|
||||
mValue1(nsnull),
|
||||
mState1(0),
|
||||
mValue2(nsnull),
|
||||
mState2(0),
|
||||
mValue3(nsnull),
|
||||
mState3(0),
|
||||
mDefaultState(aDefaultState),
|
||||
mDefinedIfAbsent(false),
|
||||
mExcludingState(aExclusingState)
|
||||
{
|
||||
}
|
||||
|
||||
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
|
||||
PRUint64 aPermanentState,
|
||||
PRUint64 aTrueState,
|
||||
@ -757,7 +779,8 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
|
||||
mValue3(nsnull),
|
||||
mState3(0),
|
||||
mDefaultState(aTrueState),
|
||||
mDefinedIfAbsent(aDefinedIfAbsent)
|
||||
mDefinedIfAbsent(aDefinedIfAbsent),
|
||||
mExcludingState(0)
|
||||
{
|
||||
if (aType == kMixedType) {
|
||||
mValue2 = "mixed";
|
||||
@ -773,7 +796,7 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
||||
mValue1(aValue1), mState1(aState1),
|
||||
mValue2(aValue2), mState2(aState2),
|
||||
mValue3(aValue3), mState3(aState3),
|
||||
mDefaultState(0), mDefinedIfAbsent(false)
|
||||
mDefaultState(0), mDefinedIfAbsent(false), mExcludingState(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -786,7 +809,7 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
||||
mValue1(aValue1), mState1(aState1),
|
||||
mValue2(aValue2), mState2(aState2),
|
||||
mValue3(aValue3), mState3(aState3),
|
||||
mDefaultState(0), mDefinedIfAbsent(true)
|
||||
mDefaultState(0), mDefinedIfAbsent(true), mExcludingState(0)
|
||||
{
|
||||
if (aDefaultStateRule == eUseFirstState)
|
||||
mDefaultState = aState1;
|
||||
@ -802,6 +825,15 @@ nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
||||
|
||||
const nsStateMapEntry& entry = nsARIAMap::gWAIStateMap[aStateMapEntryID];
|
||||
|
||||
// Non ARIA attribute case. Expose default state until excluding state is
|
||||
// presented.
|
||||
if (!entry.mAttributeName) {
|
||||
if (!(*aState & entry.mExcludingState))
|
||||
*aState |= entry.mDefaultState;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (entry.mIsToken) {
|
||||
// If attribute is considered as defined when it's absent then let's act
|
||||
// attribute value is "false" supposedly.
|
||||
|
@ -187,7 +187,8 @@ enum eStateMapEntryID
|
||||
eARIAReadonly,
|
||||
eARIAReadonlyOrEditable,
|
||||
eARIARequired,
|
||||
eARIASelectable
|
||||
eARIASelectable,
|
||||
eReadonlyUntilEditable
|
||||
};
|
||||
|
||||
class nsStateMapEntry
|
||||
@ -198,6 +199,12 @@ public:
|
||||
*/
|
||||
nsStateMapEntry();
|
||||
|
||||
/**
|
||||
* Used to expose permanent states presented until accessible has an excluding
|
||||
* state.
|
||||
*/
|
||||
nsStateMapEntry(PRUint64 aDefaultState, PRUint64 aExclusingState);
|
||||
|
||||
/**
|
||||
* Used for ARIA attributes having boolean or mixed values.
|
||||
*/
|
||||
@ -260,6 +267,9 @@ private:
|
||||
|
||||
// Permanent and false states are applied if attribute is absent
|
||||
bool mDefinedIfAbsent;
|
||||
|
||||
// If this state is presented in state bits then default state is not exposed.
|
||||
PRUint64 mExcludingState;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1617,11 +1617,7 @@ nsAccessible::State()
|
||||
state |= states::HORIZONTAL;
|
||||
}
|
||||
}
|
||||
|
||||
// If we are editable, force readonly bit off
|
||||
if (state & states::EDITABLE)
|
||||
state &= ~states::READONLY;
|
||||
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -1668,7 +1664,6 @@ nsAccessible::ApplyARIAState(PRUint64* aState)
|
||||
if (!mRoleMapEntry)
|
||||
return;
|
||||
|
||||
// Note: the readonly bitflag will be overridden later if content is editable
|
||||
*aState |= mRoleMapEntry->state;
|
||||
if (nsStateMapEntry::MapToStates(mContent, aState,
|
||||
mRoleMapEntry->attributeMap1) &&
|
||||
@ -1677,7 +1672,6 @@ nsAccessible::ApplyARIAState(PRUint64* aState)
|
||||
nsStateMapEntry::MapToStates(mContent, aState,
|
||||
mRoleMapEntry->attributeMap3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Not implemented by this class
|
||||
|
@ -168,11 +168,8 @@ nsHyperTextAccessible::NativeState()
|
||||
|
||||
nsCOMPtr<nsIEditor> editor = GetEditor();
|
||||
if (editor) {
|
||||
PRUint32 flags;
|
||||
editor->GetFlags(&flags);
|
||||
if (0 == (flags & nsIPlaintextEditor::eEditorReadonlyMask)) {
|
||||
states |= states::EDITABLE;
|
||||
}
|
||||
states |= states::EDITABLE;
|
||||
|
||||
} else if (mContent->Tag() == nsGkAtoms::article) {
|
||||
// We want <article> to behave like a document in terms of readonly state.
|
||||
states |= states::READONLY;
|
||||
|
@ -102,15 +102,6 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
|
||||
"Not focusable " + id + " must be not focused!");
|
||||
}
|
||||
|
||||
// readonly/editable
|
||||
if (state & STATE_READONLY)
|
||||
isState(extraState & EXT_STATE_EDITABLE, 0, true,
|
||||
"Read-only " + id + " cannot be editable!");
|
||||
|
||||
if (extraState & EXT_STATE_EDITABLE)
|
||||
isState(state & STATE_READONLY, 0, true,
|
||||
"Editable " + id + " cannot be readonly!");
|
||||
|
||||
// multiline/singleline
|
||||
if (extraState & EXT_STATE_MULTI_LINE)
|
||||
isState(extraState & EXT_STATE_SINGLE_LINE, 0, true,
|
||||
|
@ -50,13 +50,13 @@ _TEST_FILES =\
|
||||
test_aria_imgmap.html \
|
||||
test_aria_widgetitems.html \
|
||||
test_buttons.html \
|
||||
test_controls.xul \
|
||||
test_doc.html \
|
||||
test_docarticle.html \
|
||||
test_editablebody.html \
|
||||
test_expandable.xul \
|
||||
test_frames.html \
|
||||
test_inputs.html \
|
||||
test_inputs.xul \
|
||||
test_link.html \
|
||||
test_popup.xul \
|
||||
test_selects.html \
|
||||
|
@ -19,10 +19,6 @@
|
||||
|
||||
function doTest()
|
||||
{
|
||||
testStates("some-text", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("some-text2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
|
||||
testStates("some-password", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("some-password2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
|
||||
testStates("checkbox", STATE_FOCUSABLE, 0, STATE_UNAVAILABLE);
|
||||
testStates("checkbox2", STATE_UNAVAILABLE, 0 , STATE_FOCUSABLE);
|
||||
testStates("radio-group", 0, 0, STATE_UNAVAILABLE);
|
||||
@ -55,11 +51,6 @@
|
||||
|
||||
<vbox flex="1">
|
||||
|
||||
<textbox id="some-text"/>
|
||||
<textbox id="some-text2" disabled="true"/>
|
||||
<textbox id="some-password" type="password" maxlength="8"/>
|
||||
<textbox id="some-password2" type="password" maxlength="8" disabled="true"/>
|
||||
|
||||
<checkbox id="checkbox" checked="true" label="Steak"/>
|
||||
<checkbox id="checkbox2" checked="true" label="Salad" disabled="true"/>
|
||||
|
@ -20,7 +20,7 @@
|
||||
testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
|
||||
|
||||
// Bug 509696, 607219.
|
||||
testStates(document, STATE_READONLY); // role=""
|
||||
testStates(document, STATE_READONLY, 0); // role=""
|
||||
|
||||
document.body.setAttribute("role","banner"); // no platform mapping
|
||||
testStates(document, STATE_READONLY);
|
||||
@ -32,20 +32,20 @@
|
||||
// Bugs 454997 and 467387
|
||||
testStates(document, STATE_READONLY);
|
||||
testStates("document", STATE_READONLY);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
|
||||
document.designMode = "on";
|
||||
|
||||
testStates(document, 0, EXT_STATE_EDITABLE);
|
||||
testStates("p", 0, EXT_STATE_EDITABLE);
|
||||
testStates("document", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE);
|
||||
testStates(document, 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("p", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
|
||||
document.designMode = "off";
|
||||
|
||||
testStates(document, STATE_READONLY);
|
||||
testStates("document", STATE_READONLY);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_document", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -20,25 +20,26 @@
|
||||
if (docAcc) {
|
||||
testStates(docAcc, STATE_READONLY);
|
||||
testStates("aria_article", STATE_READONLY);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE,
|
||||
STATE_READONLY);
|
||||
testStates("article", STATE_READONLY);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
|
||||
document.designMode = "on";
|
||||
|
||||
testStates(docAcc, 0, EXT_STATE_EDITABLE);
|
||||
testStates("aria_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates(docAcc, 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
|
||||
document.designMode = "off";
|
||||
|
||||
testStates(docAcc, STATE_READONLY);
|
||||
testStates("aria_article", STATE_READONLY);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_aria_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
testStates("article", STATE_READONLY);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE);
|
||||
testStates("editable_article", 0, EXT_STATE_EDITABLE, STATE_READONLY);
|
||||
}
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -22,22 +22,32 @@
|
||||
frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
|
||||
frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
|
||||
|
||||
testStates(frameDoc, STATE_READONLY, 0, 0, 0, "test1: frameDoc");
|
||||
testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, "test1: frameDocArticle");
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, "test1: frameDocCheckbox");
|
||||
testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, 0, 0, "test1: frameDocTextbox");
|
||||
testStates(frameDoc, STATE_READONLY, 0, 0, 0,
|
||||
"test1: frameDoc");
|
||||
testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
|
||||
"test1: frameDocArticle");
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
|
||||
"test1: frameDocCheckbox");
|
||||
testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
|
||||
"test1: frameDocTextbox");
|
||||
|
||||
frameDoc.designMode = "on";
|
||||
testStates(frameDoc, 0, EXT_STATE_EDITABLE, 0, 0, "test2: frameDoc");
|
||||
testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, "test2: frameDocArticle");
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, "test2: frameDocCheckbox");
|
||||
testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, 0, 0, "test2: frameDocTextbox");
|
||||
testStates(frameDoc, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
|
||||
"test2: frameDoc");
|
||||
testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
|
||||
"test2: frameDocArticle");
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
|
||||
"test2: frameDocCheckbox");
|
||||
testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
|
||||
"test2: frameDocTextbox");
|
||||
|
||||
frameDocArticle.designMode = "on";
|
||||
testStates(frameDocArticle, 0, EXT_STATE_EDITABLE, 0, 0, "test3: frameDocArticle");
|
||||
testStates(frameDocArticle, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
|
||||
"test3: frameDocArticle");
|
||||
|
||||
frameDocCheckbox.designMode = "on";
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, "test4: frameDocCheckbox");
|
||||
testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
|
||||
"test4: frameDocCheckbox");
|
||||
|
||||
// Replace iframe document body before the document accessible tree is
|
||||
// created. Check the states are updated for new body.
|
||||
|
@ -16,37 +16,66 @@
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
// 'required' state. Also piggyback 'unavailable' testing here.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// 'editable' and 'multiline' states.
|
||||
testStates("input", 0, EXT_STATE_EDITABLE, 0, EXT_STATE_MULTI_LINE);
|
||||
testStates("textarea", 0, EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE);
|
||||
|
||||
testStates("input_readonly", 0, EXT_STATE_EDITABLE);
|
||||
testStates("input_disabled", 0, EXT_STATE_EDITABLE);
|
||||
testStates("textarea_readonly", 0, EXT_STATE_EDITABLE);
|
||||
testStates("textarea_disabled", 0, EXT_STATE_EDITABLE);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// 'required', 'readonly' and 'unavailable' states.
|
||||
var maybe_required = ["input","search","radio","checkbox","textarea"];
|
||||
var never_required = ["submit","button","reset","image"];
|
||||
|
||||
var i;
|
||||
for (i in maybe_required) {
|
||||
testStates(maybe_required[i], STATE_REQUIRED, 0, STATE_UNAVAILABLE);
|
||||
testStates(maybe_required[i] + "2", 0, 0, STATE_REQUIRED);
|
||||
testStates(maybe_required[i] + "3", STATE_UNAVAILABLE);
|
||||
testStates(maybe_required[i],
|
||||
STATE_FOCUSABLE, 0,
|
||||
STATE_REQUIRED | STATE_READONLY | STATE_UNAVAILABLE);
|
||||
|
||||
testStates(maybe_required[i] + "_required",
|
||||
STATE_FOCUSABLE | STATE_REQUIRED, 0,
|
||||
STATE_UNAVAILABLE | STATE_READONLY);
|
||||
|
||||
var readonlyID = maybe_required[i] + "_readonly";
|
||||
if (document.getElementById(readonlyID)) {
|
||||
testStates(readonlyID,
|
||||
STATE_FOCUSABLE | STATE_READONLY, 0,
|
||||
STATE_UNAVAILABLE | STATE_REQUIRED);
|
||||
}
|
||||
|
||||
testStates(maybe_required[i] + "_disabled",
|
||||
STATE_UNAVAILABLE, 0,
|
||||
STATE_FOCUSABLE | STATE_READONLY | STATE_REQUIRED);
|
||||
}
|
||||
|
||||
for (i in never_required) {
|
||||
testStates(never_required[i], 0, 0, STATE_REQUIRED);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// inherited 'unavailable' state
|
||||
testStates("f", STATE_UNAVAILABLE);
|
||||
testStates("f_input", STATE_UNAVAILABLE);
|
||||
testStates("f_input_disabled", STATE_UNAVAILABLE);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// inherited from file control
|
||||
var fileTextField = getAccessible("file").firstChild;
|
||||
testStates(fileTextField, STATE_UNAVAILABLE | STATE_REQUIRED);
|
||||
var fileBrowseButton = getAccessible("file").lastChild;
|
||||
testStates(fileBrowseButton, STATE_UNAVAILABLE | STATE_REQUIRED);
|
||||
|
||||
/**
|
||||
* maxlength doesn't make the element invalid until bug 613016 and bug 613019
|
||||
* are fixed. Commenting out related lines and adding a todo to make sure
|
||||
* it will be uncommented as soon as possible.
|
||||
*/
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// 'invalid' state
|
||||
|
||||
// XXX: maxlength doesn't make the element invalid until bug 613016 and
|
||||
// bug 613019 are fixed. Commenting out related lines and adding a todo to
|
||||
// make sure it will be uncommented as soon as possible.
|
||||
var todoInput = document.createElement("input");
|
||||
todoInput.maxLength = '2';
|
||||
todoInput.value = 'foo';
|
||||
@ -71,6 +100,7 @@
|
||||
testStates(invalid[i] + "2", 0, 0, STATE_INVALID);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// autocomplete states
|
||||
testStates("autocomplete-default", 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
|
||||
testStates("autocomplete-off", 0, 0, 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
|
||||
@ -121,6 +151,11 @@
|
||||
title="File input control should be propogate states to descendants">
|
||||
Mozilla Bug 699017
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=733382"
|
||||
title="Editable state bit should be present on readonly inputs">
|
||||
Mozilla Bug 733382
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
@ -128,21 +163,24 @@
|
||||
|
||||
|
||||
<form>
|
||||
<input id="input" type="input" required>
|
||||
<input id="input2" type="input">
|
||||
<input id="input3" type="input" disabled>
|
||||
<input id="search" type="search" required>
|
||||
<input id="search2" type="search">
|
||||
<input id="search3" type="search" disabled>
|
||||
<input id="radio" type="radio" required>
|
||||
<input id="radio2" type="radio">
|
||||
<input id="radio3" type="radio" disabled>
|
||||
<input id="checkbox" type="checkbox" required>
|
||||
<input id="checkbox2" type="checkbox">
|
||||
<input id="checkbox3" type="checkbox" disabled>
|
||||
<textarea id="textarea" required></textarea>
|
||||
<textarea id="textarea2"></textarea>
|
||||
<textarea id="textarea3" disabled></textarea>
|
||||
<input id="input" type="input">
|
||||
<input id="input_required" type="input" required>
|
||||
<input id="input_readonly" type="input" readonly>
|
||||
<input id="input_disabled" type="input" disabled>
|
||||
<input id="search" type="search">
|
||||
<input id="search_required" type="search" required>
|
||||
<input id="search_readonly" type="search" readonly>
|
||||
<input id="search_disabled" type="search" disabled>
|
||||
<input id="radio" type="radio">
|
||||
<input id="radio_required" type="radio" required>
|
||||
<input id="radio_disabled" type="radio" disabled>
|
||||
<input id="checkbox" type="checkbox">
|
||||
<input id="checkbox_required" type="checkbox" required>
|
||||
<input id="checkbox_disabled" type="checkbox" disabled>
|
||||
<textarea id="textarea"></textarea>
|
||||
<textarea id="textarea_required" required></textarea>
|
||||
<textarea id="textarea_readonly" readonly></textarea>
|
||||
<textarea id="textarea_disabled" disabled></textarea>
|
||||
</form>
|
||||
|
||||
<!-- bogus required usage -->
|
||||
|
@ -23,65 +23,83 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Ordinary textbox
|
||||
testStates("textbox",
|
||||
STATE_FOCUSABLE, EXT_STATE_EDITABLE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE,
|
||||
EXT_STATE_EDITABLE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"ordinary textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Password textbox
|
||||
testStates("password",
|
||||
STATE_FOCUSABLE | STATE_PROTECTED, EXT_STATE_EDITABLE,
|
||||
STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE | STATE_PROTECTED,
|
||||
EXT_STATE_EDITABLE,
|
||||
STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"password textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Textarea
|
||||
testStates("textarea",
|
||||
STATE_FOCUSABLE, EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE,
|
||||
EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"multiline textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Readonly textbox
|
||||
testStates("readonly_textbox",
|
||||
STATE_FOCUSABLE | STATE_READONLY, 0,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE | STATE_READONLY,
|
||||
EXT_STATE_EDITABLE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"readonly textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Disabled textbox
|
||||
testStates("disabled_textbox",
|
||||
STATE_UNAVAILABLE, 0,
|
||||
STATE_FOCUSABLE | STATE_PROTECTED, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_UNAVAILABLE,
|
||||
EXT_STATE_EDITABLE,
|
||||
STATE_FOCUSABLE | STATE_PROTECTED,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"readonly textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Readonly textarea
|
||||
testStates("readonly_textarea",
|
||||
STATE_FOCUSABLE | STATE_READONLY, EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE | STATE_READONLY,
|
||||
EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"readonly multiline textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Disabled textarea
|
||||
testStates("disabled_textarea",
|
||||
STATE_UNAVAILABLE, EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_FOCUSABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_UNAVAILABLE,
|
||||
EXT_STATE_EDITABLE| EXT_STATE_MULTI_LINE,
|
||||
STATE_PROTECTED | STATE_FOCUSABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"readonly multiline textbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Search textbox without search button, searches as you type and filters
|
||||
// a separate control.
|
||||
testStates("searchbox",
|
||||
STATE_FOCUSABLE, EXT_STATE_EDITABLE | EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, 0,
|
||||
STATE_FOCUSABLE,
|
||||
EXT_STATE_EDITABLE | EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
0,
|
||||
"searchbox");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Search textbox with search button, does not support autoCompletion.
|
||||
testStates("searchfield",
|
||||
STATE_FOCUSABLE, EXT_STATE_EDITABLE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE, EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
STATE_FOCUSABLE,
|
||||
EXT_STATE_EDITABLE,
|
||||
STATE_PROTECTED | STATE_UNAVAILABLE,
|
||||
EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
||||
"searchfield");
|
||||
|
||||
SimpleTest.finish();
|
||||
|
@ -27,9 +27,8 @@ function testAction(aID, aAcc, aNumActions, aActionName, aActionDescription)
|
||||
}
|
||||
}
|
||||
|
||||
function testThis(aID, aName, aValue, aDescription, aRole, aState,
|
||||
aExtraState, aAbsentState, aNumActions, aActionName,
|
||||
aActionDescription)
|
||||
function testThis(aID, aName, aValue, aDescription, aRole,
|
||||
aNumActions, aActionName, aActionDescription)
|
||||
{
|
||||
var acc = getAccessible(aID);
|
||||
if (!acc)
|
||||
@ -40,7 +39,5 @@ function testThis(aID, aName, aValue, aDescription, aRole, aState,
|
||||
is(acc.description, aDescription, "Wrong description for " + aID + "!");
|
||||
testRole(aID, aRole);
|
||||
|
||||
testStates(acc, aState, aExtraState, aAbsentState);
|
||||
|
||||
testAction(aID, acc, aNumActions, aActionName, aActionDescription);
|
||||
}
|
||||
|
@ -30,9 +30,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -44,9 +41,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -58,9 +52,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"I have some text", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -72,9 +63,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_PASSWORD_TEXT, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -86,9 +74,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -100,9 +85,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -114,9 +96,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
" I also have some text.\n ", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -128,9 +107,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
"You cannot change me.", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE | STATE_READONLY), // state
|
||||
(0), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -142,9 +118,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
|
||||
" You cannot change me, either.\n ", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE | STATE_READONLY), // state
|
||||
(EXT_STATE_MULTI_LINE), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
|
@ -30,9 +30,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -44,9 +41,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -58,9 +52,6 @@
|
||||
"I have some text", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -72,9 +63,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_PASSWORD_TEXT, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -86,9 +74,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -100,9 +85,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -114,9 +96,6 @@
|
||||
"I also have some text.", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_EDITABLE | EXT_STATE_MULTI_LINE), // extState
|
||||
(STATE_READONLY), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -128,9 +107,6 @@
|
||||
"You cannot change me.", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE | STATE_READONLY), // state
|
||||
(0), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -142,9 +118,6 @@
|
||||
"You cannot change me, either.", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE | STATE_READONLY), // state
|
||||
(EXT_STATE_MULTI_LINE), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -157,9 +130,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(EXT_STATE_SUPPORTS_AUTOCOMPLETION), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
@ -171,9 +141,6 @@
|
||||
"", // value
|
||||
"", // description
|
||||
ROLE_ENTRY, // role
|
||||
(STATE_FOCUSABLE), // state
|
||||
(0), // extState
|
||||
(0), // absentState
|
||||
1, // numActions
|
||||
"activate", // ActionName
|
||||
"Activate"); // ActionDescription
|
||||
|
Loading…
Reference in New Issue
Block a user