[WICG/webcomponents] [a11y]: permit aria-hidden=true on focusable shadow elements in FACE (Issue #1014)

consider:
```js
class FACEInput extends HTMLElement {
  static formAssociated = true;

  static template = document.createElement('template');
  static {
    this.template.innerHTML = /*html*/`
      <input aria-hidden="true">
    `;
  }

  #internals = this.attachInternals();

  constructor() {
    super();
    this.#internals.role = 'textfield';
    this.attachShadow({ mode: 'open' })
      .append(this.constructor.template.content.cloneNode(true));
    // handwave: imagine we add a "Reactive controller" which handles syncing aria props
    //           between the shadow root input and the host element.
    hookUpListenersAndAriaMixinProps(this, this.#internals);
  }
}

customElements.define('fancy-input', FACEInput);
```

Thus, we have
- a FACE which acts exclusively as an input
- a shadow input which
  - does the heavy ui lifting, sparing us from implementing everything with `contenteditable` etc
  - has `aria-hidden="true"`

In this case, the author's _intent_ is for the host element (`fancy-input`) to act transparently as an input. BUT, the accessibility tree will report two nested textfields - one for the host (internals.role) and a nested one for the shadow input, even though it is marked by the author as `aria-hidden`.

As well, the 'hidden' input will trigger a failure for automated accessibility audits.

We should consider relaxing the rule which disallows `aria-hidden=true` and `role=presentation` for elements which are within a FACE' shadow root. This would allow FACE authors to remove focusable elements from the ax tree, imperatively delegating ARIA stuff to the host.

cc @annevk and @rniwa who had some pointed critique with regard to focus and keyboard events. If there was a way to overcome those critiques, could this be a viable (though less capable) alternative to @alice' [semantic delegate](https://github.com/alice/aom/blob/gh-pages/semantic-delegate.md) proposal

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/1014
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/1014@github.com>

Received on Thursday, 11 May 2023 16:47:10 UTC