mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 349860. Magnifier doesn't follow input or caret navigation. r=evan.yan
This commit is contained in:
parent
65db450837
commit
66c8957aa5
@ -311,6 +311,43 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible::Shutdown()
|
||||
return nsHyperTextAccessible::Shutdown();
|
||||
}
|
||||
|
||||
void nsHTMLTextFieldAccessible::CacheChildren()
|
||||
{
|
||||
if (!mWeakShell) {
|
||||
// This node has been shut down
|
||||
mAccChildCount = eChildCountUninitialized;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mAccChildCount == eChildCountUninitialized) {
|
||||
nsCOMPtr<nsIEditor> editor = GetEditor();
|
||||
if (!editor) {
|
||||
nsAccessible::CacheChildren();
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIDOMElement> editorRoot;
|
||||
editor->GetRootElement(getter_AddRefs(editorRoot));
|
||||
nsCOMPtr<nsIDOMNode> editorRootDOMNode = do_QueryInterface(editorRoot);
|
||||
if (!editorRootDOMNode) {
|
||||
return;
|
||||
}
|
||||
nsAccessibleTreeWalker walker(mWeakShell, editorRootDOMNode, PR_TRUE);
|
||||
nsCOMPtr<nsPIAccessible> privatePrevAccessible;
|
||||
PRInt32 childCount = 0;
|
||||
walker.GetFirstChild();
|
||||
SetFirstChild(walker.mState.accessible);
|
||||
|
||||
while (walker.mState.accessible) {
|
||||
++ childCount;
|
||||
privatePrevAccessible = do_QueryInterface(walker.mState.accessible);
|
||||
privatePrevAccessible->SetParent(this);
|
||||
walker.GetNextSibling();
|
||||
privatePrevAccessible->SetNextSibling(walker.mState.accessible);
|
||||
}
|
||||
mAccChildCount = childCount;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole)
|
||||
{
|
||||
*aRole = ROLE_ENTRY;
|
||||
|
@ -110,6 +110,7 @@ public:
|
||||
NS_IMETHOD GetActionName(PRUint8 index, nsAString& _retval);
|
||||
NS_IMETHOD DoAction(PRUint8 index);
|
||||
NS_IMETHOD GetExtState(PRUint32 *aExtState);
|
||||
void CacheChildren();
|
||||
|
||||
protected:
|
||||
// Editor helpers, subclasses of nsHyperTextAccessible may have editor
|
||||
|
Loading…
Reference in New Issue
Block a user