W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2012

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 29 Jun 2012 23:20:37 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Message-ID: <Pine.LNX.4.64.1206292310030.20626@ps20323.dreamhostps.com>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, Glenn Maynard <glenn@zewt.org>, Dimitri Glazkov <dglazkov@chromium.org>, Rob Crowther <robertc@boogdesign.com>
On Fri, 29 Jun 2012, Boris Zbarsky wrote:
> On 6/29/12 5:24 PM, Ian Hickson wrote:
> > Let me know if it's not quite right. I wasn't sure exactly what weird 
> > things to test. I mostly relied on WebKit's (specifically Chrome's) 
> > behaviour here since they were apparently the ones most recently 
> > affected by real compat reasons to implement something here so maybe 
> > they are the closest to what the Web today actually needs (?).
> What were the differences between Chrome and Gecko here, if you recall?  
> I'm somewhat interested.

The main difference was that Chrome and Firefox differ in what input types 
they support, which affects which they allow to affect the implicit 
submission thing.

> In any case, I believe the spec is wrong in one aspect: in the case that 
> there is a default button, what needs to happen is a click event on that 
> button, not just a triggering of its activation behavior.  In 
> particular, onclick handlers need to fire and the activation behavior 
> should only happen if preventDefault is not called on the event.  For 
> example, this testcase:
>   <!DOCTYPE html>
>   <form action="http://w3.org">
>     <input type="text" value="Focus me and hit enter">
>     <input type="submit" onclick="alert('haha'); return false;">
>   </form>
> should alert and not submit.  Yes, I know this is totally screwy.  :(

Oh, wow, yeah, the spec was just bogus there, sorry about that. I never 
got around to updating it to handle the activation behaviour stuff 
properly after fixing that a few years back.


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 29 June 2012 23:21:04 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:43 UTC