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

[whatwg] Should :default apply to checkboxes, radios, and options?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 30 Apr 2010 13:05:07 -0700
Message-ID: <h2kdd0fbad1004301305pbd0ff2a9xb12d86d93db9d91d@mail.gmail.com>
On Fri, Apr 30, 2010 at 12:12 PM, L. David Baron <dbaron at dbaron.org> wrote:
> For a long time, Gecko has implemented the behavior that the
> :default pseudo-class matches checkboxes, radios, and options that
> are selected by default (i.e., anything that matches :checked by
> default). ?I think supporting it for option elements is explicitly
> stated in the spec where :default was introduced:
> ?# One example is the default submit button among a set of buttons.
> ?# Another example is the default option from a popup menu.
> ?# Multiple elements in a select-many group could have multiple
> ?# :default elements, like a selection of pizza toppings for
> ?# example.
> ? ?-- http://www.w3.org/TR/css3-ui/#pseudo-default
> and I think supporting it for radios and checkboxes logically
> follows from that.
>
> However, the HTML5 spec says that :default should not apply in these
> cases:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#selector-default
>
> I don't feel particularly strongly about this one, but it seems like
> the original intent of :default was to match both things that are
> the "default button" and things that are "selected by default".
>
> Was this difference with existing implementation behavior
> intentional?

By "selected by default", do you mean things that had @checked or
@selected on page load?

~TJ
Received on Friday, 30 April 2010 13:05:07 UTC

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