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:
Sam Atkins 2025-03-20 16:56:46 +00:00
commit eb1ad8655e
42 changed files with 270 additions and 271 deletions

View file

@ -1685,7 +1685,7 @@ void Document::set_inspected_node(GC::Ptr<Node> node)
m_inspected_node = node;
}
void Document::set_highlighted_node(GC::Ptr<Node> node, Optional<CSS::Selector::PseudoElement::Type> pseudo_element)
void Document::set_highlighted_node(GC::Ptr<Node> node, Optional<CSS::PseudoElement> pseudo_element)
{
if (m_highlighted_node == node && m_highlighted_pseudo_element == pseudo_element)
return;
@ -1797,12 +1797,12 @@ void Document::invalidate_style_for_elements_affected_by_hover_change(Node& old_
SelectorEngine::MatchContext context;
if (SelectorEngine::matches(selector, element, {}, context, {}))
return true;
if (element.has_pseudo_element(CSS::Selector::PseudoElement::Type::Before)) {
if (SelectorEngine::matches(selector, element, {}, context, CSS::Selector::PseudoElement::Type::Before))
if (element.has_pseudo_element(CSS::PseudoElement::Before)) {
if (SelectorEngine::matches(selector, element, {}, context, CSS::PseudoElement::Before))
return true;
}
if (element.has_pseudo_element(CSS::Selector::PseudoElement::Type::After)) {
if (SelectorEngine::matches(selector, element, {}, context, CSS::Selector::PseudoElement::Type::After))
if (element.has_pseudo_element(CSS::PseudoElement::After)) {
if (SelectorEngine::matches(selector, element, {}, context, CSS::PseudoElement::After))
return true;
}
return false;