mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Implement basic focus indication for :focus-visible
This causes links to no longer show an outline when clicked; only when using keyboard navigation with the tab key will the outline show up.
This commit is contained in:
parent
66813aea79
commit
15c436b332
Notes:
github-actions[bot]
2025-06-13 15:40:20 +00:00
Author: https://github.com/gmta
Commit: 15c436b332
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5074
3 changed files with 39 additions and 2 deletions
|
@ -549,8 +549,7 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
|
|||
case CSS::PseudoClass::Focus:
|
||||
return element.is_focused();
|
||||
case CSS::PseudoClass::FocusVisible:
|
||||
// FIXME: We should only apply this when a visible focus is useful. Decide when that is!
|
||||
return element.is_focused();
|
||||
return element.is_focused() && element.should_indicate_focus();
|
||||
case CSS::PseudoClass::FocusWithin: {
|
||||
auto* focused_element = element.document().focused_element();
|
||||
return focused_element && element.is_inclusive_ancestor_of(*focused_element);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue