w3c/adapt

data-* or data-aui-*

plannero opened this issue · 7 comments

The document "Comparison of ways to use vocabulary in content" makes it obvious that the selection of prefix "data-" was done after a serious consideration of the options. Thanks!

However, when I presented the Personalization documents to a group of a11y people in Sweden, several of them objected to the use of "data-" as a prefix to be used for standardized semantics. The main argument being that there's a significant risk that a "data-*" attribute (eg "data-action") is used with an entirely different meaning, causing confusion.

In the "Comparison" document, at https://github.com/w3c/personalization-semantics/wiki/Comparison-of-ways-to-use-vocabulary-in-content#-data-set-data--or-data-aui--attributes the pros and cons of "Data set" attributes are listed under "data-* or data-aui-", but in the draft recommendation only "data-" is being used. It appears to me that - although longer - "data-aui-*" would be considerably less likely to be already used for some other purpose, and therefore a better compromise.

Unfortunately, all web-wide use of "data-" seems to be in conflict with the HTML 5.2 specification: "For generic extensions that are to be used by multiple independent tools, either this specification should be extended to provide the feature explicitly, or a technology like microdata should be used (with a standardized vocabulary).", and a bit further down (in Example 21): "these attributes are intended for use by the site’s own scripts, and are not a generic extension mechanism for publicly-usable metadata." https://www.w3.org/TR/html52/dom.html#embedding-custom-non-visible-data-with-the-data-attributes

Perhaps you already discussed these factors? If you didn't, and if it is not too late, I would suggest at least to change from data-* to data-aui-* in order to minimize conflicting semantics. Or even go for the microformat/itemprop construction if the W3C wants to use the momentum from ongoing accessibility regulation to further such generic frameworks for a more semantic web. Perhaps a question for the TAG?

Thanks John for an excellent clarification!

Fyi: I received the comments regarding the prefix when sharing a blog post about the Personalization documents that I wrote a few days ago. The blog post contains some more comments on the specifications, if you’re interested:
https://www.metamatrix.se/aktuellt/invisible-web-design-colors/

Looking forward to seeing your work being implemented!

Thanks again for taking the time to respond in depth!
I did not consider IoT, but of course, that's a relevant aspect.
Neither did I consider attribute injection by proxy servers. Lots of things to explore. Exciting area indeed! I'd be very happy to be more involved, but in the near future I can only make occasional contributions, due to other assignments.

Reading through all of this- As a web author, I prefer that data-* is left alone and something different is proposed. We've already been given data-* for author use and I think it's not backwards-compat to start using it in spec.

Since naming things is hard, I'd like to propose an alternative for consideration. What about purpose-* ?

@MelSumner Thank-you for the feedback.

Our current plan of using data-* is based on the recommendation from the W3C's Technical Architecture Group (TAG) as a first step. The data-* prefixing convention is used for experimental implementations per HTML 5, which is ongoing now.

Stepping back, it is our hope that we ultimately end up with attributes that have NO prefix (i.e. @purpose, or @destination) - that our attributes become "mainstream". We've seen this happen before with the ARIA attribute of @ROLE (which does NOT have the aria- prefix: i.e we don't today write aria-role="", although once upon a time...)

As experimentation continues, we may find that some of our proposed attributes will indeed require prefixing, and we've discussed that possibility internally (aui-* is a strong candidate) however our preference at this time is to presume non-prefixed attributes down the road, and if/when we have to settle on a permanent prefix we'll have a separate discussion at that time.

Closing as no new comments have been receive in 3 weeks.