Skip to content

Form submission to file:// and about: URLs silently fails #8113

Closed

Description

@jdm
<form action="other.html">
<input type="submit" value="submit">
</form>

This form navigates correctly to other.html if it's run under an HTTP server (such as python -m SimpleHTTPServer), but does nothing if it's run from the local filesystem. We should correct this by fixing the "Step 18" implementation in HTMLFormElement::submit by adding a handler for the "file" scheme along with "ftp", etc.

Unfortunately it's not clear to me that it's possible to write an automated test for this, since our tests run under an HTTP webserver.

Interesting background reading: https://html.spec.whatwg.org/multipage/forms.html#form-submission-algorithm and step 18 in particular, which says "If scheme is not one of those listed in this table, then the behaviour is not defined by this specification. User agents should, in the absence of another specification defining this, act in a manner analogous to that defined in this specification for similar schemes."

Code: components/script/dom/htmlformelement.rs

Activity

  1. added
    A-content/dom
    E-less-complex
    on Oct 21, 2015
  2. changed the title [-]Form submission to file:// URLs silently fails[/-] [+]Form submission to file:// and about: URLs silently fails[/+] on Oct 21, 2015
  3. jdm commented on Oct 21, 2015

    @jdm
    MemberAuthor

    This should also add a similar handler for about: URLs.

  4. eefriedman commented on Oct 21, 2015

    @eefriedman
    Contributor

    It should be possible to write an automated test using a iframe which checks the behavior of form submission to about:blank, I think. (Like you said, it's probably not possible to write tests for file:// URLs using the wpt test framework.)

  5. simartin commented on Oct 24, 2015

    @simartin
    Contributor

    I'll give this one a try.

  6. jdm commented on Oct 24, 2015

    @jdm
    MemberAuthor

    @simartin That would be great!

  7. added
    C-assigned
    on Oct 24, 2015
  8. simartin commented on Oct 25, 2015

    @simartin
    Contributor

    Patch is ready and validated manually; now working on an automated test using the suggestion eefriedman did.

  9. added a commit that references this issue on Nov 2, 2015
  10. simartin commented on Nov 2, 2015

    @simartin
    Contributor

    I finally came up with a way of testing the fix with about:blank; I have to go for the "test != ref" scheme because otherwise, since both are blank, the test would have to be marked as flaky (and therefore not test anything really...). I hope it makes sense.

  11. added 2 commits that reference this issue on Nov 8, 2015
  12. added a commit that references this issue on Dec 2, 2015
  13. added 2 commits that reference this issue on Dec 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domC-assignedE-less-complex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions