mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibWeb/CSS: Move and rename PseudoElement types to prep for code gen
The upcoming generated types will match those for pseudo-classes: A PseudoElementSelector type, that then holds a PseudoElement enum defining what it is. That enum will be at the top level in the Web::CSS namespace. In order to keep the diffs clearer, this commit renames and moves the types, and then a following one will replace the handwritten enum with a generated one.
This commit is contained in:
parent
b11064c0ae
commit
0ed2e71801
Notes:
github-actions[bot]
2025-03-24 09:51:36 +00:00
Author: https://github.com/AtkinsSJ
Commit: 0ed2e71801
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4021
42 changed files with 270 additions and 271 deletions
|
@ -66,9 +66,9 @@ NodeIdentifier NodeIdentifier::for_node(JsonObject const& node)
|
|||
{
|
||||
NodeIdentifier identifier;
|
||||
|
||||
identifier.pseudo_element = node.get_integer<UnderlyingType<Web::CSS::Selector::PseudoElement::Type>>("pseudo-element"sv).map([](auto value) {
|
||||
VERIFY(value < to_underlying(Web::CSS::Selector::PseudoElement::Type::KnownPseudoElementCount));
|
||||
return static_cast<Web::CSS::Selector::PseudoElement::Type>(value);
|
||||
identifier.pseudo_element = node.get_integer<UnderlyingType<Web::CSS::PseudoElement>>("pseudo-element"sv).map([](auto value) {
|
||||
VERIFY(value < to_underlying(Web::CSS::PseudoElement::KnownPseudoElementCount));
|
||||
return static_cast<Web::CSS::PseudoElement>(value);
|
||||
});
|
||||
|
||||
if (identifier.pseudo_element.has_value())
|
||||
|
|
|
@ -21,7 +21,7 @@ struct NodeIdentifier {
|
|||
bool operator==(NodeIdentifier const&) const = default;
|
||||
|
||||
Web::UniqueNodeID id { 0 };
|
||||
Optional<Web::CSS::Selector::PseudoElement::Type> pseudo_element;
|
||||
Optional<Web::CSS::PseudoElement> pseudo_element;
|
||||
};
|
||||
|
||||
class NodeActor final : public Actor {
|
||||
|
@ -55,7 +55,7 @@ struct AK::Traits<DevTools::NodeIdentifier> : public AK::DefaultTraits<DevTools:
|
|||
|
||||
static unsigned hash(DevTools::NodeIdentifier const& node_identifier)
|
||||
{
|
||||
auto pseudo_element = node_identifier.pseudo_element.value_or(Web::CSS::Selector::PseudoElement::Type::KnownPseudoElementCount);
|
||||
auto pseudo_element = node_identifier.pseudo_element.value_or(Web::CSS::PseudoElement::KnownPseudoElementCount);
|
||||
return pair_int_hash(node_identifier.id.value(), to_underlying(pseudo_element));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -35,10 +35,10 @@ public:
|
|||
using OnDOMNodePropertiesReceived = Function<void(WebView::DOMNodeProperties)>;
|
||||
virtual void listen_for_dom_properties(TabDescription const&, OnDOMNodePropertiesReceived) const { }
|
||||
virtual void stop_listening_for_dom_properties(TabDescription const&) const { }
|
||||
virtual void inspect_dom_node(TabDescription const&, WebView::DOMNodeProperties::Type, Web::UniqueNodeID, Optional<Web::CSS::Selector::PseudoElement::Type>) const { }
|
||||
virtual void inspect_dom_node(TabDescription const&, WebView::DOMNodeProperties::Type, Web::UniqueNodeID, Optional<Web::CSS::PseudoElement>) const { }
|
||||
virtual void clear_inspected_dom_node(TabDescription const&) const { }
|
||||
|
||||
virtual void highlight_dom_node(TabDescription const&, Web::UniqueNodeID, Optional<Web::CSS::Selector::PseudoElement::Type>) const { }
|
||||
virtual void highlight_dom_node(TabDescription const&, Web::UniqueNodeID, Optional<Web::CSS::PseudoElement>) const { }
|
||||
virtual void clear_highlighted_dom_node(TabDescription const&) const { }
|
||||
|
||||
using OnDOMMutationReceived = Function<void(WebView::Mutation)>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue