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:
parent
75c9313d7d
commit
ec51b40a4f
3 changed files with 261 additions and 255 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue