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:
jst%mozilla.jstenback.com
2004-09-04 19:28:46 +00:00
parent fbec197f3e
commit 809b317cb3
27 changed files with 589 additions and 252 deletions

View File

@@ -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);