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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 29 Jun 2012 18:19:30 -0400
Message-ID: <4FEE29F2.4010005@mit.edu>
To: Ian Hickson <ian@hixie.ch>
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, Glenn Maynard <glenn@zewt.org>, Dimitri Glazkov <dglazkov@chromium.org>, Rob Crowther <robertc@boogdesign.com>
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.  :(

Received on Friday, 29 June 2012 22:20:04 UTC

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