1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 11:55:08 +00:00

LibHTML: Finish the block width calculation

Also add horizontal box values to the layout tree dump.
This commit is contained in:
Andreas Kling 2019-08-18 08:09:56 +02:00
parent 587ddc5126
commit 70eca3b500
4 changed files with 78 additions and 15 deletions

View file

@ -58,8 +58,20 @@ void dump_tree(const LayoutNode& layout_node)
layout_node.rect().y(),
layout_node.rect().width(),
layout_node.rect().height());
// Dump the horizontal box properties
printf(" [%d+%d+%d %d %d+%d+%d]",
layout_node.style().margin().left.to_px(),
layout_node.style().border().left.to_px(),
layout_node.style().padding().left.to_px(),
layout_node.rect().width(),
layout_node.style().margin().right.to_px(),
layout_node.style().border().right.to_px(),
layout_node.style().padding().right.to_px());
if (layout_node.is_text())
printf(" \"%s\"", static_cast<const LayoutText&>(layout_node).text().characters());
printf("\n");
++indent;
layout_node.for_each_child([](auto& child) {