mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
WebContent: Dump style sheets that are inside shadow roots
Also include a header to say what shadow root each style sheet is in, so we can distinguish between them.
This commit is contained in:
parent
957032809b
commit
1849eca503
Notes:
github-actions[bot]
2024-11-13 19:38:28 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/1849eca5032 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2320
1 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
|
@ -325,9 +326,17 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString const& request,
|
|||
|
||||
if (request == "dump-style-sheets") {
|
||||
if (auto* doc = page->page().top_level_browsing_context().active_document()) {
|
||||
dbgln("=== In document: ===");
|
||||
for (auto& sheet : doc->style_sheets().sheets()) {
|
||||
Web::dump_sheet(sheet);
|
||||
}
|
||||
|
||||
doc->for_each_shadow_root([&](auto& shadow_root) {
|
||||
dbgln("=== In shadow root {}: ===", shadow_root.host()->debug_description());
|
||||
shadow_root.for_each_css_style_sheet([&](auto& sheet) {
|
||||
Web::dump_sheet(sheet);
|
||||
});
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue