| Index: third_party/WebKit/WebCore/loader/FrameLoader.cpp
|
| ===================================================================
|
| --- third_party/WebKit/WebCore/loader/FrameLoader.cpp (revision 57160)
|
| +++ third_party/WebKit/WebCore/loader/FrameLoader.cpp (working copy)
|
| @@ -203,6 +203,8 @@
|
| , m_loadingFromCachedPage(false)
|
| , m_suppressOpenerInNewFrame(false)
|
| , m_sandboxFlags(SandboxAll)
|
| + , m_userGestureSet(false)
|
| + , m_userGesture(false)
|
| #ifndef NDEBUG
|
| , m_didDispatchDidCommitLoad(false)
|
| #endif
|
| @@ -470,12 +472,16 @@
|
| }
|
|
|
| FrameLoadRequest frameRequest;
|
| + frameRequest.setIsFromUserGesture(isProcessingUserGesture());
|
|
|
| String targetOrBaseTarget = target.isEmpty() ? m_frame->document()->baseTarget() : target;
|
| Frame* targetFrame = m_frame->tree()->find(targetOrBaseTarget);
|
| if (!shouldAllowNavigation(targetFrame))
|
| return;
|
| if (!targetFrame) {
|
| + if (!DOMWindow::allowPopUp(m_frame) && !isProcessingUserGesture())
|
| + return;
|
| +
|
| targetFrame = m_frame;
|
| frameRequest.setFrameName(targetOrBaseTarget);
|
| }
|
| @@ -1521,6 +1527,10 @@
|
| Frame* frame = m_frame->tree()->top();
|
| if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript))
|
| return true; // If JavaScript is disabled, a user gesture must have initiated the navigation.
|
| + // Check to see if we're using an override because the frame load was
|
| + // initiated by a non-current script context.
|
| + if (m_userGestureSet)
|
| + return m_userGesture;
|
| return frame->script()->processingUserGesture(mainThreadNormalWorld()); // FIXME: Use pageIsProcessingUserGesture.
|
| }
|
|
|
| @@ -1949,10 +1959,19 @@
|
| else
|
| loadType = FrameLoadTypeStandard;
|
|
|
| + // For things like form POSTs, the resulting frame load here is occurring
|
| + // asynchronously. If necessary, consider the user gesture status from the
|
| + // original context.
|
| + if (request.isFromUserGestureSet()) {
|
| + m_userGestureSet = true;
|
| + m_userGesture = request.isFromUserGesture();
|
| + }
|
| if (request.resourceRequest().httpMethod() == "POST")
|
| loadPostRequest(request.resourceRequest(), referrer, request.frameName(), lockHistory, loadType, event, formState.get());
|
| else
|
| loadURL(request.resourceRequest().url(), referrer, request.frameName(), lockHistory, loadType, event, formState.get());
|
| + m_userGestureSet = false;
|
| + m_userGesture = false;
|
|
|
| // FIXME: It's possible this targetFrame will not be the same frame that was targeted by the actual
|
| // load if frame names have changed.
|
|
|