From 219e3b9235e68ead87ebd19ab974853e1d3baf12 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 4 Mar 2022 15:03:48 +0100 Subject: [PATCH] LibWeb: Make stacking context tree dumps more readable Include the Layout::Node::debug_description() and the z-index. --- Userland/Libraries/LibWeb/Painting/StackingContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp index 8c667869e2..d4a824614d 100644 --- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp +++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp @@ -230,7 +230,12 @@ void StackingContext::dump(int indent) const StringBuilder builder; for (int i = 0; i < indent; ++i) builder.append(' '); - builder.appendff("SC for {}({}) {} [children: {}]", m_box.class_name(), m_box.dom_node() ? m_box.dom_node()->node_name().characters() : "(anonymous)", m_box.absolute_rect().to_string().characters(), m_children.size()); + builder.appendff("SC for {} {} [children: {}] (z-index: ", m_box.debug_description(), m_box.absolute_rect(), m_children.size()); + if (m_box.computed_values().z_index().has_value()) + builder.appendff("{}", m_box.computed_values().z_index().value()); + else + builder.append("auto"); + builder.append(')'); dbgln("{}", builder.string_view()); for (auto& child : m_children) child->dump(indent + 1);