mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 886208 - don't force editor creation in HyperTextAccessible::NativeState() r=surkov
This commit is contained in:
parent
2808193d74
commit
417617ecf2
@ -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) {
|
||||
|
@ -733,17 +733,29 @@
|
||||
states: STATE_PROTECTED,
|
||||
extraStates: EXT_STATE_EDITABLE,
|
||||
actions: "activate",
|
||||
children: [ ]
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
};
|
||||
testElm("input_password", obj);
|
||||
ok(getAccessible("input_password").firstChild.name != "44",
|
||||
"text leaf for password shouldn't have its real value as its name!");
|
||||
|
||||
obj = {
|
||||
role: ROLE_PASSWORD_TEXT,
|
||||
states: STATE_PROTECTED | STATE_READONLY,
|
||||
actions: "activate",
|
||||
children: [ ]
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF
|
||||
}
|
||||
]
|
||||
};
|
||||
testElm("input_password_readonly", obj);
|
||||
ok(getAccessible("input_password_readonly").firstChild.name != "44",
|
||||
"text leaf for password shouldn't have its real value as its name!");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// HTML:input@type="radio"
|
||||
|
Loading…
Reference in New Issue
Block a user