Skip to content
  • ggaren@apple.com's avatar
    WebCore: · 78b4dc68
    ggaren@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@40424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    78b4dc68