W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] Make quoted attributes a conformance criteria

From: Kornel <kornel@geekhood.net>
Date: Thu, 23 Jul 2009 14:32:09 +0100
Message-ID: <8254564A-D559-4C56-A1E4-3696EAFA4E82@geekhood.net>
On 23 Jul 2009, at 13:35, Keryx Web wrote:

> I'd say it is safe to say that using quotation marks for attribute  
> values, always, except perhaps for collapsed, boolean attributes,  
> has been regarded as best practice for a long time now. Speaking as  
> an instructor for newbies, enforcing quotation marks has proven its  
> value countless of times for me and my students.

It's not a clear benefit. Unpaired quotation marks can also be a  
*source* of errors, which wouldn't happen without them:

<a href="http://example.com class="test">

> I'd say that all of my colleagues in WaSP EduTF would agree on that.  
> Others share that sentiment too: http://twitter.com/burningbird/status/2765482250

I disagree about making it a conformace criterion. This is not  
required to get text/html documents parsed reliably and unambiguously.

I wouldn't mind much if specification used more quotes in examples,  
however I'm afraid that taking this to the extreme could give false  
impression that unquoted attributes are an error, and spec would fail  
to illustrate when quotes are necessary and when they're perfectly  
safe to omit.

> Add:
> In order to avoid errors and increase readability, using quotes is  
> highly recommended for all non-omitted attribute values.

To me min=0 is more readable than min="0". This is a matter of  
opinion, and IMHO spec should not enforce one's coding style.

regards, Kornel
Received on Thursday, 23 July 2009 06:32:09 UTC

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