Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-08-13 Mihai Parparita <mihaip@chromium.org>
Reviewed by Dimitri Glazkov. Session history should skip over JS redirects https://bugs.webkit.org/show_bug.cgi?id=42861 Lock the back/forward list for location changes and form submits that happen before the onload event fires that are not the result of user gestures. http/tests/history tests now pass, their expectations were updated accordingly. Other tests needed a setTimeout wrapper around location changes and form submits during onload, otherwise they would not generate history entries as expected anymore. * fast/css/target-fragment-match.html: * fast/dom/location-hash.html: * fast/dom/Geolocation/resources/cached-page-1.html: * fast/dom/Window/timer-resume-on-navigation-back.html: * fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt: * fast/events/pageshow-pagehide-on-back-cached-with-frames.html: * fast/forms/button-state-restore.html: * fast/forms/state-restore-to-non-autocomplete-form.html: * fast/forms/state-restore-to-non-edited-controls.html: * fast/frames/resources/cached-page-1.html: * fast/frames/resources/cached-page-2.html: * fast/harness/resources/cached-page-1.html: * fast/harness/resources/cached-page-with-data-urls.html: * fast/history/gesture-before-onload-expected.txt: Added. * fast/history/gesture-before-onload.html: Added. * fast/history/history-length.html: * fast/history/resources/gesture-before-onload-target.html: Added. * fast/history/saves-state-after-fragment-nav.html: * fast/loader/input-element-page-cache-crash.html: * fast/loader/stateobjects/document-destroyed-navigate-back.html: * fast/loader/stateobjects/pushstate-clears-forward-history.html: * fast/loader/subframe-navigate-during-main-frame-load.html: * http/tests/history/back-to-post.php: * http/tests/history/redirect-js-document-location-before-load-expected.txt: * http/tests/history/redirect-js-form-submit-before-load-expected.txt: * http/tests/history/redirect-js-location-assign-before-load-expected.txt: * http/tests/history/redirect-js-location-before-load-expected.txt: * http/tests/history/redirect-js-location-href-before-load-expected.txt: * http/tests/loading/307-after-303-after-post-expected.txt: * http/tests/loading/redirect-methods-expected.txt: * http/tests/navigation/resources/back-send-referrer-helper.php: * http/tests/navigation/resources/document-location.js: (start): * http/tests/navigation/resources/submit-to-fragment.pl: * security/autocomplete-cleared-on-back.html: * storage/hash-change-with-xhr.js: (updateDatabase): (invokeBack): (runTest): (runTestsInner): 2010-08-13 Mihai Parparita <mihaip@chromium.org> Reviewed by Dimitri Glazkov. Session history should skip over JS redirects https://bugs.webkit.org/show_bug.cgi?id=42861 Lock the back/forward list for location changes and form submits that happen before the onload event fires that are not the result of user gestures. Made form submission (at the ScheduledFormSubmission level) more similar to ScheduledURLNavigation by having it call clientRedirected too, fixing a long-standing FIXME. Test: fast/history/gesture-before-onload-location-href.html, fast/history/gesture-before-onload-form-submit.html and updated expectations for http/tests/history tests that used to fail. * loader/FormSubmission.cpp: (WebCore::FormSubmission::requestURL): (WebCore::FormSubmission::populateFrameLoadRequest): * loader/FormSubmission.h: * loader/RedirectScheduler.cpp: (WebCore::ScheduledFormSubmission::ScheduledFormSubmission): (WebCore::ScheduledFormSubmission::fire): (WebCore::ScheduledFormSubmission::didStartTimer): (WebCore::ScheduledFormSubmission::didStopTimer): (WebCore::RedirectScheduler::scheduleRedirect): (WebCore::RedirectScheduler::mustLockBackForwardList): (WebCore::RedirectScheduler::scheduleLocationChange): (WebCore::RedirectScheduler::scheduleFormSubmission): * loader/RedirectScheduler.h: Canonical link: https://commits.webkit.org/56140@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
527 additions
and 235 deletions.
- +58 −0 LayoutTests/ChangeLog
- +6 −0 LayoutTests/fast/css/target-fragment-match.html
- +2 −1 LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
- +6 −3 LayoutTests/fast/dom/Window/timer-resume-on-navigation-back.html
- +3 −2 LayoutTests/fast/dom/location-hash.html
- +14 −14 LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt
- +6 −3 LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html
- +3 −1 LayoutTests/fast/forms/button-state-restore.html
- +2 −1 LayoutTests/fast/forms/state-restore-to-non-autocomplete-form.html
- +2 −1 LayoutTests/fast/forms/state-restore-to-non-edited-controls.html
- +2 −1 LayoutTests/fast/frames/resources/cached-page-1.html
- +2 −1 LayoutTests/fast/frames/resources/cached-page-2.html
- +2 −1 LayoutTests/fast/harness/resources/cached-page-1.html
- +2 −1 LayoutTests/fast/harness/resources/cached-page-with-data-urls.html
- +9 −0 LayoutTests/fast/history/gesture-before-onload-form-submit-expected.txt
- +30 −0 LayoutTests/fast/history/gesture-before-onload-form-submit.html
- +9 −0 LayoutTests/fast/history/gesture-before-onload-location-href-expected.txt
- +32 −0 LayoutTests/fast/history/gesture-before-onload-location-href.html
- +28 −24 LayoutTests/fast/history/history-length.html
- +41 −0 LayoutTests/fast/history/resources/gesture-before-onload-target.html
- +5 −2 LayoutTests/fast/history/saves-state-after-fragment-nav.html
- +3 −2 LayoutTests/fast/loader/input-element-page-cache-crash.html
- +4 −3 LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html
- +20 −16 LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history.html
- +3 −2 LayoutTests/fast/loader/subframe-navigate-during-main-frame-load.html
- +9 −2 LayoutTests/http/tests/history/back-to-post.php
- +1 −1 LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl
- +1 −1 LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl
- +3 −2 LayoutTests/http/tests/history/redirect-301-expected.txt
- +15 −0 LayoutTests/http/tests/history/redirect-301.html
- +0 −22 LayoutTests/http/tests/history/redirect-301.pl
- +3 −2 LayoutTests/http/tests/history/redirect-302-expected.txt
- +15 −0 LayoutTests/http/tests/history/redirect-302.html
- +0 −22 LayoutTests/http/tests/history/redirect-302.pl
- +3 −2 LayoutTests/http/tests/history/redirect-303-expected.txt
- +15 −0 LayoutTests/http/tests/history/redirect-303.html
- +0 −22 LayoutTests/http/tests/history/redirect-303.pl
- +3 −2 LayoutTests/http/tests/history/redirect-307-expected.txt
- +15 −0 LayoutTests/http/tests/history/redirect-307.html
- +0 −23 LayoutTests/http/tests/history/redirect-307.pl
- +1 −1 LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-document-location-2-seconds.html
- +1 −2 LayoutTests/http/tests/history/redirect-js-document-location-before-load-expected.txt
- +1 −1 LayoutTests/http/tests/history/redirect-js-document-location-before-load.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-form-submit-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-form-submit-2-seconds.html
- +1 −2 LayoutTests/http/tests/history/redirect-js-form-submit-before-load-expected.txt
- +1 −1 LayoutTests/http/tests/history/redirect-js-form-submit-before-load.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-2-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds.html
- +1 −2 LayoutTests/http/tests/history/redirect-js-location-assign-before-load-expected.txt
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-assign-before-load.html
- +1 −2 LayoutTests/http/tests/history/redirect-js-location-before-load-expected.txt
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-before-load.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-href-2-seconds.html
- +1 −2 LayoutTests/http/tests/history/redirect-js-location-href-before-load-expected.txt
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-href-before-load.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html
- +1 −1 LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html
- +1 −1 LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html
- +25 −0 LayoutTests/http/tests/history/resources/redirect-helper.pl
- +1 −1 LayoutTests/http/tests/history/resources/redirect-target.html
- +2 −0 LayoutTests/http/tests/loading/307-after-303-after-post-expected.txt
- +8 −0 LayoutTests/http/tests/loading/redirect-methods-expected.txt
- +2 −2 LayoutTests/http/tests/navigation/resources/back-send-referrer-helper.php
- +2 −1 LayoutTests/http/tests/navigation/resources/document-location.js
- +2 −1 LayoutTests/http/tests/navigation/resources/submit-to-fragment.pl
- +2 −1 LayoutTests/security/autocomplete-cleared-on-back.html
- +6 −0 LayoutTests/storage/hash-change-with-xhr.js
- +34 −0 WebCore/ChangeLog
- +12 −4 WebCore/loader/FormSubmission.cpp
- +2 −0 WebCore/loader/FormSubmission.h
- +25 −13 WebCore/loader/RedirectScheduler.cpp
- +2 −2 WebCore/loader/RedirectScheduler.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,16 +1,16 @@ | ||
CONSOLE MESSAGE: line 20: ***Top level frame being parsed for the initial page load*** | ||
CONSOLE MESSAGE: line 20: Subsubframe window.onload | ||
CONSOLE MESSAGE: line 20: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = false | ||
CONSOLE MESSAGE: line 20: Subframe window.onload | ||
CONSOLE MESSAGE: line 20: Subframe window.onpageshow, target = [object HTMLDocument], persisted = false | ||
CONSOLE MESSAGE: line 20: Main frame window.onload | ||
CONSOLE MESSAGE: line 20: Main frame window.onpageshow, target = [object HTMLDocument], persisted = false | ||
CONSOLE MESSAGE: line 20: ***Navigating top-level frame to a page that will immediately navigate back to this one*** | ||
CONSOLE MESSAGE: line 20: Main frame window.onpagehide, target = [object HTMLDocument], persisted = true | ||
CONSOLE MESSAGE: line 20: Subframe window.onpagehide, target = [object HTMLDocument], persisted = true | ||
CONSOLE MESSAGE: line 20: Subsubframe window.onpagehide, target = [object HTMLDocument], persisted = true | ||
CONSOLE MESSAGE: line 20: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = true | ||
CONSOLE MESSAGE: line 20: Subframe window.onpageshow, target = [object HTMLDocument], persisted = true | ||
CONSOLE MESSAGE: line 20: Main frame window.onpageshow, target = [object HTMLDocument], persisted = true | ||
Test pageshow/pagehide event behavior when navigating away from a page with frames, putting the page in the page cache, then back to it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,9 @@ | ||
This page is the target of a redirect. | ||
|
||
PASS: History item count should be 2 and is. | ||
|
||
|
||
============== Back Forward List ============== | ||
(file test):fast/history/gesture-before-onload-form-submit.html **nav target** | ||
curr-> (file test):fast/history/resources/gesture-before-onload-target.html?#2 **nav target** | ||
=============================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,30 @@ | ||
<head> | ||
</head> | ||
<body onload="onload()"> | ||
<form action="resources/gesture-before-onload-target.html#2"> | ||
<input type="submit" id="nav-button" value="Navigate"> | ||
</form> | ||
<div id="manual-explanation" style="display: none; color: blue">When running this test outside of DRT, please click on the "Navigate" button.</div> | ||
</body> | ||
<script> | ||
if (window.layoutTestController) { | ||
layoutTestController.clearBackForwardList(); | ||
layoutTestController.waitUntilDone(); | ||
} | ||
|
||
if (window.eventSender) { | ||
var navButtonNode = document.getElementById('nav-button'); | ||
eventSender.mouseMoveTo( | ||
navButtonNode.offsetLeft + navButtonNode.offsetWidth / 2, | ||
navButtonNode.offsetTop + navButtonNode.offsetHeight / 2); | ||
eventSender.mouseDown(); | ||
eventSender.mouseUp(); | ||
} else { | ||
document.getElementById('manual-explanation').style.display = ''; | ||
} | ||
|
||
function onload() { | ||
window.console.log('FAIL: Should not have reached onload before navigating away'); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,9 @@ | ||
This page is the target of a redirect. | ||
|
||
PASS: History item count should be 2 and is. | ||
|
||
|
||
============== Back Forward List ============== | ||
(file test):fast/history/gesture-before-onload-location-href.html **nav target** | ||
curr-> (file test):fast/history/resources/gesture-before-onload-target.html#2 **nav target** | ||
=============================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,32 @@ | ||
<head> | ||
</head> | ||
<body onload="onload()"> | ||
<button id="nav-button" onclick="nav();">Navigate</button> | ||
<div id="manual-explanation" style="display: none; color: blue">When running this test outside of DRT, please click on the "Navigate" button.</div> | ||
</body> | ||
<script> | ||
if (window.layoutTestController) { | ||
layoutTestController.clearBackForwardList(); | ||
layoutTestController.waitUntilDone(); | ||
} | ||
|
||
if (window.eventSender) { | ||
var navButtonNode = document.getElementById('nav-button'); | ||
eventSender.mouseMoveTo( | ||
navButtonNode.offsetLeft + navButtonNode.offsetWidth / 2, | ||
navButtonNode.offsetTop + navButtonNode.offsetHeight / 2); | ||
eventSender.mouseDown(); | ||
eventSender.mouseUp(); | ||
} else { | ||
document.getElementById('manual-explanation').style.display = ''; | ||
} | ||
|
||
function nav() { | ||
window.location.href = 'resources/gesture-before-onload-target.html#2'; | ||
} | ||
|
||
function onload() { | ||
window.console.log('FAIL: Should not have reached onload before navigating away'); | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.