mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibWeb: Introduce the slot concept for HTML slot elements
A slot is an HTMLSlotElement. It may have any number of slottable nodes assigned to it.
This commit is contained in:
parent
45b36bd08a
commit
7870f10aa8
5 changed files with 71 additions and 1 deletions
21
Userland/Libraries/LibWeb/DOM/Slot.cpp
Normal file
21
Userland/Libraries/LibWeb/DOM/Slot.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/Slot.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
Slot::~Slot() = default;
|
||||
|
||||
void Slot::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
for (auto const& node : m_assigned_nodes)
|
||||
node.visit([&](auto const& slottable) { visitor.visit(slottable); });
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue