2010-08-13 Mihai Parparita <mihaip@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Aug 2010 23:35:34 +0000 (23:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Aug 2010 23:35:34 +0000 (23:35 +0000)
commitd7aecf8b17b6cbdc5b0082455418ed19601c8ec2
treed6e5601b726c09486d5f55409e7da96f09330284
parent6ed3bc6ff056075a20c6b19ec79ba8476b31cc67
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
79 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/target-fragment-match.html
LayoutTests/fast/dom/Geolocation/resources/cached-page-1.html
LayoutTests/fast/dom/Window/timer-resume-on-navigation-back.html
LayoutTests/fast/dom/location-hash.html
LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt
LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html
LayoutTests/fast/forms/button-state-restore.html
LayoutTests/fast/forms/state-restore-to-non-autocomplete-form.html
LayoutTests/fast/forms/state-restore-to-non-edited-controls.html
LayoutTests/fast/frames/resources/cached-page-1.html
LayoutTests/fast/frames/resources/cached-page-2.html
LayoutTests/fast/harness/resources/cached-page-1.html
LayoutTests/fast/harness/resources/cached-page-with-data-urls.html
LayoutTests/fast/history/gesture-before-onload-form-submit-expected.txt [new file with mode: 0644]
LayoutTests/fast/history/gesture-before-onload-form-submit.html [new file with mode: 0644]
LayoutTests/fast/history/gesture-before-onload-location-href-expected.txt [new file with mode: 0644]
LayoutTests/fast/history/gesture-before-onload-location-href.html [new file with mode: 0644]
LayoutTests/fast/history/history-length.html
LayoutTests/fast/history/resources/gesture-before-onload-target.html [new file with mode: 0644]
LayoutTests/fast/history/saves-state-after-fragment-nav.html
LayoutTests/fast/loader/input-element-page-cache-crash.html
LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html
LayoutTests/fast/loader/stateobjects/pushstate-clears-forward-history.html
LayoutTests/fast/loader/subframe-navigate-during-main-frame-load.html
LayoutTests/http/tests/history/back-to-post.php
LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl
LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl
LayoutTests/http/tests/history/redirect-301-expected.txt
LayoutTests/http/tests/history/redirect-301.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-301.pl [deleted file]
LayoutTests/http/tests/history/redirect-302-expected.txt
LayoutTests/http/tests/history/redirect-302.html [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-302.pl [deleted file]
LayoutTests/http/tests/history/redirect-303-expected.txt
LayoutTests/http/tests/history/redirect-303.html [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-303.pl [deleted file]
LayoutTests/http/tests/history/redirect-307-expected.txt
LayoutTests/http/tests/history/redirect-307.html [new file with mode: 0755]
LayoutTests/http/tests/history/redirect-307.pl [deleted file]
LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html
LayoutTests/http/tests/history/redirect-js-document-location-2-seconds.html
LayoutTests/http/tests/history/redirect-js-document-location-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-document-location-before-load.html
LayoutTests/http/tests/history/redirect-js-form-submit-0-seconds.html
LayoutTests/http/tests/history/redirect-js-form-submit-2-seconds.html
LayoutTests/http/tests/history/redirect-js-form-submit-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-form-submit-before-load.html
LayoutTests/http/tests/history/redirect-js-location-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-assign-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-location-assign-before-load.html
LayoutTests/http/tests/history/redirect-js-location-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-location-before-load.html
LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-href-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-href-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-location-href-before-load.html
LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html
LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html
LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html
LayoutTests/http/tests/history/resources/redirect-helper.pl [new file with mode: 0755]
LayoutTests/http/tests/history/resources/redirect-target.html
LayoutTests/http/tests/loading/307-after-303-after-post-expected.txt
LayoutTests/http/tests/loading/redirect-methods-expected.txt
LayoutTests/http/tests/navigation/resources/back-send-referrer-helper.php
LayoutTests/http/tests/navigation/resources/document-location.js
LayoutTests/http/tests/navigation/resources/submit-to-fragment.pl
LayoutTests/security/autocomplete-cleared-on-back.html
LayoutTests/storage/hash-change-with-xhr.js
WebCore/ChangeLog
WebCore/loader/FormSubmission.cpp
WebCore/loader/FormSubmission.h
WebCore/loader/RedirectScheduler.cpp
WebCore/loader/RedirectScheduler.h