This illustrates the possibility of indirecting AOM element references so that they work across shadows. The main ideas are:
- Use custom element code to coordinate references light DOM and shadow DOM.
- Ensure that AOM references can be indirected: if element A references B for a label, and B references C for a label, then A ends up getting its label from C.
- Let the custom element host serve as an indirection point between the light and shadow DOM.
- Define fallback AOM properties on
elementInternals
that are used if the corresponding properties are not set on the host. This lets a host reference elements in its own shadow without exposing those references.
Adapting a combo box example from Alice Boxhall.