checking in for skamio@netscape.net
Disabling IME for Readonly attribute of <INPUT>
/r=yokoyama; /sr=kin
This commit is contained in:
yokoyama%netscape.com 2001-11-30 21:48:31 +00:00
Родитель c62cc6b0a8
Коммит 928b9dbbe2
1 изменённых файлов: 13 добавлений и 2 удалений

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

@ -577,8 +577,19 @@ nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent)
textRangeList->AddRef();
nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(mEditor, &result);
if (imeEditor) {
result = imeEditor->SetCompositionString(composedText,textRangeList,textEventReply);
ScrollSelectionIntoView(mEditor);
PRUint32 flags;
// if we are readonly or disabled, then do nothing.
if (NS_SUCCEEDED(mEditor->GetFlags(&flags))) {
if (flags & nsIPlaintextEditor::eEditorReadonlyMask ||
flags & nsIPlaintextEditor::eEditorDisabledMask) {
#if DEBUG_IME
printf("nsTextEditorTextListener::HandleText, Readonly or Disabled\n");
#endif
return NS_OK;
}
}
result = imeEditor->SetCompositionString(composedText,textRangeList,textEventReply);
ScrollSelectionIntoView(mEditor);
}
return result;
}