Re: Making all elements and attributes that contain hyphens valid

James Graham <james@hoppipolla.co.uk>, 2013-10-16 12:39 +0100:

> On 16/10/13 12:07, Silvia Pfeiffer wrote:
> 
> >So, in your opinion, should we change
> >http://www.w3.org/html/wg/drafts/html/master/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes
> >to only apply to private attributes,
> >
> >and add to
> >http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#extensibility
> >the suggestion to use a custom prefix xxx-* for libraries?
> 
> Maybe I should read more context here, but that's exactly what data- is
> already for. If you embed a library in your page, your page isn't
> independent of that library and so the library doesn't count as "software
> that is independent of the site that uses the attributes". That clause is
> supposed to forbid using data-* for e.g. microformats where one might write
> microformat-consuming software that is entirely decoupled from the site the
> markup appears on.
> 
> Given this, I don't understand why you would want xxx-foo rather than
> data-xxx-foo.

If you look at it from the perspective of authors using the attributes from
your library, I think the question should be, why would authors want to use
data-xxx-foo rather than xxx-foo. Unless you're making the authors using
your library also use dataset themselves to get to the data-* values, then
doing data-xxx-foo buys the authors nothing.

Along with that, by providing authors with data-xxx-foo attributes to use
instead of xxx-foo attributes, you're making things harder for authors to
catch some kinds of authoring mistakes they might make. The only way
they're like to be able to catch syntax/datatype errors with data-xxx-foo
is by testing the code by running and hoping that it will fail in some
obvious way if they have a syntax error in a data-xxx-foo value.

Because by using data-xxx-foo you're basically buying into a contract that
says the attributes and their values should be ignored by any applications
except the library that they're designed to be run with.

  --Mike

-- 
Michael[tm] Smith http://people.w3.org/mike

Received on Wednesday, 16 October 2013 12:10:44 UTC