From 99ecc216d75e526a86bc860df62a0a1870af3e94 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 5 Aug 2022 00:16:35 +0200 Subject: [PATCH] LibWeb: Show iframe URLs in layout tree dumps --- Userland/Libraries/LibWeb/Dump.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Userland/Libraries/LibWeb/Dump.cpp b/Userland/Libraries/LibWeb/Dump.cpp index 520c0cf9d9..7b2d642c2b 100644 --- a/Userland/Libraries/LibWeb/Dump.cpp +++ b/Userland/Libraries/LibWeb/Dump.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -226,6 +227,15 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho builder.appendff(" children: {}", box.children_are_inline() ? "inline" : "not-inline"); + if (is(box)) { + auto const& frame_box = static_cast(box); + if (auto* nested_browsing_context = frame_box.dom_node().nested_browsing_context()) { + if (auto* document = nested_browsing_context->active_document()) { + builder.appendff(" (url: {})", document->url()); + } + } + } + builder.append("\n"sv); }