Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of adapt-* attributes in HTTP Archive #222

Open
zcorpan opened this issue Sep 14, 2022 · 3 comments
Open

Usage of adapt-* attributes in HTTP Archive #222

zcorpan opened this issue Sep 14, 2022 · 3 comments
Labels
action required Symbols This item relates to the Symbols work effort in Adapt

Comments

@zcorpan
Copy link
Member

zcorpan commented Sep 14, 2022

At the APA & WHATWG joint meeting at TPAC today we discussed the usage of data-* attributes. The reason for not using data-* is that those attributes are intended store information that is private to the page. The HTML standard says:

Custom data attributes are intended to store custom data, state, annotations, and similar, private to the page or application, for which there are no more appropriate attributes or elements.

These attributes are not intended for use by software that is not known to the administrators of the site that uses the attributes. 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).

There seemed to be a preference in the meeting for the adapt- prefix. I promised to research usage in HTTP Archive for such attributes, which I've now done. I also looked for ssml- while at it.

The result is that out of the 15,000,000 pages in the dataset, there are 19 pages which use an attribute adapt-container-width="true". There were no ssml- prefixed attributes.

Conclusion: it should be web compatible to use adapt- and ssml- as prefixes.

query and detailed result
SELECT
  *
FROM (
  SELECT
    page,
    ARRAY_TO_STRING(REGEXP_EXTRACT_ALL(body, r'(?i)(<[a-z][a-z0-9_-]*(?:\s+[^>]+)*\s+(?:adapt|ssml)-[a-z0-9_-]*[^>]*>)'), "\n") AS match
  FROM
    `httparchive.response_bodies.2022_08_01_mobile`
  WHERE
    page = url )
WHERE
  match != ""

Result: https://docs.google.com/spreadsheets/d/1cFW6vGH5u3qgFyP2a3AvNkDCkKobWlhc_lI6_djCYkY/edit?usp=sharing

Note that the results contain false positives with e.g. adapt-* in class="".

@zcorpan
Copy link
Member Author

zcorpan commented Sep 14, 2022

Someone asked in the meeting if there's a list of all prefixed attributes that exist, which I had actually researched a few years ago: whatwg/html#2271 (comment)

@matatk
Copy link
Contributor

matatk commented Sep 25, 2022

Thank you @zcorpan for researching this and letting us know; this is great news. I am sure the Adapt Task Force will be filing an issue over on the HTML repo in order to begin dialogue with the WHATWG in due course.

I think that may've been me asking the question about the list of prefixed attributes. I'm also quite interested in searching the archive as part of our further development of the Adapt spec, and in relation to a separate personal project relating to landmark regions, so thanks for the pointers to those results, the docs, and the queries you used.

@snidersd
Copy link
Member

snidersd commented Apr 3, 2023

As per our discussion in today's Adapt weekly call, I'm adding the link to the filed issue requesting adapt- as our new prefix - whatwg/html#9084.

@matatk matatk added the Symbols This item relates to the Symbols work effort in Adapt label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action required Symbols This item relates to the Symbols work effort in Adapt
Projects
None yet
Development

No branches or pull requests

3 participants