mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Make Painting::Box virtual and add Painting::BoxWithLines
BlockContainer paint boxes are the only ones that have line boxes associated, so let's not waste memory on line boxes in all the other types of boxes. This also adds Layout::Box::paint_box() and the more tightly typed Layout::BlockContainer::paint_box() to get at the paint box from the corresponding layout box.
This commit is contained in:
@@ -226,8 +226,8 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||
|
||||
if (is<Layout::BlockContainer>(layout_node) && static_cast<Layout::BlockContainer const&>(layout_node).children_are_inline()) {
|
||||
auto& block = static_cast<Layout::BlockContainer const&>(layout_node);
|
||||
for (size_t line_box_index = 0; line_box_index < block.m_paint_box->line_boxes().size(); ++line_box_index) {
|
||||
auto& line_box = block.m_paint_box->line_boxes()[line_box_index];
|
||||
for (size_t line_box_index = 0; line_box_index < block.paint_box()->line_boxes().size(); ++line_box_index) {
|
||||
auto& line_box = block.paint_box()->line_boxes()[line_box_index];
|
||||
for (size_t i = 0; i < indent; ++i)
|
||||
builder.append(" ");
|
||||
builder.appendff(" {}line {}{} width: {}, bottom: {}, baseline: {}\n",
|
||||
|
||||
Reference in New Issue
Block a user