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

Document interop of misspelled aria-labeledby and its conflict resolution #2093

Open
cookiecrook opened this issue Dec 15, 2023 · 6 comments
Assignees
Labels
aria-labelledby needs-automated-test Needs an additional automated test via WPT computedLabel(), computedRole(), or other methods.

Comments

@cookiecrook
Copy link
Contributor

cookiecrook commented Dec 15, 2023

All three engines support a misspelled alternate of aria-labelledby without the UK-English-style double l (aria-labeledby). I think this dates back to a WebKit implementation that Chromium inherited in the fork of Blink, and Gecko added later to match the others. The WPT test was added by Google in 2019 when Chrome shipped element reflection, and I've only recently become aware that this non-standardized behavior had consistent interop between the engines. Usage reports indicate the misspelling is low but not insignificant, so I and others think it should remain in the engines for the sake of web compat.

I'm filing this issue because I think the ARIA group should perform additional research (probably in the form of a WPT test PR) that fully fleshes out conflict resolution and other unknowns... For example, aria-labelledby should obviously win over aria-labeledby but should the misspelled aria-labeledby win over aria-label? We can use WPT to determine if the engines agree on that and other details.

Once those are determined, the ARIA WG will probably wish to document that engine behavior (as well as any needed conflict resolution in AccName), note the author error, etc.

[Update: 3 Jan 2024] Looking at @rahimabdi's results in Gecko (click "Show details"), Firefox's implementation of the non-standard spelling is either off or very incomplete (I have not checked Gecko source), so it's possible the ARIA WG decision may not be to document and keep it. I added the "Agenda" keyword to discuss either way.

@rahimabdi
Copy link
Contributor

rahimabdi commented Dec 16, 2023

WPT tests for this one include the following tests (presumably to be added to the existing accname/name/comp_labelledby.html test file):

  • Testing standalone aria-labeledby for name calculation
  • Testing aria-labelledby's precedence over aria-labeledby
  • Testing aria-labeledby and accname precedence

PR for this investigation:

@cookiecrook cookiecrook added the needs-automated-test Needs an additional automated test via WPT computedLabel(), computedRole(), or other methods. label Dec 16, 2023
@rahimabdi
Copy link
Contributor

One concern if we choose not to document it would be folks not recognizing it as valid (such as this ACT rule proposal for ARIA being valid and awaiting formal documentation in ARIA).

@spectranaut
Copy link
Contributor

Discussed in the ARIA working group today: https://www.w3.org/2024/01/11-aria-minutes#t08

Rahim will make a few more test in WPT before we move forward the discussion of what to document in ARIA.

@rahimabdi
Copy link
Contributor

@cookiecrook @spectranaut @scottaohara Per Scott's suggestion, I've added additional tests to verify what browsers currently do when both aria-labeledby and aria-labelledby are present (in that order); it appears that the aria-labelledby association is honored regardless of the attribute order.

Pending any additional tests, I think we can now revisit whether or not the WG would like to update spec to explicitly permit aria-labeledby.

@scottaohara
Copy link
Member

i think it makes sense to officially support aria-labeledby.

the primary thing that looks like it needs discussion is whether aria-labeledby and aria-labelledby should be given equal weight in the naming algorithm (e.g., if aria-labeledby is declared first it should provide the name and any other instance of aria-labelledby or aria-label should be ignored)

Or, to change the current results from failures to 'passes', aria-labelledby is still considered the most important attribute, and aria-labeledby will always defer to the official spelling, regardless of declaration order. But if this is the route taken, then this means that aria-labeledby is similar but not a true alias for aria-labelledby, and this difference would need to be called out in the spec as more than just a note of supporting the mispelling.

@spectranaut
Copy link
Contributor

Discussed at length in today's working group meeting: https://www.w3.org/2024/05/16-aria-minutes#t07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aria-labelledby needs-automated-test Needs an additional automated test via WPT computedLabel(), computedRole(), or other methods.
Projects
None yet
Development

No branches or pull requests

5 participants