mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibDevTools+LibWebView+WebContent: Selectively fetch DOM node properties
When we inspect a DOM node, we currently serialize many properties for that node, including its layout, computed style, used fonts, etc. Now that we aren't piggy-backing on the Inspector interface, we can instead only serialize the specific information required by DevTools.
This commit is contained in:
parent
19529590b9
commit
daca9f5995
Notes:
github-actions[bot]
2025-03-20 08:02:26 +00:00
Author: https://github.com/trflynn89
Commit: daca9f5995
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4006
Reviewed-by: https://github.com/gmta ✅
18 changed files with 287 additions and 276 deletions
|
@ -6,19 +6,12 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibDevTools/Actor.h>
|
||||
#include <LibWebView/DOMNodeProperties.h>
|
||||
|
||||
namespace DevTools {
|
||||
|
||||
struct DOMNodeProperties {
|
||||
JsonObject computed_style;
|
||||
JsonObject node_box_sizing;
|
||||
JsonArray fonts;
|
||||
};
|
||||
|
||||
class PageStyleActor final : public Actor {
|
||||
public:
|
||||
static constexpr auto base_name = "page-style"sv;
|
||||
|
@ -33,10 +26,12 @@ private:
|
|||
|
||||
virtual void handle_message(Message const&) override;
|
||||
|
||||
template<typename Callback>
|
||||
void inspect_dom_node(Message const&, StringView node_actor, Callback&&);
|
||||
void inspect_dom_node(Message const&, WebView::DOMNodeProperties::Type);
|
||||
void received_dom_node_properties(WebView::DOMNodeProperties const&);
|
||||
|
||||
WeakPtr<InspectorActor> m_inspector;
|
||||
|
||||
Vector<Message, 1> m_pending_inspect_requests;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue