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
commit e562819a7e
Notes: sideshowbarker 2024-07-18 22:26:49 +09:00
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 {}));
}
}