-
Notifications
You must be signed in to change notification settings - Fork 13
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
Elements whose implicit role depends on the presence of an accessible name might not be correctly handled #298
Comments
Surprisingly, Chrome also fails to handle this case correctly and exposes For reference:
|
This may be influenced by #307. |
It appears that Chrome might actually just be dealing with this at a different layer, possibly to get around the same issue as we're facing? There's a method |
Here are some test cases to try out:
Results on my end:
|
For now, we'll handle the case of |
I think that I encountered something like this issue on a customer's page. But it might not be exactly the same issue. Here is a reconstruction of the customer's HTML:
The HTML above fails R57. That is incorrect, I think, because https://www.w3.org/TR/html-aam-1.0/#el-aside-ancestorbodymain states that "aside (scoped to the body or main element)" has the implicit role of complementary and has no accessible name requirement. The HTML below passes R57.
|
Yes, that's part of it. I messed up when I hacked around it in this commit 🙈 |
@dan-tripp-siteimprove a fix is on its way. Should be part of v0.60 |
An example is the
<section>
element which should have an implicit role ofregion
if the element also has an accessible name: https://w3c.github.io/html-aam/#el-section. Alfa does not yet handle cases like these correctly though:alfa/packages/alfa-aria/src/feature.ts
Lines 511 to 514 in 45e77ac
The reason is the circularity between the role and accessible name computations; to determine the role of an element we might need to first determine its accessible name and to determine its accessible name we might need to first determine its role. The best way to deal with this seems to be to make it possible to break the accessible name computation into configurable steps to allow callers to only enable a subset of the steps taken in determining the accessible name.
Elements whose implicit role depend on name:
<aside>
<form>
<section>
Rules that are affected by this:
region
, may be<section>
landmark
, may be either<form>
or<section>
)landmark
).We currently handle these cases directly in the rules, through the
hasIncorrectRoleWithoutName
predicate. This is not a very satisfactory solution and the problem starts creeping in several rules 😕The text was updated successfully, but these errors were encountered: