mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-18 14:09:42 +00:00
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:
parent
cf61171864
commit
70db474cf0
Notes:
github-actions[bot]
2025-08-14 08:28:16 +00:00
Author: https://github.com/trflynn89
Commit: 70db474cf0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5845
Reviewed-by: https://github.com/gmta ✅
162 changed files with 1405 additions and 1422 deletions
|
@ -228,7 +228,7 @@ WebIDL::ExceptionOr<void> HTMLTableElement::set_t_head(HTMLTableSectionElement*
|
|||
{
|
||||
// If the new value is neither null nor a thead element, then a "HierarchyRequestError" DOMException must be thrown instead.
|
||||
if (thead && thead->local_name() != TagNames::thead)
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "Element is not thead"_string);
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "Element is not thead"_utf16);
|
||||
|
||||
// On setting, if the new value is null or a thead element, the first thead element child of the table element,
|
||||
// if any, must be removed,
|
||||
|
@ -326,7 +326,7 @@ WebIDL::ExceptionOr<void> HTMLTableElement::set_t_foot(HTMLTableSectionElement*
|
|||
{
|
||||
// If the new value is neither null nor a tfoot element, then a "HierarchyRequestError" DOMException must be thrown instead.
|
||||
if (tfoot && tfoot->local_name() != TagNames::tfoot)
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "Element is not tfoot"_string);
|
||||
return WebIDL::HierarchyRequestError::create(realm(), "Element is not tfoot"_utf16);
|
||||
|
||||
// On setting, if the new value is null or a tfoot element, the first tfoot element child of the table element,
|
||||
// if any, must be removed,
|
||||
|
@ -438,7 +438,7 @@ WebIDL::ExceptionOr<GC::Ref<HTMLTableRowElement>> HTMLTableElement::insert_row(W
|
|||
auto rows_length = rows->length();
|
||||
|
||||
if (index < -1 || index > (long)rows_length) {
|
||||
return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than the number of rows"_string);
|
||||
return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than the number of rows"_utf16);
|
||||
}
|
||||
auto& tr = static_cast<HTMLTableRowElement&>(*TRY(DOM::create_element(document(), TagNames::tr, Namespace::HTML)));
|
||||
if (rows_length == 0 && !has_child_of_type<HTMLTableRowElement>()) {
|
||||
|
@ -465,7 +465,7 @@ WebIDL::ExceptionOr<void> HTMLTableElement::delete_row(WebIDL::Long index)
|
|||
|
||||
// 1. If index is less than −1 or greater than or equal to the number of elements in the rows collection, then throw an "IndexSizeError" DOMException.
|
||||
if (index < -1 || index >= (long)rows_length)
|
||||
return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than or equal to the number of rows"_string);
|
||||
return WebIDL::IndexSizeError::create(realm(), "Index is negative or greater than or equal to the number of rows"_utf16);
|
||||
|
||||
// 2. If index is −1, then remove the last element in the rows collection from its parent, or do nothing if the rows collection is empty.
|
||||
if (index == -1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue