summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 22:51:53 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 22:51:53 +0000
commitf0a3d0b153d2b667c07da2acb1c6ee5a5eca8eae (patch)
treee0a0038e4e8443ba3e4f308e65c24876b0b0bb78 /chrome/renderer
parentb3782b9a73d6a82964ac6c8ddc3fc7e5872dc814 (diff)
downloadchromium_src-f0a3d0b153d2b667c07da2acb1c6ee5a5eca8eae.zip
chromium_src-f0a3d0b153d2b667c07da2acb1c6ee5a5eca8eae.tar.gz
chromium_src-f0a3d0b153d2b667c07da2acb1c6ee5a5eca8eae.tar.bz2
The Selenium window.open target blank test fails in ChromeFrame as the navigation is treated as a non local top level
navigation and is routed to IE thus causing the test to fail. The test calls window.open with an empty url. The renderer logic which detects whether the navigation is to be routed to the external host matches the origin of the frame and the url and as they differ ends up routing the navigation to the host. Fix is to allow only http/https navigations to be routed to the host. All other navigations stay within Webkit. Fixes bug http://code.google.com/p/chromium/issues/detail?id=51412 Bug=51412 Review URL: http://codereview.chromium.org/3044053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 6a8f8e8..6831d09 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -5289,8 +5289,22 @@ bool RenderView::IsNonLocalTopLevelNavigation(
if (frame->parent() != NULL)
return false;
+ // Navigations initiated within Webkit are not sent out to the external host
+ // in the following cases.
+ // 1. The url scheme or the frame url scheme is not http/https
+ // 2. The origin of the url and the frame is the same in which case the
+ // opener relationship is maintained.
+ // 3. Anchor navigation within the same page.
+ // 4. Reloads/form submits/back forward navigations
+ if (!url.SchemeIs("http") && !url.SchemeIs("https"))
+ return false;
+
+ GURL frame_url(frame->url());
+ if (!frame_url.SchemeIs("http") && !frame_url.SchemeIs("https"))
+ return false;
+
// Skip if navigation is on the same page (using '#').
- GURL frame_origin = GURL(frame->url()).GetOrigin();
+ GURL frame_origin = frame_url.GetOrigin();
if (url.GetOrigin() != frame_origin || url.ref().empty()) {
// The link click could stay on the same page, in cases where it sends some
// parameters to the same URL.