1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:17:35 +00:00

LibWeb: Make pseudo-elements inspectable

This makes it possible to set a pseudo-element as the inspected node
using Document::set_inspected_node(), Document then provides
inspected_layout_node() for the painting related functions.
This commit is contained in:
Simon Wanner 2023-06-02 22:50:11 +02:00 committed by Andreas Kling
parent 5e3e9b2f61
commit ee7282cbe4
6 changed files with 28 additions and 15 deletions

View file

@ -444,7 +444,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect
top_context.for_each_in_inclusive_subtree([&](auto& ctx) {
if (ctx.active_document() != nullptr) {
ctx.active_document()->set_inspected_node(nullptr);
ctx.active_document()->set_inspected_node(nullptr, {});
}
return IterationDecision::Continue;
});
@ -455,8 +455,7 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect
return { false, "", "", "", "" };
}
// FIXME: Pass the pseudo-element here.
node->document().set_inspected_node(node);
node->document().set_inspected_node(node, pseudo_element);
if (node->is_element()) {
auto& element = verify_cast<Web::DOM::Element>(*node);