W3C home > Mailing lists > Public > www-html@w3.org > March 2005

Re: why, e.g., input/@checked="checked" ?

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 31 Mar 2005 04:32:35 -0500
Message-ID: <424BC3B3.6010907@inkedblade.net>
To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>
CC: www-html@w3.org, Robert Koberg <rob@koberg.com>, whatwg@whatwg.org

Jukka K. Korpela wrote:
> On Sat, 26 Mar 2005, David Dorward wrote:
> 
> 
>>HTML was designed before XML, XSLT and XHTML were, so it didn't take
>>into consideration any design implications it would cause for them.
> 
> That's correct, but in this issue, it was also designed without really
> thinking in SGML terms. "Boolean attributes" (which are even called that
> way in HTML specifications) don't fit into SGML philosophy, although they
> were formally retrofitted into SGML formalism. It would be have been much
> more SGML-like to have an attribute that takes two values, like "checked"
> and "unchecked", the latter being the default, and the attribute name
> being 'status' for example.

What Jukka's trying to say is, attribute minimalization in SGML -- which
lets you do things like
   <input type="checkbox" checked>
doesn't let you leave out the name of the attribute -- it lets you leave
out the *value*. So, for example, I could use attribute minimalization to
shorten the 'type="checkbox"' part like so:
   <input checkbox checked>

An easy fix to make the 'checked' attribute more template-friendly would be
to introduce the 'unchecked' value Jukka suggests. Then you can use a
   checked="[test ? checked : unchecked]"
type of construction to set the attribute in XHTML.

~fantasai
Received on Thursday, 31 March 2005 09:32:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:02 GMT