Changeset 66742 in webkit


Ignore:
Timestamp:
Sep 3, 2010 11:21:29 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-09-03 Johnny Ding <jnd@chromium.org>

Reviewed by Adam Barth.

Save the gesture state to track the user gesture state across async form submission.
https://bugs.webkit.org/show_bug.cgi?id=44969

fast/events/popup-blocked-to-post-blank.html can cover the test in WebKit.
A UI test will be added in chromium to address chromium's bug.

  • loader/RedirectScheduler.cpp: (WebCore::ScheduledFormSubmission::ScheduledFormSubmission): (WebCore::ScheduledFormSubmission::fire): (WebCore::RedirectScheduler::scheduleFormSubmission):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66740 r66742  
     12010-09-03  Johnny Ding  <jnd@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Save the gesture state to track the user gesture state across async form submission.
     6        https://bugs.webkit.org/show_bug.cgi?id=44969
     7
     8        fast/events/popup-blocked-to-post-blank.html can cover the test in WebKit.
     9        A UI test will be added in chromium to address chromium's bug.
     10
     11        * loader/RedirectScheduler.cpp:
     12        (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
     13        (WebCore::ScheduledFormSubmission::fire):
     14        (WebCore::RedirectScheduler::scheduleFormSubmission):
     15
    1162010-09-03  Dan Bernstein  <mitz@apple.com>
    217
  • trunk/WebCore/loader/RedirectScheduler.cpp

    r66458 r66742  
    173173class ScheduledFormSubmission : public ScheduledNavigation {
    174174public:
    175     ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad)
     175    ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad, bool wasUserGesture)
    176176        : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true)
    177177        , m_submission(submission)
    178178        , m_haveToldClient(false)
     179        , m_wasUserGesture(wasUserGesture)
    179180    {
    180181        ASSERT(m_submission->state());
     
    183184    virtual void fire(Frame* frame)
    184185    {
     186        UserGestureIndicator gestureIndicator(m_wasUserGesture ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
     187
    185188        // The submitForm function will find a target frame before using the redirection timer.
    186189        // Now that the timer has fired, we need to repeat the security check which normally is done when
     
    212215    RefPtr<FormSubmission> m_submission;
    213216    bool m_haveToldClient;
     217    bool m_wasUserGesture;
    214218};
    215219
     
    312316    // to match IE and Opera.
    313317    // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
    314 
    315     bool lockBackForwardList = mustLockBackForwardList(m_frame, UserGestureIndicator::processingUserGesture()) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
    316 
    317     schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad)));
     318    bool isUserGesture = m_frame->loader()->isProcessingUserGesture();
     319    bool lockBackForwardList = mustLockBackForwardList(m_frame, isUserGesture) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
     320
     321    schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad, isUserGesture)));
    318322}
    319323
Note: See TracChangeset for help on using the changeset viewer.