diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-07-12 16:34:18 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-14 13:31:00 +0200 |
commit | 8cae79cc8de78c510f25a4f86ac4da00f5640590 (patch) | |
tree | aadb26fa32cb8694f86b8d38b6b73bac8d5487f7 /Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | |
parent | 4af7d418795233e9457c12ab4fd674b445d35346 (diff) | |
download | serenity-8cae79cc8de78c510f25a4f86ac4da00f5640590.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 0296aba1d6..f94d8c425d 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -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(); } |