LibWeb: Output display type inline-table in layout dump

This commit is contained in:
Aliaksandr Kalenik 2023-01-16 13:51:49 +01:00 committed by Andreas Kling
parent 276a77f02d
commit 45e85d20b6
Notes: sideshowbarker 2024-07-17 01:35:52 +09:00
3 changed files with 12 additions and 3 deletions

View File

@ -121,7 +121,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
StringView svg_box_color_on = ""sv;
StringView positioned_color_on = ""sv;
StringView floating_color_on = ""sv;
StringView inline_block_color_on = ""sv;
StringView inline_color_on = ""sv;
StringView line_box_color_on = ""sv;
StringView fragment_color_on = ""sv;
StringView flex_color_on = ""sv;
@ -133,7 +133,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
svg_box_color_on = "\033[31m"sv;
positioned_color_on = "\033[31;1m"sv;
floating_color_on = "\033[32;1m"sv;
inline_block_color_on = "\033[36;1m"sv;
inline_color_on = "\033[36;1m"sv;
line_box_color_on = "\033[34;1m"sv;
fragment_color_on = "\033[35;1m"sv;
flex_color_on = "\033[34;1m"sv;
@ -178,7 +178,9 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
if (box.is_floating())
builder.appendff(" {}floating{}", floating_color_on, color_off);
if (box.is_inline_block())
builder.appendff(" {}inline-block{}", inline_block_color_on, color_off);
builder.appendff(" {}inline-block{}", inline_color_on, color_off);
if (box.is_inline_table())
builder.appendff(" {}inline-table{}", inline_color_on, color_off);
if (box.display().is_flex_inside()) {
StringView direction;
switch (box.computed_values().flex_direction()) {

View File

@ -659,6 +659,12 @@ bool Node::is_inline_block() const
return display.is_inline_outside() && display.is_flow_root_inside();
}
bool Node::is_inline_table() const
{
auto display = this->display();
return display.is_inline_outside() && display.is_table_inside();
}
JS::NonnullGCPtr<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const
{
auto wrapper = heap().allocate_without_realm<BlockContainer>(const_cast<DOM::Document&>(document()), nullptr, m_computed_values.clone_inherited_values());

View File

@ -76,6 +76,7 @@ public:
bool is_inline() const;
bool is_inline_block() const;
bool is_inline_table() const;
bool is_out_of_flow(FormattingContext const&) const;