diff options
-rw-r--r-- | Userland/Applications/Browser/BrowserWindow.cpp | 5 | ||||
-rw-r--r-- | Userland/Services/WebContent/ClientConnection.cpp | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index 99607fb094..ba84ef87d9 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -289,6 +289,11 @@ void BrowserWindow::build_menus() }, this)); debug_menu.add_action(GUI::Action::create( + "Dump &Stacking Context Tree", [this](auto&) { + active_tab().m_web_content_view->debug_request("dump-stacking-context-tree"); + }, + this)); + debug_menu.add_action(GUI::Action::create( "Dump &Style Sheets", [this](auto&) { active_tab().m_web_content_view->debug_request("dump-style-sheets"); }, diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index 75dd46a519..33bc6be0de 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -183,6 +183,15 @@ void ClientConnection::debug_request(const String& request, const String& argume } } + if (request == "dump-stacking-context-tree") { + if (auto* doc = page().top_level_browsing_context().active_document()) { + if (auto* icb = doc->layout_node()) { + if (auto* stacking_context = icb->stacking_context()) + stacking_context->dump(); + } + } + } + if (request == "dump-style-sheets") { if (auto* doc = page().top_level_browsing_context().active_document()) { for (auto& sheet : doc->style_sheets().sheets()) { |