mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibDevTools+LibWebView: Avoid dependence on LibWebView from LibDevTools
Some checks failed
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Has been cancelled
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Has been cancelled
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Has been cancelled
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Push notes / build (push) Has been cancelled
Some checks failed
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Has been cancelled
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Has been cancelled
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Has been cancelled
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Push notes / build (push) Has been cancelled
LibDevTools was implicitly including generated IPC endpoints from LibWebView. This is not a dependency declared in the CMakeLists.txt. So updates to the IPC file might not have caused the endpoint header to be regenerated by the time LibDevTools is compiled, resulting in a build error. This patch removes that implicit dependency entirely.
This commit is contained in:
parent
8ab61843be
commit
0d1ce48071
Notes:
github-actions[bot]
2025-02-27 00:49:24 +00:00
Author: https://github.com/trflynn89
Commit: 0d1ce48071
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3710
4 changed files with 14 additions and 4 deletions
|
@ -108,7 +108,7 @@ void PageStyleActor::inspect_dom_node(StringView node_actor, Callback&& callback
|
||||||
|
|
||||||
devtools().delegate().inspect_dom_node(
|
devtools().delegate().inspect_dom_node(
|
||||||
tab->description(), dom_node->id, dom_node->pseudo_element,
|
tab->description(), dom_node->id, dom_node->pseudo_element,
|
||||||
[weak_self = make_weak_ptr<PageStyleActor>(), block_token = move(block_token), callback = forward<Callback>(callback)](ErrorOr<WebView::ViewImplementation::DOMNodeProperties> properties) mutable {
|
[weak_self = make_weak_ptr<PageStyleActor>(), block_token = move(block_token), callback = forward<Callback>(callback)](ErrorOr<DOMNodeProperties> properties) mutable {
|
||||||
if (properties.is_error()) {
|
if (properties.is_error()) {
|
||||||
dbgln_if(DEVTOOLS_DEBUG, "Unable to inspect DOM node: {}", properties.error());
|
dbgln_if(DEVTOOLS_DEBUG, "Unable to inspect DOM node: {}", properties.error());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -6,11 +6,17 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/JsonObject.h>
|
||||||
#include <AK/NonnullRefPtr.h>
|
#include <AK/NonnullRefPtr.h>
|
||||||
#include <LibDevTools/Actor.h>
|
#include <LibDevTools/Actor.h>
|
||||||
|
|
||||||
namespace DevTools {
|
namespace DevTools {
|
||||||
|
|
||||||
|
struct DOMNodeProperties {
|
||||||
|
JsonObject computed_style;
|
||||||
|
JsonObject node_box_sizing;
|
||||||
|
};
|
||||||
|
|
||||||
class PageStyleActor final : public Actor {
|
class PageStyleActor final : public Actor {
|
||||||
public:
|
public:
|
||||||
static constexpr auto base_name = "page-style"sv;
|
static constexpr auto base_name = "page-style"sv;
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
#include <AK/JsonValue.h>
|
#include <AK/JsonValue.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibDevTools/Actors/CSSPropertiesActor.h>
|
#include <LibDevTools/Actors/CSSPropertiesActor.h>
|
||||||
|
#include <LibDevTools/Actors/PageStyleActor.h>
|
||||||
#include <LibDevTools/Actors/TabActor.h>
|
#include <LibDevTools/Actors/TabActor.h>
|
||||||
#include <LibDevTools/Forward.h>
|
#include <LibDevTools/Forward.h>
|
||||||
#include <LibWeb/CSS/Selector.h>
|
#include <LibWeb/CSS/Selector.h>
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
#include <LibWebView/ViewImplementation.h>
|
|
||||||
|
|
||||||
namespace DevTools {
|
namespace DevTools {
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public:
|
||||||
using OnTabInspectionComplete = Function<void(ErrorOr<JsonValue>)>;
|
using OnTabInspectionComplete = Function<void(ErrorOr<JsonValue>)>;
|
||||||
virtual void inspect_tab(TabDescription const&, OnTabInspectionComplete) const { }
|
virtual void inspect_tab(TabDescription const&, OnTabInspectionComplete) const { }
|
||||||
|
|
||||||
using OnDOMNodeInspectionComplete = Function<void(ErrorOr<WebView::ViewImplementation::DOMNodeProperties>)>;
|
using OnDOMNodeInspectionComplete = Function<void(ErrorOr<DOMNodeProperties>)>;
|
||||||
virtual void inspect_dom_node(TabDescription const&, Web::UniqueNodeID, Optional<Web::CSS::Selector::PseudoElement::Type>, OnDOMNodeInspectionComplete) const { }
|
virtual void inspect_dom_node(TabDescription const&, Web::UniqueNodeID, Optional<Web::CSS::Selector::PseudoElement::Type>, OnDOMNodeInspectionComplete) const { }
|
||||||
virtual void clear_inspected_dom_node(TabDescription const&) const { }
|
virtual void clear_inspected_dom_node(TabDescription const&) const { }
|
||||||
|
|
||||||
|
|
|
@ -389,7 +389,11 @@ void Application::inspect_dom_node(DevTools::TabDescription const& description,
|
||||||
|
|
||||||
view->on_received_dom_node_properties = [&view = *view, on_complete = move(on_complete)](ViewImplementation::DOMNodeProperties properties) {
|
view->on_received_dom_node_properties = [&view = *view, on_complete = move(on_complete)](ViewImplementation::DOMNodeProperties properties) {
|
||||||
view.on_received_dom_node_properties = nullptr;
|
view.on_received_dom_node_properties = nullptr;
|
||||||
on_complete(move(properties));
|
|
||||||
|
on_complete(DevTools::DOMNodeProperties {
|
||||||
|
.computed_style = move(properties.computed_style),
|
||||||
|
.node_box_sizing = move(properties.node_box_sizing),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
view->inspect_dom_node(node_id, pseudo_element);
|
view->inspect_dom_node(node_id, pseudo_element);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue