WebCore:
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jan 2009 23:09:43 +0000 (23:09 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jan 2009 23:09:43 +0000 (23:09 +0000)
commit853ceca06a8c40a4aa87d54b6985d73808fb5925
tree1f14d08b6d5aa8306d3ac87ef4e9c19e6eff86d8
parentd57ef9d19a74dae01e4f4a909ee176e7ca02f404
WebCore:

2009-01-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        More scaffolding for redirect tracking. No behavior change yet.

        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::submit): Added scaffolding necessary for
        redirect checking in a form submission through JS. (Currently, we
        just specify "no redirect.")

        * bindings/js/ScriptController.h:
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::processingUserGesture):
        (WebCore::ScriptController::processingUserGestureEvent):
        (WebCore::ScriptController::isJavaScriptAnchorNavigation): Refactored
        user gesture check to make it more clear.

        (WebCore::ScriptController::pageIsProcessingUserGesture): Added a helper
        for checking if there's a user gesture in any frame on the page (a more
        relaxed rule than our popup blocking rule, which requires the user
        gesture to occur in the frame that's executing JavaScript.)

        * html/HTMLFormElement.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::submit): Added scaffolding necessary for
        redirect checking in a form submission through the DOM. (Currently, we
        just specify "no redirect.")

        * html/HTMLFormElement.idl: Made submit custom so it can participate
        in redirect checking.

        * loader/FrameLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FormSubmission::FormSubmission): Clarified some names, and
        added a "lockHistory" parameter to form submissions, to match other
        navigations.

        (WebCore::FrameLoader::submitFormAgain):
        (WebCore::FrameLoader::submitForm): Use the lockHistory parameter.

        (WebCore::FrameLoader::userGestureHint): Refactored this function for
        clarity, and added a FIXME for a change I was too scared to make myself.
        (Really, we should just get rid of this function.)

        (WebCore::FrameLoader::loadFrameRequestWithFormAndValues): Refactored
        to pass a FrameLoadType to form posts, too, so they can participate in
        redirect tracking.

        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
        (WebCore::FrameLoader::loadItem): Use the lockHistory parameter.

LayoutTests:

2009-01-30  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin Adler.

        More redirect layout test work.

        Added tests (expected to fail) for form submission via JavaScript:

        * http/tests/history/redirect-js-form-submit-0-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-form-submit-0-seconds.html: Added.
        * http/tests/history/redirect-js-form-submit-2-seconds-expected.txt: Added.
        * http/tests/history/redirect-js-form-submit-2-seconds.html: Added.
        * http/tests/history/redirect-js-form-submit-before-load-expected.txt: Added.
        * http/tests/history/redirect-js-form-submit-before-load.html: Added.

        Updated these tests to dump their back/forward lists, to check for
        back/forward regressions, and to use # instead of ? to communicate between
        URLs, since, to my surprise, form submissions can't use query strings.

        * http/tests/history/redirect-200-refresh-0-seconds-expected.txt:
        * http/tests/history/redirect-200-refresh-0-seconds.pl:
        * http/tests/history/redirect-200-refresh-2-seconds-expected.txt:
        * http/tests/history/redirect-200-refresh-2-seconds.pl:
        * http/tests/history/redirect-301-expected.txt:
        * http/tests/history/redirect-301.pl:
        * http/tests/history/redirect-302-expected.txt:
        * http/tests/history/redirect-302.pl:
        * http/tests/history/redirect-303-expected.txt:
        * http/tests/history/redirect-303.pl:
        * http/tests/history/redirect-307-expected.txt:
        * http/tests/history/redirect-307.pl:
        * http/tests/history/redirect-js-document-location-0-seconds-expected.txt:
        * http/tests/history/redirect-js-document-location-0-seconds.html:
        * http/tests/history/redirect-js-document-location-2-seconds-expected.txt:
        * http/tests/history/redirect-js-document-location-2-seconds.html:
        * http/tests/history/redirect-js-document-location-before-load-expected.txt:
        * http/tests/history/redirect-js-document-location-before-load.html:
        * http/tests/history/redirect-js-location-0-seconds-expected.txt:
        * http/tests/history/redirect-js-location-0-seconds.html:
        * http/tests/history/redirect-js-location-2-seconds-expected.txt:
        * http/tests/history/redirect-js-location-2-seconds.html:
        * http/tests/history/redirect-js-location-assign-0-seconds-expected.txt:
        * http/tests/history/redirect-js-location-assign-0-seconds.html:
        * http/tests/history/redirect-js-location-assign-2-seconds-expected.txt:
        * http/tests/history/redirect-js-location-assign-2-seconds.html:
        * http/tests/history/redirect-js-location-assign-before-load-expected.txt:
        * http/tests/history/redirect-js-location-assign-before-load.html:
        * http/tests/history/redirect-js-location-before-load-expected.txt:
        * http/tests/history/redirect-js-location-before-load.html:
        * http/tests/history/redirect-js-location-href-0-seconds-expected.txt:
        * http/tests/history/redirect-js-location-href-0-seconds.html:
        * http/tests/history/redirect-js-location-href-2-seconds-expected.txt:
        * http/tests/history/redirect-js-location-href-2-seconds.html:
        * http/tests/history/redirect-js-location-href-before-load-expected.txt:
        * http/tests/history/redirect-js-location-href-before-load.html:
        * http/tests/history/redirect-js-location-replace-0-seconds-expected.txt:
        * http/tests/history/redirect-js-location-replace-0-seconds.html:
        * http/tests/history/redirect-js-location-replace-2-seconds-expected.txt:
        * http/tests/history/redirect-js-location-replace-2-seconds.html:
        * http/tests/history/redirect-js-location-replace-before-load-expected.txt:
        * http/tests/history/redirect-js-location-replace-before-load.html:
        * http/tests/history/redirect-meta-refresh-0-seconds-expected.txt:
        * http/tests/history/redirect-meta-refresh-0-seconds.html:
        * http/tests/history/redirect-meta-refresh-2-seconds-expected.txt:
        * http/tests/history/redirect-meta-refresh-2-seconds.html:
        * http/tests/history/resources/redirect-target.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@40424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
