| Summary: | Integrate ARIA element reflection in the Accessibility Tree | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Manuel Rego Casasnovas <rego> | ||||
| Component: | Accessibility | Assignee: | Manuel Rego Casasnovas <rego> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | andresg_22, commit-queue, rackler, rniwa, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | 245762 | ||||||
| Bug Blocks: | 196843, 245301 | ||||||
| Attachments: |
|
||||||
I think this is also broken when the referenced element doesn't have an ID Pull request: https://github.com/WebKit/WebKit/pull/4299 Created attachment 462484 [details]
Patch
Comment on attachment 462484 [details]
Patch
Sorry wrong command to upload patch.
Committed 254905@main (5a61ea9a8257): <https://commits.webkit.org/254905@main> Reviewed commits have been landed. Closing PR #4299 and removing active labels. Re-opened since this is blocked by bug 245762 *** Bug 245761 has been marked as a duplicate of this bug. *** New pull request: https://github.com/WebKit/WebKit/pull/4784 Committed 254985@main (fa51d4c1048c): <https://commits.webkit.org/254985@main> Reviewed commits have been landed. Closing PR #4784 and removing active labels. |
IDREF element reflection hasn't been hooked up with AccessibilityObject. Right now if you do something like the following example, the a11y tree doesn't know anything about the label you're assigning to the custom input: <label id="anotherLabel">Another label</label> <x-input-idref id="myxinput"></x-input-idref> <script> class XInputIDREF extends HTMLElement { constructor() { super(); this.attachShadow({ mode: "open" }); let input = document.createElement("input"); input.id = "innerbutton"; this.shadowRoot.appendChild(input); input.ariaLabelledByElements = [anotherLabel]; } } customElements.define("x-input-idref", XInputIDREF); If you use the accessibility info in the inspector, you'll see the inner <input> doesn't have the label associated to it. This is because as the attribute is not reflected, as the label is not in the shadow tree, and we need to update AccessibilityObject::elementsFromAttribute() to return the explicitly set elements in that scenario.