mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Bring back FIXME about using UTF-16 length in handle_insert()
It was accidentally removed in a8077f79cc
This commit is contained in:
parent
54d7314bd9
commit
bdaac6ce48
Notes:
github-actions[bot]
2024-10-31 19:05:14 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/bdaac6ce48d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2091 Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 1 additions and 0 deletions
|
@ -593,6 +593,7 @@ void FormAssociatedTextControlElement::handle_insert(String const& data)
|
|||
return;
|
||||
|
||||
String data_for_insertion = data;
|
||||
// FIXME: Cut by UTF-16 code units instead of raw bytes
|
||||
if (auto max_length = text_node->max_length(); max_length.has_value()) {
|
||||
auto remaining_length = *max_length - text_node->data().code_points().length();
|
||||
if (remaining_length < data.code_points().length()) {
|
||||
|
|
Loading…
Reference in a new issue