mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 06:29:43 +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
|
@ -113,9 +113,9 @@ static void run_focus_update_steps(Vector<GC::Root<DOM::Node>> old_chain, Vector
|
|||
// 1. If entry is a focusable area: designate entry as the focused area of the document.
|
||||
// FIXME: This isn't entirely right.
|
||||
if (is<DOM::Element>(*entry))
|
||||
entry->document().set_focused_element(&static_cast<DOM::Element&>(*entry));
|
||||
entry->document().set_focused_area(*entry);
|
||||
else if (is<DOM::Document>(*entry))
|
||||
entry->document().set_focused_element(static_cast<DOM::Document&>(*entry).document_element());
|
||||
entry->document().set_focused_area(static_cast<DOM::Document&>(*entry).document_element());
|
||||
|
||||
GC::Ptr<DOM::EventTarget> focus_event_target;
|
||||
if (is<DOM::Element>(*entry)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue