w3c / accname

Accessible Name and Description Computation
https://w3c.github.io/accname/
60 stars 23 forks source link

`name` not allowed on a `li` element #214

Closed daniel-montalvo closed 8 months ago

daniel-montalvo commented 8 months ago

Ref: https://validator.w3.org/nu/?showsource=yes&doc=https%3A%2F%2Fw3c.github.io%2Faccname%2F

The HTML checker complains that there is a name attribute on a li element. Can we use another method for this that passes the HTML validator?

pkra commented 8 months ago

They don't appear to be used for anything.

Looking at https://github.com/w3c/accname/commit/9c71070a9b28b11feb7e3e66b4242b53bc8fdb71, it seems like they were left in place by @cookiecrook during #186. Maybe to facilitate review or perhaps for historical value? In the latter case, we could add a data-historical- prefix.

daniel-montalvo commented 8 months ago

Thanks for this detailed explanation, @pkra

If @cookiecrook does not object, I'm happy to take this on. I am taking an overall pass at most of the ARIA modules to make them ready for transition to next maturity level.

daniel-montalvo commented 8 months ago

According to @jnurthen this was left for old links to keep working. One can do https://github.io/accname/#step1 and be taken to the "Initialization" step under the "Text Equivalent Computation" section.

pkra commented 8 months ago

According to @jnurthen this was left for old links to keep working. One can do https://github.io/accname/#step1 and be taken to the "Initialization" step under the "Text Equivalent Computation" section.

It doesn't though -- only for a tags. Putting the names on some anchors in the list items should work though.

cookiecrook commented 8 months ago

Yes. Ideally we'll need to leave non-linked anchors so that older incoming links don't break:


<li id="newNamedStepID">
  <a name="oldNumberedStepName">Labelledby:</a>
  etc etc
</li>
cookiecrook commented 8 months ago

Cool URIs don't change (or break) https://www.w3.org/Provider/Style/URI

cookiecrook commented 8 months ago

@w3c/aria-editors Should there be a GitHub hook to include validation as a PR check?

daniel-montalvo commented 8 months ago

Not sure what we would check here in addition to what specprod already checks.

If you have a look at https://github.com/w3c/accname/actions/runs/6706842952 that is checking links and markup, including the HTML validator, which now fails on <li name="">

cookiecrook commented 8 months ago

Ah. I didn't know it was already validating.

Now I'm wondering why that didn't get flagged on my original PR #186.

daniel-montalvo commented 8 months ago

@cookiecrook We have a much lightweight set of linters for the PRs. I realized the other day because I wanted to make sure we could publish on TR, for winch markup validation and link checkers are compulsory.

jnurthen commented 8 months ago

We can't use <a name> as respec will try to resolve these as references

cookiecrook commented 8 months ago

We can't use <a name> as respec will try to resolve these as references

Do you have another resolution in mind? I suppose we could drop the old permalinks.

cookiecrook commented 8 months ago

Oh I know. We can move the old numbered name to an id on the <em> that is the first child of each li

<li id="newNamedStepID">
  <em id="oldNumberedStepName">Labelledby:</em>
  etc etc
</li>

The <em> should already be there... Just move the attr to the firstChild and change the attr name from name to id.

jnurthen commented 8 months ago

I created a PR with empty spans with IDs - see above. Seems to validate fine and works

jnurthen commented 8 months ago

Oh I know. We can move the old numbered name to an id on the \<em\> that is the first child of each li


<li id="newNamedStepID">
  <em id="oldNumberedStepName">Labelledby:</em>
  etc etc

The `\<em\>` should already be there... Just move the attr to the firstChild and change the attr name from `name` to `id`.

Not every line with the name attributes has an em element to add it to. Decided adding a span and being consistent was more important

cookiecrook commented 8 months ago

okay... let's continue in the PR