mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
LibWeb: Perform layout of a slot's assigned nodes
This commit is contained in:
parent
e4d3a9aa68
commit
bdf2323b3f
1 changed files with 14 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <LibWeb/HTML/HTMLButtonElement.h>
|
||||
#include <LibWeb/HTML/HTMLInputElement.h>
|
||||
#include <LibWeb/HTML/HTMLProgressElement.h>
|
||||
#include <LibWeb/HTML/HTMLSlotElement.h>
|
||||
#include <LibWeb/Layout/ListItemBox.h>
|
||||
#include <LibWeb/Layout/ListItemMarkerBox.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
|
@ -342,6 +343,19 @@ ErrorOr<void> TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::
|
|||
layout_node->append_child(*list_item_marker);
|
||||
}
|
||||
|
||||
if (is<HTML::HTMLSlotElement>(dom_node)) {
|
||||
auto slottables = static_cast<HTML::HTMLSlotElement&>(dom_node).assigned_nodes_internal();
|
||||
push_parent(verify_cast<NodeWithStyle>(*layout_node));
|
||||
|
||||
for (auto const& slottable : slottables) {
|
||||
TRY(slottable.visit([&](auto& node) -> ErrorOr<void> {
|
||||
return create_layout_tree(node, context);
|
||||
}));
|
||||
}
|
||||
|
||||
pop_parent();
|
||||
}
|
||||
|
||||
if (is<HTML::HTMLProgressElement>(dom_node)) {
|
||||
auto& progress = static_cast<HTML::HTMLProgressElement&>(dom_node);
|
||||
if (!progress.using_system_appearance()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue