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

[whatwg] bubbling events on labels

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 4 Jun 2010 15:26:43 -0700
Message-ID: <AANLkTikLB1FobS3LMl957M4BoBjGxj9hVDTXo5UW6MjK@mail.gmail.com>
On Fri, Jun 4, 2010 at 3:24 PM, Ashley Sheridan
<ash at ashleysheridan.co.uk> wrote:
> On Fri, 2010-06-04 at 15:21 -0700, Tab Atkins Jr. wrote:
>> On Fri, Jun 4, 2010 at 2:58 PM, Diego Perini <diego.perini at gmail.com> wrote:
>>> I have different behavior in browsers with the "checked" state of a checkbox
>>> input element.
>>>
>>> I have filed a ticket in Webkit and I am looking after some
>>> advice/suggestion about the correct behavior expected from this HTML:
>>>
>>> ?? <label>
>>> ???? <input type="checkbox">
>>> ???? <a href="#">Enable</a>
>>> ?? </label>
>>>
>>> It seems Safari/Chrome are discarding the click bubbling at the link level,
>>> thus never reaching the label and not toggling the checkbox.
>>>
>>> The behavior in Firefox/Opera and in Safari/Chrome is different and the
>>> checkbox is correctly "checked" (as I would have expected).
>>>
>>> Should a click on the link make the input checked ?
>> As far as I can tell, section 3.5.2.1.7 (Interactive Content)
>> specifies that clicking the link in that situation should activate the
>> link and not toggle the checkbox.
>
> I do wonder though in what situation you would ever have that sort if code layout and want the checkbox selected when the link is clicked. Clicking the link will navigate away anyway, making the form element useless in that context.

Not if the link is just to a target on the page, like it is in the
example given.

~TJ
Received on Friday, 4 June 2010 15:26:43 UTC

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