Bug 717147 input events which are fired after compositionupdate should be trusted events r=ehsan

This commit is contained in:
Masayuki Nakano 2012-01-13 15:19:22 +09:00
Родитель 869d9bd043
Коммит 2220432bf7
3 изменённых файлов: 6 добавлений и 1 удалений

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

@ -647,6 +647,10 @@ nsEditorEventListener::HandleText(nsIDOMEvent* aTextEvent)
return NS_OK; return NS_OK;
} }
// Transfer the event's trusted-ness to our editor
nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aTextEvent);
nsAutoEditorKeypressOperation operation(mEditor, NSEvent);
return mEditor->UpdateIMEComposition(composedText, textRangeList); return mEditor->UpdateIMEComposition(composedText, textRangeList);
} }

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

@ -171,7 +171,7 @@ function startTests()
}, },
"caret": { "start": 1, "length": 0 } "caret": { "start": 1, "length": 0 }
}); });
checkCompositionEvents(false, false, true, false, "composing"); checkCompositionEvents(false, false, true, true, "composing");
var queryText = synthesizeQueryTextContent(0, 100); var queryText = synthesizeQueryTextContent(0, 100);
ok(queryText, "query text event result is null"); ok(queryText, "query text event result is null");
if (!queryText) { if (!queryText) {

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

@ -1240,6 +1240,7 @@ function runCompositionEventTest()
function formEventHandlerForWindow(aEvent) function formEventHandlerForWindow(aEvent)
{ {
ok(aEvent.isTrusted, "input events must be trusted events");
windowEventCounts[aEvent.type]++; windowEventCounts[aEvent.type]++;
windowEventData[aEvent.type] = input.value; windowEventData[aEvent.type] = input.value;
} }