-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Shadow DOM and ElementInternals ARIAMixin properties #8544
Comments
CC @rniwa as he might have thoughts about this too. |
I do think we still want the same overall approach as at the very least we do not want to return elements that are not connected to the same document. (I.e., you can assign whatever, but you might not be able to get it back out.) But I think there's some merit to this idea. At the very least not hiding references to elements inside the shadow tree associated with the element cc @whatwg/components |
Original commentThis makes sense to me. There is maybe (?) even a principled reason to expose elements inside the shadow root associated with the host element, since it's possible to leak the shadow root using console.log(element.shadowRoot) // null
const internals = element.attachInternals()
console.log(internals.shadowRoot) // #shadow-root (closed) (Of course the component can defensively prevent this by calling (Just occurred to me it's orthogonal whether an element can leak its If you have access to an |
I cannot attend triage until Feb 23 it seems. If folks could give this a look before then I'd appreciate it, but otherwise I can explain then. |
Other changes: * Remove reflection of unrestricted double as it is buggy and unused. * The DOMString getter steps did not account for a missing attribute. * The native accessibility semantics map was renamed to the internal content attribute map as it's now a more general reflection concept. Corresponding ARIA PR: w3c/aria#1876. Fixes #8442. Follow-up: * w3c/core-aam#152 * w3c/aria#1110 * #3238 * #8544 * #8545 * #8926 * #8927 * #8928 * #8930
In particular allow them to point to any known element, as long as that has the same shadow-including root as the ElementInternals's element. This is not considered to break encapsulation as ElementInternals itself is encapsulated. Tests: anyone want to volunteer? Fixes #8544.
I've done part of this work in #8932 but as noted there we might want to address some bigger issues in this space first. Help welcome with regards to review and tests and such. |
This came out of the discussion on #8442.
Do
Element
/FrozenArray<Element>
attributes onElementInternals
need to be subject to the same Shadow DOM validation rules as the same IDL attributes on Elements?For example:
@annevk and I were chatting about this and it seems that the constraints which led to disallowing elements in Shadow DOM from being used for Element type reflecting IDL attributes on Elements may not apply when it comes to
ElementInternals
, sinceElementInternals
won't generally be available to any in-page scripts, and thus can't lead to undesirable dependencies on implementation details within Shadow DOM.@nolanlawson we were chatting about this in AOM, so I thought you might also have some thoughts to add here.
The text was updated successfully, but these errors were encountered: