[Webkit-unassigned] [Bug 37236] New: Cannot resubmit form after submission fails

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 7 15:27:11 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37236

           Summary: Cannot resubmit form after submission fails
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jmason at rim.com


Created an attachment (id=52790)
 --> (https://bugs.webkit.org/attachment.cgi?id=52790)
html file that shows the problem

If a form submission fails due to a server error, the m_submittedUrl is not
cleared properly and so clicking "submit" again does nothing.

Attached is a small html file that demonstrates this problem.  You'll need to
use a client that opens a dialog on error instead of rendering an error page,
so that it stays on the same page after the submission fails.  I used
QtLauncher, edited to turn off ErrorPageExtension (

The criteria are:
- a form which loads in the current frame (no target attribute)
- the method is GET
- the action url returns an error (in the test file, it's a nonexistant file,
for a file not found error)
- the client remains on the same page after the error is handled (eg. it
displays the error in a dialog instead of an error page)

When this happens, clicking Submit the first time will display the error
dialog, and after this clicking Submit again will do nothing, and not submit
the form until the page is reloaded.

The reason is that FrameLoader::submitForm contains this code, to guard against
submitting the form multiple times:

    if (m_frame->tree()->isDescendantOf(targetFrame)) {
        if (m_submittedFormURL == u)
            return;
        m_submittedFormURL = u;
    }

It's expected that after submitting the form, m_submittedFormURL is cleared. 
But the code to do this on error, in FrameLoader::receivedMainResourceError,
is:

        if (m_submittedFormURL ==
m_provisionalDocumentLoader->originalRequestCopy().url())
            m_submittedFormURL = KURL();

When the method is GET, the form data is added to the url as a query string,
which is included in m_submittedFormURL.  But originalRequestCopy().url() is
the basic url included in the action parameter, before the query string is
added, so this test never passes and m_submittedFormURL is not reset.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list