Bug 648235 - Use more underlying HTML input states for XUL textboxes, r=davidb

This commit is contained in:
Alexander Surkov
2011-04-10 08:37:04 +09:00
parent 98e001ee23
commit 16de1d7196
6 changed files with 146 additions and 35 deletions

View File

@@ -495,13 +495,14 @@ nsHTMLTextFieldAccessible::GetStateInternal(PRUint32 *aState,
nsCOMPtr<nsIContent> bindingContent = mContent->GetBindingParent();
if (bindingContent &&
bindingContent->NodeInfo()->Equals(nsAccessibilityAtoms::textbox,
kNameSpaceID_XUL) &&
bindingContent->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
nsAccessibilityAtoms::autocomplete,
eIgnoreCase)) {
// If parent is XUL textbox and value of @type attribute is "autocomplete",
// then this accessible supports autocompletion.
*aExtraState |= nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION;
kNameSpaceID_XUL)) {
if (bindingContent->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
nsAccessibilityAtoms::autocomplete,
eIgnoreCase)) {
// If parent is XUL textbox and value of @type attribute is "autocomplete",
// then this accessible supports autocompletion.
*aExtraState |= nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION;
}
} else if (gIsFormFillEnabled && htmlInput &&
!(*aState & nsIAccessibleStates::STATE_PROTECTED)) {
// Check to see if autocompletion is allowed on this input. We don't expose