63 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/history/redirect-200-refresh-0-seconds-expected.txt
LayoutTests/http/tests/history/redirect-200-refresh-0-seconds.pl
LayoutTests/http/tests/history/redirect-200-refresh-2-seconds-expected.txt
LayoutTests/http/tests/history/redirect-200-refresh-2-seconds.pl
LayoutTests/http/tests/history/redirect-301-expected.txt
LayoutTests/http/tests/history/redirect-301.pl
LayoutTests/http/tests/history/redirect-302-expected.txt
LayoutTests/http/tests/history/redirect-302.pl
LayoutTests/http/tests/history/redirect-303-expected.txt
LayoutTests/http/tests/history/redirect-303.pl
LayoutTests/http/tests/history/redirect-307-expected.txt
LayoutTests/http/tests/history/redirect-307.pl
LayoutTests/http/tests/history/redirect-js-document-location-0-seconds-expected.txt
LayoutTests/http/tests/history/redirect-js-document-location-0-seconds.html
LayoutTests/http/tests/history/redirect-js-document-location-2-seconds-expected.txt
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-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-form-submit-0-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-form-submit-2-seconds-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-form-submit-2-seconds.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-form-submit-before-load-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-form-submit-before-load.html [new file with mode: 0644]
LayoutTests/http/tests/history/redirect-js-location-0-seconds-expected.txt
LayoutTests/http/tests/history/redirect-js-location-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-2-seconds-expected.txt
LayoutTests/http/tests/history/redirect-js-location-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds-expected.txt
LayoutTests/http/tests/history/redirect-js-location-assign-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-assign-2-seconds-expected.txt
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-expected.txt
LayoutTests/http/tests/history/redirect-js-location-href-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-href-2-seconds-expected.txt
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-expected.txt
LayoutTests/http/tests/history/redirect-js-location-replace-0-seconds.html
LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds-expected.txt
LayoutTests/http/tests/history/redirect-js-location-replace-2-seconds.html
LayoutTests/http/tests/history/redirect-js-location-replace-before-load-expected.txt
LayoutTests/http/tests/history/redirect-js-location-replace-before-load.html
LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds-expected.txt
LayoutTests/http/tests/history/redirect-meta-refresh-0-seconds.html
LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds-expected.txt
LayoutTests/http/tests/history/redirect-meta-refresh-2-seconds.html
LayoutTests/http/tests/history/resources/redirect-target.html
WebCore/ChangeLog
WebCore/bindings/js/JSHTMLFormElementCustom.cpp
WebCore/bindings/js/ScriptController.cpp
WebCore/bindings/js/ScriptController.h
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLFormElement.idl
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h