w3c / aria

Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/
Other
646 stars 125 forks source link

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

Open cookiecrook opened 10 months ago

cookiecrook commented 10 months ago

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 commented 10 months ago

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

PR for this investigation:

rahimabdi commented 9 months ago

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 commented 9 months ago

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 commented 6 months ago

@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 commented 5 months ago

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 commented 5 months ago

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