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

Browser+LibWeb+WebContent: Show style for pseudo-elements :^)

This expands the InspectorWidget::Selection to include an optional
PseudoElement, which is then passed over IPC to request style
information for it.

As noted, this has some pretty big limitations because pseudo-elements
don't have DOM nodes:
- Declared style has to be recalculated when it's requested.
- We don't display the computed style.
- We don't display custom properties.
This commit is contained in:
Sam Atkins 2022-03-04 16:29:05 +00:00 committed by Andreas Kling
parent 2c970b9516
commit 0326ad34df
9 changed files with 69 additions and 20 deletions

View file

@ -9,6 +9,7 @@
#include <AK/URL.h>
#include <LibGUI/AbstractScrollableWidget.h>
#include <LibGUI/Widget.h>
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/WebViewHooks.h>
@ -40,7 +41,7 @@ public:
String custom_properties_json;
String node_box_sizing_json;
};
Optional<DOMNodeProperties> inspect_dom_node(i32 node_id);
Optional<DOMNodeProperties> inspect_dom_node(i32 node_id, Optional<CSS::Selector::PseudoElement>);
void clear_inspected_dom_node();
i32 get_hovered_node_id();