Make the title change events we fire trusted. Bug 295210, r+sr=jst, a=dveditz

This commit is contained in:
bzbarsky%mit.edu 2005-06-03 02:07:44 +00:00
parent 4b8823720e
commit 6cab785436

View File

@ -2967,6 +2967,10 @@ nsDocument::SetTitle(const nsAString& aTitle)
CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
if (event) {
event->InitEvent(NS_LITERAL_STRING("DOMTitleChanged"), PR_TRUE, PR_TRUE);
// There might be script running, so the event might have ended up
// untrusted. Make it trusted.
nsCOMPtr<nsIPrivateDOMEvent> privEvt(do_QueryInterface(event));
privEvt->SetTrusted(PR_TRUE);
PRBool defaultActionEnabled;
DispatchEvent(event, &defaultActionEnabled);
}