mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibWeb: Add 'PseudoElement' as a CSS SimpleSelector::Type
Same reasoning again! This is the last one. While I was at it, I added the two remaining CSS2.2 pseudo-elements, ::first-line and ::first-letter. All 4 are handled in the new CSS parser, including with the compatibility single-colon syntax. I have not added support to the old parser.
This commit is contained in:
parent
4af7d41879
commit
8cae79cc8d
4 changed files with 66 additions and 12 deletions
|
@ -320,6 +320,9 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector)
|
|||
case CSS::Selector::SimpleSelector::Type::PseudoClass:
|
||||
type_description = "PseudoClass";
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Type::PseudoElement:
|
||||
type_description = "PseudoElement";
|
||||
break;
|
||||
}
|
||||
|
||||
builder.appendff("{}:{}", type_description, simple_selector.value);
|
||||
|
@ -397,6 +400,29 @@ void dump_selector(StringBuilder& builder, CSS::Selector const& selector)
|
|||
}
|
||||
}
|
||||
|
||||
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoElement) {
|
||||
char const* pseudo_element_description = "";
|
||||
switch (simple_selector.pseudo_element) {
|
||||
case CSS::Selector::SimpleSelector::PseudoElement::None:
|
||||
pseudo_element_description = "None";
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::PseudoElement::Before:
|
||||
pseudo_element_description = "before";
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::PseudoElement::After:
|
||||
pseudo_element_description = "after";
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::PseudoElement::FirstLine:
|
||||
pseudo_element_description = "first-line";
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::PseudoElement::FirstLetter:
|
||||
pseudo_element_description = "first-letter";
|
||||
break;
|
||||
}
|
||||
|
||||
builder.appendff(" pseudo_element={}", pseudo_element_description);
|
||||
}
|
||||
|
||||
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::Attribute) {
|
||||
char const* attribute_match_type_description = "";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue