зеркало из https://github.com/mozilla/gecko-dev.git
Bug 415026 IME is always enabled in a page has contentEditable=true r+sr=roc, a1.9=mtschrep
This commit is contained in:
Родитель
ce55655041
Коммит
a785ec1761
|
@ -520,7 +520,17 @@ public:
|
||||||
};
|
};
|
||||||
virtual PRUint32 GetDesiredIMEState()
|
virtual PRUint32 GetDesiredIMEState()
|
||||||
{
|
{
|
||||||
|
if (!HasFlag(NODE_IS_EDITABLE))
|
||||||
return IME_STATUS_DISABLE;
|
return IME_STATUS_DISABLE;
|
||||||
|
nsIContent *editableAncestor = nsnull;
|
||||||
|
for (nsIContent* parent = GetParent();
|
||||||
|
parent && parent->HasFlag(NODE_IS_EDITABLE);
|
||||||
|
parent = parent->GetParent())
|
||||||
|
editableAncestor = parent;
|
||||||
|
// This is in another editable content, use the result of it.
|
||||||
|
if (editableAncestor)
|
||||||
|
return editableAncestor->GetDesiredIMEState();
|
||||||
|
return IME_STATUS_ENABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -237,22 +237,10 @@ nsIMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
|
||||||
return nsIContent::IME_STATUS_DISABLE;
|
return nsIContent::IME_STATUS_DISABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sInstalledMenuKeyboardListener)
|
if (sInstalledMenuKeyboardListener || !aContent)
|
||||||
return nsIContent::IME_STATUS_DISABLE;
|
return nsIContent::IME_STATUS_DISABLE;
|
||||||
|
|
||||||
PRBool isEditable = PR_FALSE;
|
|
||||||
nsCOMPtr<nsISupports> container = aPresContext->GetContainer();
|
|
||||||
nsCOMPtr<nsIEditorDocShell> editorDocShell(do_QueryInterface(container));
|
|
||||||
if (editorDocShell)
|
|
||||||
editorDocShell->GetEditable(&isEditable);
|
|
||||||
|
|
||||||
if (isEditable)
|
|
||||||
return nsIContent::IME_STATUS_ENABLE;
|
|
||||||
|
|
||||||
if (aContent)
|
|
||||||
return aContent->GetDesiredIMEState();
|
return aContent->GetDesiredIMEState();
|
||||||
|
|
||||||
return nsIContent::IME_STATUS_DISABLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Загрузка…
Ссылка в новой задаче