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

LibWeb: Move CSS selector-serialization code to Selector.{h,cpp}

Also, renamed `builder` to `s` to match spec comments, and fixed a
find-and-replace typo where some pseudo-class names were
"last-of-pseudo_class" instead of "last-of-type".
This commit is contained in:
Sam Atkins 2021-10-15 11:30:01 +01:00 committed by Linus Groh
parent 75c9313d7d
commit ec51b40a4f
3 changed files with 261 additions and 255 deletions

View file

@ -102,6 +102,8 @@ public:
String value {};
};
Attribute attribute {};
String serialize() const;
};
enum class Combinator {
@ -130,6 +132,7 @@ public:
Vector<CompoundSelector> const& compound_selectors() const { return m_compound_selectors; }
u32 specificity() const;
String serialize() const;
private:
explicit Selector(Vector<CompoundSelector>&&);
@ -137,4 +140,9 @@ private:
Vector<CompoundSelector> m_compound_selectors;
};
constexpr StringView pseudo_element_name(Selector::SimpleSelector::PseudoElement);
constexpr StringView pseudo_class_name(Selector::SimpleSelector::PseudoClass::Type);
String serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const& selectors);
}