1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibWeb: Generate layout nodes for shadow subtrees

Elements with shadow roots will now recurse into those shadow trees
while building the layout tree.

This is the first step towards basic Shadow DOM support. :^)
This commit is contained in:
Andreas Kling 2021-02-10 18:23:52 +01:00
parent 41ff7268db
commit e562819a7e
3 changed files with 18 additions and 3 deletions

View file

@ -26,6 +26,7 @@
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/Layout/BlockBox.h>
namespace Web::DOM {
@ -46,4 +47,9 @@ EventTarget* ShadowRoot::get_parent(const Event& event)
return host();
}
RefPtr<Layout::Node> ShadowRoot::create_layout_node()
{
return adopt(*new Layout::BlockBox(document(), this, CSS::ComputedValues {}));
}
}