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
parent f21004e152
commit 6e8f73fabc
3 changed files with 6 additions and 1 deletions

View File

@ -647,6 +647,10 @@ nsEditorEventListener::HandleText(nsIDOMEvent* aTextEvent)
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);
}

View File

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

View File

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