mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibDevTools: Stub out a layout inspector actor
The DevTools client will ask for this actor before trying to render any box model or computed style information. We can just stub out this actor for now.
This commit is contained in:
parent
c56bf8ac93
commit
3f8b65e45c
Notes:
github-actions[bot]
2025-02-24 17:06:47 +00:00
Author: https://github.com/trflynn89
Commit: 3f8b65e45c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3666
Reviewed-by: https://github.com/AtkinsSJ
6 changed files with 89 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/StringUtils.h>
|
||||
#include <LibDevTools/Actors/LayoutInspectorActor.h>
|
||||
#include <LibDevTools/Actors/NodeActor.h>
|
||||
#include <LibDevTools/Actors/TabActor.h>
|
||||
#include <LibDevTools/Actors/WalkerActor.h>
|
||||
|
@ -59,6 +60,18 @@ void WalkerActor::handle_message(StringView type, JsonObject const& message)
|
|||
return;
|
||||
}
|
||||
|
||||
if (type == "getLayoutInspector"sv) {
|
||||
if (!m_layout_inspector)
|
||||
m_layout_inspector = devtools().register_actor<LayoutInspectorActor>();
|
||||
|
||||
JsonObject actor;
|
||||
actor.set("actor"sv, m_layout_inspector->name());
|
||||
|
||||
response.set("actor"sv, move(actor));
|
||||
send_message(move(response));
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "querySelector"sv) {
|
||||
auto node = message.get_string("node"sv);
|
||||
if (!node.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue