LibWeb: Move event handling & cursor from BrowsingContext to Navigable

This was a long standing FIXME since the introduction of navigables.
This commit is contained in:
Andreas Kling
2024-04-26 16:59:04 +02:00
parent 9cd4a65071
commit 0ebfc0a4c4
26 changed files with 364 additions and 360 deletions

View File

@@ -589,10 +589,10 @@ void HTMLElement::did_receive_focus()
{
if (m_content_editable_state != ContentEditableState::True)
return;
auto* browsing_context = document().browsing_context();
if (!browsing_context)
auto navigable = document().navigable();
if (!navigable)
return;
browsing_context->set_cursor_position(DOM::Position::create(realm(), *this, 0));
navigable->set_cursor_position(DOM::Position::create(realm(), *this, 0));
}
// https://html.spec.whatwg.org/multipage/interaction.html#dom-accesskeylabel