bug 886208 - don't force editor creation in HyperTextAccessible::NativeState() r=surkov

This commit is contained in:
Trevor Saunders 2013-12-20 11:53:58 -05:00
parent d804475b12
commit f6f24b3ef9
2 changed files with 26 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#include "nsIPersistentProperties2.h"
#include "nsIScrollableFrame.h"
#include "nsIServiceManager.h"
#include "nsITextControlElement.h"
#include "nsTextFragment.h"
#include "mozilla/Selection.h"
#include "mozilla/MathAlgorithms.h"
@ -102,8 +103,19 @@ HyperTextAccessible::NativeState()
{
uint64_t states = AccessibleWrap::NativeState();
nsCOMPtr<nsIEditor> editor = GetEditor();
if (editor) {
nsCOMPtr<nsITextControlElement> textControl = do_QueryInterface(mContent);
bool editable = !!textControl;
Accessible* hyperText = this;
while (!editable && hyperText) {
if (hyperText->IsHyperText())
editable = hyperText->GetNode()->IsEditable();
if (hyperText->IsDoc())
break;
hyperText = hyperText->Parent();
}
if (editable) {
states |= states::EDITABLE;
} else if (mContent->Tag() == nsGkAtoms::article) {

View File

@ -733,7 +733,12 @@
states: STATE_PROTECTED,
extraStates: EXT_STATE_EDITABLE,
actions: "activate",
children: [ ]
children: [
{
role: ROLE_TEXT_LEAF,
name: "●●"
}
]
};
testElm("input_password", obj);
@ -741,7 +746,12 @@
role: ROLE_PASSWORD_TEXT,
states: STATE_PROTECTED | STATE_READONLY,
actions: "activate",
children: [ ]
children: [
{
role: ROLE_TEXT_LEAF,
name: "●●"
}
]
};
testElm("input_password_readonly", obj);