LibWeb: Add activeElement attribute in ShadowRoot

This commit is contained in:
Feng Yu 2025-02-02 22:04:01 -08:00 committed by Tim Ledbetter
commit 66d18170c6
Notes: github-actions[bot] 2025-09-10 15:53:47 +00:00
8 changed files with 166 additions and 36 deletions

View file

@ -7,6 +7,7 @@
#include <LibWeb/Bindings/ShadowRootPrototype.h>
#include <LibWeb/DOM/AdoptedStyleSheets.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/DocumentOrShadowRoot.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/HTML/HTMLTemplateElement.h>
@ -119,6 +120,11 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_html_unsafe(StringView html)
return {};
}
GC::Ptr<Element> ShadowRoot::active_element()
{
return calculate_active_element(*this);
}
CSS::StyleSheetList& ShadowRoot::style_sheets()
{
if (!m_style_sheets)