[whatwg] Make quoted attributes a conformance criteria
Michael Kozakewich
mkozakewich at icosidodecahedron.com
Sat Jul 25 10:20:03 PDT 2009
From: "Eduard Pascual" <herenvardo at gmail.com>
Sent: Saturday, July 25, 2009 5:08 AM
To: "Keryx Web" <webmaster at keryx.se>; "Bil Corry" <bil at corry.biz>
Cc: <whatwg at lists.whatwg.org>; "Aryeh Gregor" <Simetrical+w3c at gmail.com>
Subject: Re: [whatwg] Make quoted attributes a conformance criteria
> On Fri, Jul 24, 2009 at 9:52 PM, Keryx Web<webmaster at keryx.se> wrote:
> Finally, there are some values that are better unquoted, such
> as those attributes that can only take a number (there is no risk of
> errors, and the quotes would normally hurt readability more than they
> help it).
Values better unquoted are those that would make problems if they were
quoted. I've never run into any value that couldn't be quoted; effectively,
the cases you mention fall under "don't need to be quoted."
Your argument lies on the fact that quotes make things less readable. Any
change from what you're used to will appear less readable, but I'm not
convinced that quotes inherently make code less readable. (Though I'll grant
that Boolean attributes don't need quotes, unless they're XHTML.)
>> 3. Add some words about best practice, but do not enforce quotes as a
>> conformance criterion.
>>
>> 4. Go all the way and do just that.
> Again, there is a middle point between these: making validators issue
> warnings for potentially unsafe attributes is, IMO, the sanest
> approach here.
I see a disconnect here between the validator and the spec. The validator
would base everything on the spec, and so the spec itself should recommend
quotes for "potentially unsafe attributes" at the very least, and back up
that view in all the code examples.
This is HTML, not XHTML, so it's useless to even ask that we conform to a
policy of "All quotes all the time." At the same time, the spec really does
need to be clear that quotes are the best policy, and to be very explicit
about where the absence of quotes are very dangerous.
>> Stopping before (4) above will force people like me to keep requiring
>> false
>> XHTML from my students.
That's an all-or-nothing approach. There's no reason you can't teach
students to quote everything except boolean attributes, with the added
explanation that XHTML does require the boolean attributes to be lengthened
and quoted.
More information about the whatwg
mailing list