W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: Empty attribute syntax and the DOM and CSS

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sun, 22 Jun 2008 14:04:30 +0200
Message-ID: <485E3FCE.6020804@lachy.id.au>
To: Daniel Schattenkirchner <schattenkirchner.daniel@gmx.de>
Cc: public-html@w3.org

Daniel Schattenkirchner wrote:
> I wonder how empty attributes are represented in the DOM and how they 
> should work with CSS. Take a look at the example code:
> <!doctype html>
> <html>
> <body>
> <p><input type="submit" disabled></p>
> </body>
> </html>
> ...
> It's an unimportant edge case, but if I didn't miss the relevant parts 
> in the draft, it is undefined how <element disabled /> should be 
> represented.

It is defined.  In the tokenisation section of the parsing algorithm, 
the spec states this about creating a new attribute:

| Start a new attribute in the current tag token. Set that attribute's
| name to the lowercase version of the current input character (add
| 0x0020 to the character's code point), and its value to the empty
| string. Switch to the attribute name state.


Since the value never gets changed from the empty string if there it 
never reaches either of the attribute value states, the value remains as 
the empty string.  Therefore, <input disabled> is identical in meaning 
to <input disabled="">.  The implementations that treat those 
differently are broken.

Lachlan Hunt - Opera Software
Received on Sunday, 22 June 2008 12:05:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:25:20 UTC