Skip to content

ElementInternals ARIA role conflict resolution #5162

Description

@straker

When resolving the role of an element with an attached internals role, and the element defines an explicit none role and is either focusable or has a global ARIA attribute, axe-core currently resolves the internal role as the implicit role.

<my-button tabindex="0" role="none">btn none focusable</my-button>
<script>
  customElements.define(
    'my-button',
    class MyButton extends HTMLElement {
      constructor() {
        super();
        this._internals = this.attachInternals();
        this._internals.role = 'button';
      }
    }
  )
</script>

According to the spec this should be correct, however no browser currently supports this. Tracking here so we can watch it. Filed bugs with:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions