From 6fc189ea4a976d5689cedf21eb0f49ec04cde974 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 27 Nov 2023 15:53:47 -0500 Subject: [PATCH] LibWebView: Generalize the generated Inspector for another tab container The Inspector will have a split view, where the top view is that of the exisiting DOM and accessibility trees, and the bottom view is that of the currently inspected node's style properties. This patch generalizes some of the generated code to support having these 2 views. --- .../Libraries/LibWebView/InspectorClient.cpp | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/Userland/Libraries/LibWebView/InspectorClient.cpp b/Userland/Libraries/LibWebView/InspectorClient.cpp index 6afdf0696b..d3873cb302 100644 --- a/Userland/Libraries/LibWebView/InspectorClient.cpp +++ b/Userland/Libraries/LibWebView/InspectorClient.cpp @@ -139,11 +139,14 @@ void InspectorClient::maybe_load_inspector() builder.append(R"~~~( body { + font-family: system-ui, sans-serif; + font-size: 10pt; + margin: 0; } .tab-controls-container { - position: fixed; + position: absolute; width: 100%; top: 0; @@ -164,7 +167,6 @@ void InspectorClient::maybe_load_inspector() .tab-controls button { font-size: 12px; font-weight: 600; - font-family: system-ui, sans-serif; float: left; border: none; @@ -182,16 +184,14 @@ void InspectorClient::maybe_load_inspector() border-radius: 0 0.5rem 0.5rem 0; } - .tab-content-container { - margin-top: 30px; - } - .tab-content { + height: 100%; + display: none; border-radius: 0.5rem; margin-top: 30px; - padding: 6px 12px 6px 12px; + padding: 8px; } @media (prefers-color-scheme: dark) { @@ -274,38 +274,36 @@ void InspectorClient::maybe_load_inspector()
- - + +
-
-
+
)~~~"sv); generate_dom_tree(builder); builder.append(R"~~~( -
-
+
+
)~~~"sv); generate_accessibility_tree(builder); builder.append(R"~~~( -