1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

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.
This commit is contained in:
MacDue 2022-07-05 11:56:41 +01:00 committed by Linus Groh
parent 753844ec96
commit 3294753d6c
2 changed files with 3 additions and 8 deletions

View file

@ -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, "", "", "", "" };
}