Commit graph

12 commits

Author SHA1 Message Date
mikiubo
8ec72d6906 LibUnicode: Avoid rejecting end-of-text position as a valid boundary
When the cursor was positioned at the end of text,
attempting to move it left(using the left arrow key)
would fail because align_boundary() was rejecting
the end-of-text position as a valid boundary.
2025-04-11 15:30:17 -04:00
Timothy Flynn
00d00b84d3 LibJS: Ensure relevant extension keys are included in ICU locale data
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/7508197

In our implementation, we don't have the affected AOs directly, as we
delegate to ICU. So instead, we must ensure we provide ICU a locale with
the relevant extension keys present.
2025-03-18 11:47:23 -04:00
Timothy Flynn
010463c424 LibUnicode: Specify ICU 76 in LibUnicode/CMakeLists.txt
We upgraded to ICU 76 in 6a564376fc. This
CMakeLists.txt should have been updated to match.
2025-03-01 15:09:41 -05:00
Timothy Flynn
85b424464a AK+Everywhere: Rename verify_cast to as
Follow-up to fc20e61e72.
2025-01-21 11:34:06 -05:00
Timothy Flynn
6a564376fc Meta+LibUnicode+LibJS: Upgrade to ICU 76.1
This updates our local ICU overlay port to use ICU 76.1. This includes
Unicode 16 and CLDR 46.

Upstream vcpkg is not able to supply versions past 74 yet due to various
dependency issues, but we are able to use this version ourselves. The
overlay port now includes a patch to revert ICU's dependence on autoconf
2.72 for now, as this version is not yet available on all systems.

All of the test changes were cross-referenced with Firefox to ensure
correctness.
2025-01-18 17:56:40 -05:00
Timothy Flynn
e6b7c8cde2 LibUnicode: Consistently reject out-of-bounds segmenter indices
In the UTF-8 implementation, this prevents out-of-bounds access of the
underlying text data, as the ICU macro would essentially do something
akin to `text[text.length()]`.

The UTF-16 implementation already checks for out-of-bounds, but would
previously return 0. We now return an empty Optional in both impls. This
doesn't affect LibJS (the user of the UTF-16 impl), as it already does
bounds checking before invoking LibUnicode APIs.
2025-01-16 23:22:48 +01:00
Pavel Shliak
6f81b80114 Everywhere: Include HashMap only where it's actually used 2024-12-09 12:31:16 +01:00
Shannon Booth
923ab8658e LibUnicode: Support IgnorePunnycode option in ToAscii algorithm
This was introduced in UTS 46 revision 31.
2024-12-05 17:29:49 +01:00
Timothy Flynn
5e534f4d83 LibJS+LibUnicode: Designate a sort order for Intl.PluralRules categories
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/62fe5db
2024-12-05 09:49:55 +01:00
Jonne Ransijn
d7596a0a61 AK: Don't implicitly convert Optional<T&> to Optional<T>
C++ will jovially select the implicit conversion operator, even if it's
complete bogus, such as for unknown-size types or non-destructible
types. Therefore, all such conversions (which incur a copy) must
(unfortunately) be explicit so that non-copyable types continue to work.

NOTE: We make an exception for trivially copyable types, since they
are, well, trivially copyable.

Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org>
2024-12-04 01:58:22 +01:00
Timothy Flynn
ea503a4f68 LibJS+LibUnicode: Integrate Temporal into Intl.DateTimeFormat
The gist is that we need to construct an ICU date-time formatter for
each possible Temporal type. This is of course going to be expensive.
So instead, we construct the configurations needed for the ICU objects
in the Intl.DateTimeFormat constructor, and defer creating the actual
ICU objects until they are needed.

Each formatting prototype can also now accept either a number (as they
already did), or any of the supported Temporal objects. These types may
not be mixed, and their properties (namely, their calendar) must align
with the Intl.DateTimeFormat object.
2024-11-29 09:52:12 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00