Bug 417315 Cannot use IME menus during IME transaction #2 r=peterv+enndeakin, sr=peterv, a1.9=beltzner

This commit is contained in:
masayuki%d-toybox.com 2008-02-20 07:18:53 +00:00
Родитель 6bf547f7b2
Коммит 897479abe2
3 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -52,7 +52,7 @@ struct nsQueryCaretRectEventReply;
[ptr] native nsQueryCaretRectEventReplyPtr(nsQueryCaretRectEventReply);
[scriptable, uuid(228a76d3-5462-4322-a63c-5f94f7f5d4ed)]
[scriptable, uuid(ce1c0424-c3c0-44b0-97d6-df12deb19d45)]
interface nsIEditorIMESupport : nsISupports
{
@ -118,5 +118,10 @@ interface nsIEditorIMESupport : nsISupports
*/
[noscript] void getPreferredIMEState(out unsigned long aState);
/**
* whether this editor has active IME transaction
*/
readonly attribute boolean composing;
};

Просмотреть файл

@ -2245,6 +2245,14 @@ nsEditor::GetPreferredIMEState(PRUint32 *aState)
return NS_OK;
}
NS_IMETHODIMP
nsEditor::GetComposing(PRBool* aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = IsIMEComposing();
return NS_OK;
}
NS_IMETHODIMP
nsEditor::GetReconversionString(nsReconversionEventReply* aReply)
{

Просмотреть файл

@ -232,8 +232,15 @@
return; // Allow other children (e.g. URL bar buttons) to get focus
else if (this.mIgnoreFocus)
this.mIgnoreFocus = false;
else if (this.clickSelectsAll)
this.editor.selectAll();
else if (this.clickSelectsAll) {
try {
const nsIEditorIMESupport =
Components.interfaces.nsIEditorIMESupport;
var imeEditor = this.editor.QueryInterface(nsIEditorIMESupport);
if (!imeEditor || !imeEditor.composing)
this.editor.selectAll();
} catch (e) {}
}
this.setAttribute("focused", "true");
}