Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: third_party/WebKit/WebCore/loader/FrameLoader.cpp

Issue 1116002: Test CL for WebKit try bot. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/WebCore/loader/FrameLoader.h ('k') | third_party/WebKit/WebCore/page/FrameLoadRequest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « third_party/WebKit/WebCore/loader/FrameLoader.h ('k') | third_party/WebKit/WebCore/page/FrameLoadRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698