LibJS+LibWeb: Port interned bytecode strings to UTF-16

This was almost a no-op, except we intern JS exception messages. So the
bulk of this patch is porting exception messages to UTF-16.
This commit is contained in:
Timothy Flynn 2025-08-07 19:31:52 -04:00 committed by Jelle Raaijmakers
commit 70db474cf0
Notes: github-actions[bot] 2025-08-14 08:28:16 +00:00
162 changed files with 1405 additions and 1422 deletions

View file

@ -495,18 +495,18 @@ WebIDL::ExceptionOr<void> HTMLSelectElement::show_picker()
// 1. If this is not mutable, then throw an "InvalidStateError" DOMException.
if (!enabled())
return WebIDL::InvalidStateError::create(realm(), "Element is not mutable"_string);
return WebIDL::InvalidStateError::create(realm(), "Element is not mutable"_utf16);
// 2. If this's relevant settings object's origin is not same origin with this's relevant settings object's top-level origin,
// and this is a select element, then throw a "SecurityError" DOMException.
if (!relevant_settings_object(*this).origin().is_same_origin(relevant_settings_object(*this).top_level_origin.value())) {
return WebIDL::SecurityError::create(realm(), "Cross origin pickers are not allowed"_string);
return WebIDL::SecurityError::create(realm(), "Cross origin pickers are not allowed"_utf16);
}
// 3. If this's relevant global object does not have transient activation, then throw a "NotAllowedError" DOMException.
auto& global_object = relevant_global_object(*this);
if (!as<HTML::Window>(global_object).has_transient_activation()) {
return WebIDL::NotAllowedError::create(realm(), "Too long since user activation to show picker"_string);
return WebIDL::NotAllowedError::create(realm(), "Too long since user activation to show picker"_utf16);
}
// FIXME: 4. If this is a select element, and this is not being rendered, then throw a "NotSupportedError" DOMException.