-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
topic: custom elementsRelates to custom elements (as defined in DOM and HTML)Relates to custom elements (as defined in DOM and HTML)topic: reflectFor issues with reflected IDL attributes and friendsFor issues with reflected IDL attributes and friendstopic: shadowRelates to shadow trees (as defined in DOM)Relates to shadow trees (as defined in DOM)
Description
This came out of the discussion on #8442.
Do Element/FrozenArray<Element> attributes on ElementInternals need to be subject to the same Shadow DOM validation rules as the same IDL attributes on Elements?
For example:
<my-listbox>
# shadowRoot
| <my-listitem>Generated option 1</my-listitem>
| <my-listitem>Generated option 2</my-listitem>
| <my-listitem>Generated option 3</my-listitem>
</my-autocomplete>class MyListbox extends HTMLElement {
constructor() {
super();
this._internals = this.attachInternals();
this._internals.role = "listbox";
// etc
}
// ...
// called when a user selects a list item via mouse or keyboard
listItemSelected(selectedListItem) {
// not allowed:
// this.ariaActiveDescendantElement = selectedListItem;
// allowed?
this._internals.ariaActiveDescendantElement = selectedListItem;
}
}@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, since ElementInternals 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
topic: custom elementsRelates to custom elements (as defined in DOM and HTML)Relates to custom elements (as defined in DOM and HTML)topic: reflectFor issues with reflected IDL attributes and friendsFor issues with reflected IDL attributes and friendstopic: shadowRelates to shadow trees (as defined in DOM)Relates to shadow trees (as defined in DOM)