mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWeb: Recognise :focus pseudo-class
It's still only a dummy as LibWeb doesn't have focused elements yet, but at least now we don't treat "selector:focus" as just "selector". This fixes an issue on google.com which was mostly grey - coming from some menu item focus styles :^)
This commit is contained in:
parent
f3cff4c677
commit
055e955a1c
Notes:
sideshowbarker
2024-07-19 06:57:23 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/055e955a1c7 Pull-request: https://github.com/SerenityOS/serenity/pull/2117
3 changed files with 6 additions and 0 deletions
|
@ -48,6 +48,7 @@ public:
|
|||
None,
|
||||
Link,
|
||||
Hover,
|
||||
Focus,
|
||||
FirstChild,
|
||||
LastChild,
|
||||
OnlyChild,
|
||||
|
|
|
@ -56,6 +56,9 @@ bool matches(const Selector::SimpleSelector& component, const Element& element)
|
|||
if (!matches_hover_pseudo_class(element))
|
||||
return false;
|
||||
break;
|
||||
case Selector::SimpleSelector::PseudoClass::Focus:
|
||||
// FIXME: Implement matches_focus_pseudo_class(element)
|
||||
return false;
|
||||
case Selector::SimpleSelector::PseudoClass::FirstChild:
|
||||
if (element.previous_element_sibling())
|
||||
return false;
|
||||
|
|
|
@ -385,6 +385,8 @@ public:
|
|||
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Link;
|
||||
else if (pseudo_name == "hover")
|
||||
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Hover;
|
||||
else if (pseudo_name == "focus")
|
||||
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::Focus;
|
||||
else if (pseudo_name == "first-child")
|
||||
simple_selector.pseudo_class = Selector::SimpleSelector::PseudoClass::FirstChild;
|
||||
else if (pseudo_name == "last-child")
|
||||
|
|
Loading…
Add table
Reference in a new issue