1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09: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:
Sam Atkins 2021-07-12 16:34:18 +01:00 committed by Andreas Kling
parent 4af7d41879
commit 8cae79cc8d
Notes: sideshowbarker 2024-07-18 09:04:18 +09:00
4 changed files with 66 additions and 12 deletions

View file

@ -175,14 +175,6 @@ static bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoClass cons
static bool matches(CSS::Selector::SimpleSelector const& component, DOM::Element const& element)
{
switch (component.pseudo_element) {
case CSS::Selector::SimpleSelector::PseudoElement::None:
break;
default:
// FIXME: Implement pseudo-elements.
return false;
}
switch (component.type) {
case CSS::Selector::SimpleSelector::Type::Universal:
return true;
@ -196,6 +188,9 @@ static bool matches(CSS::Selector::SimpleSelector const& component, DOM::Element
return matches_attribute(component.attribute, element);
case CSS::Selector::SimpleSelector::Type::PseudoClass:
return matches_pseudo_class(component.pseudo_class, element);
case CSS::Selector::SimpleSelector::Type::PseudoElement:
// FIXME: Implement pseudo-elements.
return false;
default:
VERIFY_NOT_REACHED();
}