LibWeb: Bring back FIXME about using UTF-16 length in handle_insert()

It was accidentally removed in a8077f79cc
This commit is contained in:
Aliaksandr Kalenik 2024-10-31 17:41:22 +01:00 committed by Tim Ledbetter
parent 54d7314bd9
commit bdaac6ce48
Notes: github-actions[bot] 2024-10-31 19:05:14 +00:00

View file

@ -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()) {