mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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
45
Libraries/LibDevTools/Actors/LayoutInspectorActor.cpp
Normal file
45
Libraries/LibDevTools/Actors/LayoutInspectorActor.cpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <LibDevTools/Actors/LayoutInspectorActor.h>
|
||||
|
||||
namespace DevTools {
|
||||
|
||||
NonnullRefPtr<LayoutInspectorActor> LayoutInspectorActor::create(DevToolsServer& devtools, String name)
|
||||
{
|
||||
return adopt_ref(*new LayoutInspectorActor(devtools, move(name)));
|
||||
}
|
||||
|
||||
LayoutInspectorActor::LayoutInspectorActor(DevToolsServer& devtools, String name)
|
||||
: Actor(devtools, move(name))
|
||||
{
|
||||
}
|
||||
|
||||
LayoutInspectorActor::~LayoutInspectorActor() = default;
|
||||
|
||||
void LayoutInspectorActor::handle_message(StringView type, JsonObject const&)
|
||||
{
|
||||
JsonObject response;
|
||||
response.set("from"sv, name());
|
||||
|
||||
if (type == "getCurrentFlexbox"sv) {
|
||||
response.set("flexbox"sv, JsonValue {});
|
||||
send_message(move(response));
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == "getGrids"sv) {
|
||||
response.set("grids"sv, JsonArray {});
|
||||
send_message(move(response));
|
||||
return;
|
||||
}
|
||||
|
||||
send_unrecognized_packet_type_error(type);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue