mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:28:11 +00:00
LibWeb: Support the :root pseudo class
This commit is contained in:
parent
2f29e61203
commit
7bfd24ca76
5 changed files with 22 additions and 0 deletions
|
@ -53,6 +53,7 @@ public:
|
|||
LastChild,
|
||||
OnlyChild,
|
||||
Empty,
|
||||
Root,
|
||||
};
|
||||
PseudoClass pseudo_class { PseudoClass::None };
|
||||
|
||||
|
|
|
@ -75,6 +75,10 @@ bool matches(const Selector::SimpleSelector& component, const Element& element)
|
|||
if (element.first_child_of_type<Element>() || element.first_child_of_type<Text>())
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::Root:
|
||||
if (!element.is_html_element())
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (component.attribute_match_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue