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

Boris Zbarsky bzbarsky at MIT.EDU
Fri Jun 29 15:19:30 PDT 2012

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.

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;">

should alert and not submit.  Yes, I know this is totally screwy.  :(


More information about the whatwg mailing list