mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16
This commit is contained in:
parent
cdf270a5e6
commit
017a6cc687
Notes:
github-actions[bot]
2025-07-25 22:42:01 +00:00
Author: https://github.com/trflynn89
Commit: 017a6cc687
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5608
Reviewed-by: https://github.com/gmta ✅
12 changed files with 58 additions and 64 deletions
|
|
@ -1978,14 +1978,8 @@ Web::WebDriver::Response WebDriverConnection::element_send_keys_impl(StringView
|
|||
if (target.has_value()) {
|
||||
// 1. If element does not currently have focus, let current text length be the length of element's API value.
|
||||
Optional<Web::WebIDL::UnsignedLong> current_text_length;
|
||||
|
||||
if (!element->is_focused()) {
|
||||
auto api_value = target->relevant_value();
|
||||
|
||||
// FIXME: This should be a UTF-16 code unit length, but `set_the_selection_range` is also currently
|
||||
// implemented in terms of code point length.
|
||||
current_text_length = api_value.code_points().length();
|
||||
}
|
||||
if (!element->is_focused())
|
||||
current_text_length = target->relevant_value().length_in_code_units();
|
||||
|
||||
// 2. Set the text insertion caret using set selection range using current text length for both the start
|
||||
// and end parameters.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue