mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Support the :first-of-type CSS selector :^)
This commit is contained in:
parent
4f690408af
commit
0eb9a9dd13
Notes:
sideshowbarker
2024-07-18 20:44:00 +09:00
Author: https://github.com/awesomekling
Commit: 0eb9a9dd13
6 changed files with 26 additions and 0 deletions
|
@ -90,6 +90,12 @@ static bool matches(const CSS::Selector::SimpleSelector& component, const DOM::E
|
|||
if (!is<HTML::HTMLElement>(element))
|
||||
return false;
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::PseudoClass::FirstOfType:
|
||||
for (auto* sibling = element.previous_element_sibling(); sibling; sibling = sibling->previous_element_sibling()) {
|
||||
if (sibling->tag_name() == element.tag_name())
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (component.attribute_match_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue