[whatwg] Make quoted attributes a conformance criteria

Aryeh Gregor Simetrical+w3c at gmail.com
Thu Jul 23 10:35:07 PDT 2009


On Thu, Jul 23, 2009 at 8:35 AM, Keryx Web<webmaster at keryx.se> wrote:
> Hello!
>
> 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. 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
>
> . . .
>
> With this in mind I suggest that the spec would be improved in the (below)
> following ways, and that we open a discussion about requiring quotation
> marks for all non-boolean attributes as a conformance criterion.

IMO, this is a stylistic preference.  Personally I prefer unquoted
values.  They're almost always allowed, and the cases where they
aren't are obvious to me ([ "'<>], right?).  They're fewer bytes, and
I think that makes a significant readability difference for short
attribute values:

<a href="/" title="Back" class="xyz">
<a href=/ title=Back class=xyz>

It makes the amount of markup noticeably less in some cases, letting
you more easily focus on the actual contents of the page.

I can see the opposite arguments as well.  But I don't think the
merits of either side are clear enough to warrant a conformance
criterion.

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

I don't think there's any value in having the spec take a stance like
this.  It's a matter of taste, IMO.


More information about the whatwg mailing list