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

ARIA role insertion and deletion #1558

Closed
dontcallmedom opened this issue Mar 1, 2023 · 5 comments
Closed

ARIA role insertion and deletion #1558

dontcallmedom opened this issue Mar 1, 2023 · 5 comments

Comments

@dontcallmedom
Copy link

dontcallmedom commented Mar 1, 2023

I've been trying to use role=insertion to markup a complex document containing diffs, but the validator complains with

 Bad value “insertion” for attribute “role” on element “section”

(likewise for the role deletion)

@scottaohara
Copy link
Contributor

not presently allowed on the section element. Up for consideration if this needs to change. but with that said...

what's your use case? as if you want to imply a section is deleted, it'd be best to do it as

<del> or <div role=deletion>
  <section>....</section>
</del> or </div>

or if it's not a section you want deleted, and you're just arbitrarily using that element, then why not just use a div, or again, the native element that does the same thing?

@dontcallmedom
Copy link
Author

when you say not allowed, do you mean by the validator or by the spec? My reading of the spec was that it was allowed on any flow content.

My interest in using the role attribute rather than a wrapping <ins> is that this is to annotate a complex document via a script, and any structural change (such as wrapper elements) are pretty tricky to manage.

@scottaohara
Copy link
Contributor

no, sorry. that part of the spec is informatively stating what each role would be classified as, and descendants that would be expected for that element. the table above https://w3c.github.io/html-aria/#el-section is what you should be looking at for what ARIA attributes are allowed on a particular element

@scottaohara
Copy link
Contributor

for instance, if you were trying to identify a section with an accname, thus a region landmark, as a role=deletion - the region landmark would be removed in place of this deletion role. this would cause soemthing that was previously easily discoverable as something that could become hard to re-locate.

@dontcallmedom
Copy link
Author

thanks a bunch for the pointer and the explanation!

It's very clear this isn't a validator bug, so I'll close this issue.

And from the explanation, it looks like role-less wrapper elements would be hard to avoid here, and that expanding the set of elements that can use insertion and deletion roles would not likely to achieve the desired result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants