LibWeb/CSS: Parse the ::slotted pseudo-element

This commit is contained in:
Shannon Booth 2025-07-12 16:15:06 +12:00 committed by Sam Atkins
commit 9054ff29f0
Notes: github-actions[bot] 2025-07-15 12:55:25 +00:00
10 changed files with 141 additions and 21 deletions

View file

@ -31,7 +31,7 @@ public:
FlyString value {};
};
using Value = Variant<Empty, PTNameSelector>;
using Value = Variant<Empty, PTNameSelector, NonnullRefPtr<Selector>>;
explicit PseudoElementSelector(PseudoElement type, Value value = {})
: m_type(type)
@ -60,10 +60,13 @@ public:
PTNameSelector const& pt_name_selector() const { return m_value.get<PTNameSelector>(); }
// NOTE: This can't (currently) be a CompoundSelector due to cyclic dependencies.
Selector const& compound_selector() const { return m_value.get<NonnullRefPtr<Selector>>(); }
private:
PseudoElement m_type;
String m_name;
Variant<Empty, PTNameSelector> m_value;
Value m_value;
};
struct SimpleSelector {