LibWeb+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16

This commit is contained in:
Timothy Flynn 2025-07-25 15:04:25 -04:00 committed by Jelle Raaijmakers
parent cdf270a5e6
commit 017a6cc687
Notes: github-actions[bot] 2025-07-25 22:42:01 +00:00
12 changed files with 58 additions and 64 deletions

View file

@ -1288,7 +1288,7 @@ EventResult EventHandler::handle_keydown(UIEvents::KeyCode key, u32 modifiers, u
FIRE(input_event(UIEvents::EventNames::beforeinput, input_type, m_navigable, code_point));
if (target->handle_return_key(input_type) != EventResult::Handled)
target->handle_insert(String::from_code_point(code_point));
target->handle_insert(Utf16String::from_code_point(code_point));
return EventResult::Handled;
}
@ -1296,7 +1296,7 @@ EventResult EventHandler::handle_keydown(UIEvents::KeyCode key, u32 modifiers, u
// FIXME: Text editing shortcut keys (copy/paste etc.) should be handled here.
if (!should_ignore_keydown_event(code_point, modifiers)) {
FIRE(input_event(UIEvents::EventNames::beforeinput, UIEvents::InputTypes::insertText, m_navigable, code_point));
target->handle_insert(String::from_code_point(code_point));
target->handle_insert(Utf16String::from_code_point(code_point));
return EventResult::Handled;
}
} else if (auto selection = document->get_selection(); selection && !selection->is_collapsed()) {
@ -1386,7 +1386,7 @@ EventResult EventHandler::handle_paste(String const& text)
return EventResult::Dropped;
FIRE(input_event(UIEvents::EventNames::beforeinput, UIEvents::InputTypes::insertFromPaste, m_navigable, text));
target->handle_insert(text);
target->handle_insert(Utf16String::from_utf8(text));
return EventResult::Handled;
}