[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Boolean attributes in XHTML/HTML5

  • From: Peter Flynn <peter@silmaril.ie>
  • To: xml-dev@lists.xml.org
  • Date: Tue, 28 Feb 2012 22:05:52 +0000

Re:  Boolean attributes in XHTML/HTML5
On 10/02/12 14:18, David Carlisle wrote:
> On 10/02/2012 14:02, Len Bullard wrote:
>> Which doesn't answer the question why they didn't choose disabled="yes".
>
> I wasn't involved but presumably because that would lead people to think
> that the attribute value mattered and that disabled="no" meant something
> different from disabled="yes". The point about boolean attributes as
> interpreted by browsers is that they are true if they are there (with
> any value) and false if they are not there.

 From memory, assisted by a trawl of the IETF HTML-WG at 
https://listserv.heanet.ie/cgi-bin/wa?A0=HTML-WG, there was no decision 
at all.

I believe the pre-HTML2 code samples (TBL?) originally used <option 
selected> and <input type=radio checked> because it wasn't actually 
meant to undergo a formal SGML validation, so the question of what 
"checked" and "selected" implied (as attributes) was not under 
consideration.

When we cast HTML2 as a DTD, the values had to be declared as 
*something*, and creating an attribute called after the value you wanted 
to minimise it to probably seemed like a good idea at the time. I don't 
recall it ever being questioned.

> so in html you have <foo> and <foo disabled> as markup, in XML where you
> need to supply a value, disabled="disabled" is valid for legacy reasons,
> disabled="" is valid because that's what people thought the syntax was
> anyway and anything else including disabled="no" acts the same way as
> disabled="" but is classed as non conforming (which only matters to
> validators not to browsers)

There are lots of other attribute minimisations that could have been 
used if formal validation had been on the cards. The following is valid 
SGML, for example:

<!doctype html public "-//IETF//DTD HTML 2.0 Strict//EN">
<title>Test</title>
<form>
<ul>
<li><input radio>A
<li><input radio checked>B
<li><input radio>C
</ul>
<input submit>
</form>

But as most browser writers didn't actually know any SGML, the question 
never arose.

///Peter


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.