mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Maintain list of allocated shadow roots in Document
Doing that will allow us to get a list of style sheets for each shadow root from StyleComputer without having to traverse the entire tree in upcoming changes.
This commit is contained in:
parent
c6e69d501f
commit
91ec1d6f95
4 changed files with 36 additions and 0 deletions
|
@ -19,9 +19,16 @@ ShadowRoot::ShadowRoot(Document& document, Element& host, Bindings::ShadowRootMo
|
|||
: DocumentFragment(document)
|
||||
, m_mode(mode)
|
||||
{
|
||||
document.register_shadow_root({}, *this);
|
||||
set_host(&host);
|
||||
}
|
||||
|
||||
void ShadowRoot::finalize()
|
||||
{
|
||||
Base::finalize();
|
||||
document().unregister_shadow_root({}, *this);
|
||||
}
|
||||
|
||||
void ShadowRoot::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue