Sfoglia il codice sorgente

LibWeb: Make stacking context tree dumps more readable

Include the Layout::Node::debug_description() and the z-index.
Andreas Kling 3 anni fa
parent
commit
219e3b9235
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      Userland/Libraries/LibWeb/Painting/StackingContext.cpp

+ 6 - 1
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);