summaryrefslogtreecommitdiffstats
path: root/content/test/data
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 18:07:32 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 18:07:32 +0000
commit59167c28d2201792c001c27d91e85dec8492d7f1 (patch)
tree1725d004bdd945be43526f3084eda55533b83784 /content/test/data
parent12e4f5caa4010ef8dc2f900689c8298e48c30353 (diff)
downloadchromium_src-59167c28d2201792c001c27d91e85dec8492d7f1.zip
chromium_src-59167c28d2201792c001c27d91e85dec8492d7f1.tar.gz
chromium_src-59167c28d2201792c001c27d91e85dec8492d7f1.tar.bz2
Allow showing pending URL for new tab navigations, but only if safe.
We revert to showing the opener's URL if it modifies the content of the initial blank page before the pending URL commits, to prevent URL spoofs. Implications: - All renderer-initiated navigations now have pending NavigationEntries. - GetURL and GetTitle use the visible entry, not active entry. - The renderer notifies the browser if DOM mutations occur before first load. [Third attempt, after http://crrev.com/195553 was reverted.] BUG=9682 TEST=Open a slow link in a new tab. Destination URL should be visible and reloadable. Review URL: https://chromiumcodereview.appspot.com/14283005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/data')
-rw-r--r--content/test/data/click-nocontent-link.html46
1 files changed, 46 insertions, 0 deletions
diff --git a/content/test/data/click-nocontent-link.html b/content/test/data/click-nocontent-link.html
new file mode 100644
index 0000000..e60b513
--- /dev/null
+++ b/content/test/data/click-nocontent-link.html
@@ -0,0 +1,46 @@
+<html>
+
+ <head><title>Click nocontent link</title>
+ <script>
+ function simulateClick(target) {
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,
+ 0, 0, 0, 0, 0, false, false,
+ false, false, 0, null);
+
+ return target.dispatchEvent(evt);
+ }
+
+ function clickNoContentTargetedLink() {
+ return simulateClick(document.getElementById("nocontent_targeted_link"));
+ }
+
+ function clickNoContentScriptedTargetedLink() {
+ return simulateClick(document.getElementById(
+ "nocontent_scripted_targeted_link"));
+ }
+
+ var w;
+ function modifyNewWindow() {
+ // Grab a reference to the existing foo window and modify its content.
+ w = window.open("", "foo");
+ w.document.body.innerHTML += "Modified";
+
+ // Also modify the title to give the test a notification to listen for.
+ // Use a timeout so that the didAccessInitialDocument notification arrives
+ // first.
+ setTimeout('w.document.title = "Modified Title"');
+ return true;
+ }
+ </script>
+ </head>
+
+<a href="/nocontent" id="nocontent_targeted_link" target="foo">
+ /nocontent target=foo</a><br>
+<button onclick="modifyNewWindow()">Modify New Window</button><br>
+
+<a href="/nocontent" id="nocontent_scripted_targeted_link" target="foo"
+ onclick="modifyNewWindow()">
+ /nocontent scripted target=foo</a><br>
+
+</html>