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

Ian Hickson ian at hixie.ch
Fri Jun 29 16:20:37 PDT 2012


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.

Fixed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list