Fixing bug 252326. Fixing some popup blocker problems. Making sure only trusted events get mark trusted, and only allow popups while processing trusted (initiated by the user) events. Patch by trev@gtchat.de and jst@mozilla.org, r=bzbarsky@mit.edu, rs=brendan@mozilla.org, bryner@biranryner.com
git-svn-id: svn://10.0.0.236/trunk@161765 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -428,6 +428,9 @@ struct OnLinkClickEvent : public PLEvent {
|
||||
~OnLinkClickEvent();
|
||||
|
||||
void HandleEvent() {
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mHandler->mScriptGlobal));
|
||||
nsAutoPopupStatePusher popupStatePusher(window, mPopupState);
|
||||
|
||||
mHandler->OnLinkClickSync(mContent, mVerb, mURI,
|
||||
mTargetSpec.get(), mPostDataStream,
|
||||
mHeadersDataStream,
|
||||
@@ -441,6 +444,7 @@ struct OnLinkClickEvent : public PLEvent {
|
||||
nsCOMPtr<nsIInputStream> mHeadersDataStream;
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsLinkVerb mVerb;
|
||||
PopupControlState mPopupState;
|
||||
};
|
||||
|
||||
static void PR_CALLBACK HandlePLEvent(OnLinkClickEvent* aEvent)
|
||||
@@ -470,6 +474,10 @@ OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler,
|
||||
mContent = aContent;
|
||||
mVerb = aVerb;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mHandler->mScriptGlobal));
|
||||
|
||||
mPopupState = window->GetPopupControlState();
|
||||
|
||||
PL_InitEvent(this, nsnull,
|
||||
(PLHandleEventProc) ::HandlePLEvent,
|
||||
(PLDestroyEventProc) ::DestroyPLEvent);
|
||||
|
||||
Reference in New Issue
Block a user