mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibWeb: Support inserting non-inline elements into inline elements
Our layout tree requires that all containers either have inline or non-inline children. In order to support the layout of non-inline elements inside inline elements, we need to do a bit of tree restructuring. It effectively simulates temporarily closing all inline nodes, appending the block element, and resumes appending to the last open inline node. The acid1.txt expectation needed to be updated to reflect the fact that we now hoist its <p> elements out of the inline <form> they were in. Visually, the before and after situations for acid1.html are identical.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
7eb4f3da37
commit
336684bc5c
@@ -210,7 +210,6 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||
nonbox_color_on,
|
||||
identifier,
|
||||
color_off);
|
||||
builder.append("\n"sv);
|
||||
} else {
|
||||
auto& box = as<Layout::Box>(layout_node);
|
||||
StringView color_on = is<Layout::SVGBox>(box) ? svg_box_color_on : box_color_on;
|
||||
@@ -334,10 +333,14 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
builder.append("\n"sv);
|
||||
}
|
||||
|
||||
if (is<Layout::NodeWithStyleAndBoxModelMetrics>(layout_node)
|
||||
&& static_cast<Layout::NodeWithStyleAndBoxModelMetrics const&>(layout_node).continuation_of_node())
|
||||
builder.append(" continuation"sv);
|
||||
|
||||
builder.append("\n"sv);
|
||||
|
||||
if (layout_node.dom_node() && is<HTML::HTMLImageElement>(*layout_node.dom_node())) {
|
||||
if (auto image_data = static_cast<HTML::HTMLImageElement const&>(*layout_node.dom_node()).current_request().image_data()) {
|
||||
if (is<SVG::SVGDecodedImageData>(*image_data)) {
|
||||
|
||||
Reference in New Issue
Block a user