diff options
author | MacDue <macdue@dueutil.tech> | 2022-07-05 11:56:41 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-07-05 13:09:11 +0200 |
commit | 3294753d6c2f228edef4fb20700128f7843c477b (patch) | |
tree | b29aa261f78a3e38c06d2401c35bdb8f4db7b04f /Userland/Services | |
parent | 753844ec9635d4e428253fb3a788b08b6590c5b1 (diff) | |
download | serenity-3294753d6c2f228edef4fb20700128f7843c477b.zip |
Browser+WebContent: Fix inspecting non-visible nodes
I already fixed the crash from this in #14470, but didn't fully fix
the issue. Currently the browser just avoids sending the
inspect_dom_node() IPC call for non-visible nodes.
The main problem with this is it means the browser keeps displaying
the overlay for the previously selected node. This commit fixes
the crash in the WebContent side, so the IPC call can still be made
and the selection correctly updated.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WebContent/ConnectionFromClient.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index f2f483ce1f..449645a3e8 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -267,7 +267,8 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect }); Web::DOM::Node* node = Web::DOM::Node::from_id(node_id); - if (!node) { + // Note: Nodes without layout (aka non-visible nodes, don't have style computed) + if (!node || !node->layout_node()) { return { false, "", "", "", "" }; } |