mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWeb+WebContent: Rename Document::focused_element to ::focused_area
And make it a DOM::Node, not DOM::Element. This makes everything flow much better, such as spec texts that explicitly mention "focused area" as the fact that we don't necessarily need to traverse a tree of elements, since a Node can be focusable as well. Eventually this will need to be a struct with a separate "focused area" and "DOM anchor", but this change will make it easier to achieve that.
This commit is contained in:
parent
90f1c8724b
commit
518c048eb4
Notes:
github-actions[bot]
2025-08-26 08:27:18 +00:00
Author: https://github.com/gmta
Commit: 518c048eb4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5952
11 changed files with 92 additions and 91 deletions
|
@ -552,8 +552,8 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
|
|||
case CSS::PseudoClass::FocusVisible:
|
||||
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);
|
||||
auto focused_area = element.document().focused_area();
|
||||
return focused_area && element.is_inclusive_ancestor_of(*focused_area);
|
||||
}
|
||||
case CSS::PseudoClass::FirstChild:
|
||||
if (context.collect_per_element_selector_involvement_metadata) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue