mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
UI+WebContent: Add menu option to dump display list
This commit is contained in:
parent
8ae7417445
commit
f65db4507a
Notes:
github-actions[bot]
2025-07-13 17:16:11 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: f65db4507a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5390
Reviewed-by: https://github.com/gmta ✅
4 changed files with 23 additions and 0 deletions
|
@ -253,6 +253,14 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString request, ByteSt
|
|||
Web::dump_tree(*traversable);
|
||||
}
|
||||
|
||||
if (request == "dump-display-list") {
|
||||
if (auto* doc = page->page().top_level_browsing_context().active_document()) {
|
||||
auto display_list_dump = doc->dump_display_list();
|
||||
dbgln("{}", display_list_dump);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (request == "dump-dom-tree") {
|
||||
if (auto* doc = page->page().top_level_browsing_context().active_document())
|
||||
Web::dump_tree(*doc);
|
||||
|
|
|
@ -640,6 +640,9 @@
|
|||
[submenu addItem:[[NSMenuItem alloc] initWithTitle:@"Dump Stacking Context Tree"
|
||||
action:@selector(dumpStackingContextTree:)
|
||||
keyEquivalent:@""]];
|
||||
[submenu addItem:[[NSMenuItem alloc] initWithTitle:@"Dump Display List"
|
||||
action:@selector(dumpDisplayList:)
|
||||
keyEquivalent:@""]];
|
||||
[submenu addItem:[[NSMenuItem alloc] initWithTitle:@"Dump Style Sheets"
|
||||
action:@selector(dumpStyleSheets:)
|
||||
keyEquivalent:@""]];
|
||||
|
|
|
@ -346,6 +346,11 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
|||
[self debugRequest:"dump-dom-tree" argument:""];
|
||||
}
|
||||
|
||||
- (void)dumpDisplayList:(id)sender
|
||||
{
|
||||
[self debugRequest:"dump-display-list" argument:""];
|
||||
}
|
||||
|
||||
- (void)dumpLayoutTree:(id)sender
|
||||
{
|
||||
[self debugRequest:"dump-layout-tree" argument:""];
|
||||
|
|
|
@ -402,6 +402,13 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
|
|||
debug_request("dump-stacking-context-tree");
|
||||
});
|
||||
|
||||
auto* dump_display_list = new QAction("Dump Display List", this);
|
||||
dump_display_list->setIcon(load_icon_from_uri("resource://icons/16x16/layout.png"sv));
|
||||
debug_menu->addAction(dump_display_list);
|
||||
QObject::connect(dump_display_list, &QAction::triggered, this, [this] {
|
||||
debug_request("dump-display-list");
|
||||
});
|
||||
|
||||
auto* dump_style_sheets_action = new QAction("Dump &Style Sheets", this);
|
||||
dump_style_sheets_action->setIcon(load_icon_from_uri("resource://icons/16x16/filetype-css.png"sv));
|
||||
debug_menu->addAction(dump_style_sheets_action);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue