LibWeb: Give Element a CustomStateSet, exposed by ElementInternals

This commit is contained in:
Sam Atkins 2025-07-04 14:03:44 +01:00 committed by Tim Ledbetter
parent e63d81b36e
commit b6ffea8990
Notes: github-actions[bot] 2025-07-04 17:11:47 +00:00
10 changed files with 209 additions and 1 deletions

View file

@ -208,6 +208,13 @@ WebIDL::ExceptionOr<GC::Ptr<DOM::NodeList>> ElementInternals::labels()
return WebIDL::NotSupportedError::create(realm(), "FIXME: ElementInternals::labels()"_string);
}
// https://html.spec.whatwg.org/multipage/custom-elements.html#dom-elementinternals-states
GC::Ptr<CustomStateSet> ElementInternals::states()
{
// The states getter steps are to return this's target element's states set.
return m_target_element->ensure_custom_state_set();
}
void ElementInternals::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(ElementInternals);