mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-12 20:11:51 +00:00
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.
37 lines
937 B
C++
37 lines
937 B
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <LibDevTools/Actor.h>
|
|
#include <LibWebView/DOMNodeProperties.h>
|
|
|
|
namespace DevTools {
|
|
|
|
class PageStyleActor final : public Actor {
|
|
public:
|
|
static constexpr auto base_name = "page-style"sv;
|
|
|
|
static NonnullRefPtr<PageStyleActor> create(DevToolsServer&, String name, WeakPtr<InspectorActor>);
|
|
virtual ~PageStyleActor() override;
|
|
|
|
JsonValue serialize_style() const;
|
|
|
|
private:
|
|
PageStyleActor(DevToolsServer&, String name, WeakPtr<InspectorActor>);
|
|
|
|
virtual void handle_message(Message const&) override;
|
|
|
|
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;
|
|
};
|
|
|
|
}
|