From dcf3bdcb9a3f7f906c6d73f43de6e9867acc5a7d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 29 Sep 2023 11:59:13 +0100 Subject: [PATCH] LibWeb: Use correct realm when focusing HTMLTextAreaElement This matches HTMLInputElement, and fixes the crash when focusing a textarea. --- Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index be0ddb447b..01ce0b4486 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -56,7 +56,7 @@ void HTMLTextAreaElement::did_receive_focus() return; if (!m_text_node) return; - browsing_context->set_cursor_position(DOM::Position::create(*vm().current_realm(), *m_text_node, 0)); + browsing_context->set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0)); } void HTMLTextAreaElement::did_lose_focus()