[whatwg] HTMLForms: Implicit Submission with {display:none} button

On Fri, Sep 23, 2011 at 2:52 PM, Ian Hickson <ian at hixie.ch> wrote:
> The strict answer is that it's up to the browsers; the spec allows
> browsers to do whatever they think is appropriate per their platform's
> conventions. So both behaviours are compliant.

Nothing in "4.10.22.2 Implicit submission" seems to allow implicit
submission to vary based on whether a submit button is displayed or not...

(It also explicitly says that if implicit submit is supported but there's no
submit button in the form, the implicit submit must still happen.  That
doesn't sound like it could be followed, since lots of pages are probably
depending on the absence of a submit button suppressing implicit submit.
That's just backwards-compatibility, not platform conventions, though.)

On Sat, Sep 24, 2011 at 12:47 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:

> However, it doesn't submit when we have:
>
>   - Two text fields with one display:none submit button
>
...
>

Another outlier: Android's WebKit, at least in 2.3.5, seems to always allow
user submit when editing a text input, via the "Go" button in the input
method, regardless of any submit buttons or their state.

IE9 does implicit submission in the following conditions:
>   - Two text fields with one visible submit button
>
> It does not do implicit submissio in the following conditions:
>   - Two text fields with one visibility:hidden submit button
>

This makes the least sense of all to me.  visibility: hidden shouldn't have
a side-effect like this.

On Sat, Sep 24, 2011 at 4:59 PM, Dimitri Glazkov <dglazkov at chromium.org>wrote:

> Hi folks -- I wrote a fairly comprehensive test suite to capture al
> this a while back:
>
> http://trac.webkit.org/browser/trunk/LayoutTests/fast/forms/implicit-submission.html
>

I adjusted this to work in other browsers and ran it in a few of them, after
adding some display: none and visibility: none cases:

http://zewt.org/~glenn/test-form-submission/
http://zewt.org/~glenn/test-form-submission/table.html

I had to make it run without data: to work around IE9.  These were run in
Windows; I suppose they may behave differently in Linux and OSX.  I didn't
spend the time to convince browsers to cache everything, so it'll be a
little slow (roundtrips per test).

-- 
Glenn Maynard

Received on Saturday, 24 September 2011 16:55:51 UTC