W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2008

[whatwg] Preventing nested click() calls

From: Antti Koivisto <antti@apple.com>
Date: Mon, 10 Mar 2008 11:49:21 -0700
Message-ID: <0416B867-5652-4BB7-BA7D-08009680A83F@apple.com>
Hi,

WebKit, Firefox and IE all implement a protection mechanism against re- 
entering click() on the same element:

<input type="checkbox" onclick="this.click()">

WebKit (and based on testing Firefox) make click() a no-op when  
invoked as a result of a click event generated by calling click() on  
the same element. For IE this seems to be true even for user generated  
click events.

HTML5 does not currently say anything about this so presumably nested  
click() calls are allowed. A subtest of test 73 of Acid3 specifically  
tests for this.

Based on testing above shipping browsers treat click() as a special  
case. Changing this behavior to allow nested click() calls would be a  
significant regression risk. A better option would be specifying the  
click() nesting protection mechanism in HTML5.

There are more discussion in
http://bugs.webkit.org/show_bug.cgi?id=17083


   antti
Received on Monday, 10 March 2008 11:49:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:40 UTC