Bug 416551 Cannot use IME on rich formatting editor of gmail (design mode) r+sr=roc, b1.9=dsicore

git-svn-id: svn://10.0.0.236/trunk@245599 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
masayuki%d-toybox.com 2008-02-13 12:51:00 +00:00
parent dcef4e2571
commit e310d34118
2 changed files with 11 additions and 2 deletions

View File

@ -520,7 +520,7 @@ public:
};
virtual PRUint32 GetDesiredIMEState()
{
if (!HasFlag(NODE_IS_EDITABLE))
if (!IsEditableInternal())
return IME_STATUS_DISABLE;
nsIContent *editableAncestor = nsnull;
for (nsIContent* parent = GetParent();

View File

@ -237,9 +237,18 @@ nsIMEStateManager::GetNewIMEState(nsPresContext* aPresContext,
return nsIContent::IME_STATUS_DISABLE;
}
if (sInstalledMenuKeyboardListener || !aContent)
if (sInstalledMenuKeyboardListener)
return nsIContent::IME_STATUS_DISABLE;
if (!aContent) {
// Even if there are no focused content, the focused document might be
// editable, such case is design mode.
nsIDocument* doc = aPresContext->Document();
if (doc && doc->HasFlag(NODE_IS_EDITABLE))
return nsIContent::IME_STATUS_ENABLE;
return nsIContent::IME_STATUS_DISABLE;
}
return aContent->GetDesiredIMEState();
}