Timothy Flynn
f001dbea30
LibWeb: Add missing includes to Editing/Commands.h
...
clangd is complaining loudly about these.
2025-07-26 00:40:06 +02:00
Timothy Flynn
2da615ed31
LibWeb: Port document.execCommand and InputEvent to UTF-16
2025-07-26 00:40:06 +02:00
Timothy Flynn
49467d0583
LibIDL+LibWeb: Support UTF-16 USVString
2025-07-26 00:40:06 +02:00
Timothy Flynn
1375e6bf39
AK+LibJS+LibWeb: Use simdutf to create well-formed strings
2025-07-26 00:40:06 +02:00
Timothy Flynn
017a6cc687
LibWeb+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16
2025-07-26 00:40:06 +02:00
Timothy Flynn
cdf270a5e6
WebContent: Invert focus condition in WebDriver's Element Send Keys
...
The spec states we should inspect the relevant value if the element does
*not* have focus.
2025-07-26 00:40:06 +02:00
Timothy Flynn
c566cc5024
LibWeb: Invoke correct word-jumping method in EditingHostManager
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-07-25 12:57:03 -04:00
Timothy Flynn
97548f48de
LibWeb: Port rendered text to UTF-16
...
This migrates TextNode::text_for_rendering() to Utf16String and deals
with the fallout. As a consequence, this effectively reverts commit
3df83dade8
.
The layout test expecation file updates are because we now express text
lengths and offsets in UTF-16 code units.
The selection-over-multiple-code-units expectation file update actually
represents a correctness fix. Our result now matches Firefox.
2025-07-25 18:16:22 +02:00
Timothy Flynn
a270706411
LibWeb: Port DOM::Range stringification to UTF-16
2025-07-25 18:16:22 +02:00
Timothy Flynn
8d17786b8c
LibWeb: Add missing include to LineBoxFragment.h
...
This missing include is making clangd behave badly on this file.
2025-07-25 18:16:22 +02:00
Timothy Flynn
0e9b694058
LibGfx: Support UTF-16 text shaping
...
We can achieve this with templating the string view type, and then just
piping the view into the correct `hb_buffer_add_utf*` API.
2025-07-25 18:16:22 +02:00
Timothy Flynn
a740bfd8ff
AK+LibUnicode: Implement Unicode-aware UTF-16 case transformations
2025-07-25 18:16:22 +02:00
Timothy Flynn
df77ae1920
AK: Implement creating a UTF-16 string from a repeated code point
2025-07-25 18:16:22 +02:00
Timothy Flynn
a46e9b2adb
AK: Compute the correct capacity in StringBuilder::try_append_repeated
...
This was mistakenly broken in 2803d66d87
.
2025-07-25 18:16:22 +02:00
Timothy Flynn
745f288796
AK: Implement a method to acquire a UTF-16 iterator's code unit offset
...
This is the same as Utf8View::iterator_offset().
2025-07-25 18:16:22 +02:00
mikiubo
acf1fe7b05
LibWeb: Return base Document for non-HTML parses
...
The HTML specification does not explicitly require
a specific return type for parseFromString(),
but according to Web Platform TestsDOMParser-parseFromString.html,
the expected return value for
XML MIME types is a Document—not an XMLDocument.
2025-07-25 10:08:29 -06:00
Jelle Raaijmakers
acc7c2f7f3
LibWeb: Do not use namespace in interface names
...
Gives us 20 additional WPT subtest passes in `wasm/jsapi`.
2025-07-25 16:50:45 +02:00
Jelle Raaijmakers
73967ee90c
Everywhere: Use HashMap::update() where applicable
2025-07-25 16:22:06 +02:00
Jelle Raaijmakers
0b96690f0c
AK: Add HashMap::update()
...
This updates a HashMap by copying another HashMap's keys and values.
2025-07-25 16:22:06 +02:00
Jelle Raaijmakers
76ee1ce04c
LibWeb: Support wasm module instantiation using a global address
...
Fixes 1 WPT subtest in `wasm/core/simd`.
2025-07-25 15:35:27 +02:00
Jelle Raaijmakers
58c3a391a3
LibWeb+LibWasm: Reject module instantiation with correct error type
...
The spec tells us to reject the promise with a RuntimeError instead of a
LinkError whenever the module's start function fails during module
instantiation. Fixes 1 WPT subtest in `wasm/core`.
2025-07-25 15:13:28 +02:00
Jelle Raaijmakers
35ca7f82b0
LibWeb: Add BaseAudioContext::createScriptProcessor()
...
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
This is a deprecated node, but it's still widely used on the web.
2025-07-25 11:48:04 +02:00
Luke Wilde
da5fca15ee
LibWeb: Only expose performance.{timing,navigation} on Window
...
They are only valid in a Window context, and the spec only exposes them
in Window contexts.
Fixes workers crashing on:
- https://web.whatsapp.com/
- https://pro.kraken.com/app/trade/btc-usd
2025-07-25 11:46:58 +02:00
Luke Wilde
bd51bc6874
LibIDL: Pass partial interface extended attributes onto its members
2025-07-25 11:46:58 +02:00
Tim Ledbetter
89fb783b42
LibWeb: Throw pre insertion validity errors from the correct global
2025-07-25 09:08:14 +02:00
Ali Mohammad Pur
c7ad6cd508
LibRegex: Use code unit length in more places that apply
...
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Finishes what 7f6b70fafb
started.
Having one part use length and another code unit length lead to crashes,
the added test ensures we don't mess that up again.
2025-07-24 23:09:01 +02:00
Andrew Kaster
97c8fdd042
Documentation: Add instructions on how to build the Flatpak
2025-07-24 14:25:03 -06:00
Aliaksandr Kalenik
66e1d599f8
LibWeb: Use scroll state from snapshot while applying clip rectangles
...
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Fixes race condition introduced in eed47acb
when rendering thread
accesses ScrollFrame that could be mutated in the middle of
rasterization by the main thread, resulting in broken rendering.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/5553
2025-07-24 13:03:23 -04:00
Timothy Flynn
8b6e3cb735
LibWeb+LibUnicode+WebContent: Port DOM:CharacterData to UTF-16
...
This replaces the underlying storage of CharacterData with Utf16String
and deals with the fallout.
2025-07-24 19:00:20 +02:00
Timothy Flynn
cb85eac3d8
LibIDL+IDLGenerators: Begin supporting UTF-16 strings in IDL
...
This adds a new IDL type, Utf16DOMString. This is the same as DOMString,
except it is UTF-16. This type is temporary - we will want DOMString to
be UTF-16 by default once we've ported enough of LibWeb.
To make this support easier, some string IDL generator handling is moved
directly into `generate_to_string` from the call sites.
2025-07-24 19:00:20 +02:00
Timothy Flynn
6c73dff120
AK: Implement a UTF-16 method to check if a string is ASCII whitespace
2025-07-24 19:00:20 +02:00
Timothy Flynn
f53389bab1
AK: Add a couple of Utf16String factories
...
* Utf16String::from_utf8_with_replacement_character
* Utf16String::from_code_point
2025-07-24 19:00:20 +02:00
Andreas Kling
b4435bd50c
LibWeb: Don't clip descendants outside stacking context root rect
...
Skia allows you to pass a bounding rect to its saveLayer() function as
an optimization when you know that you won't paint outside those bounds.
Unfortunately, we were passing a too-small rectangle that didn't take
into account transformed descendants, etc.
For now, simply pass null instead of a bounding rect. This way, Skia
figures it out internally. It may allocate larger temporary bitmaps than
needed this way, but at least we get more correct results. I've left
re-enabling the optimization as a FIXME in the code.
This fixes unwanted clipping in various parts of the Discord UI.
2025-07-24 11:15:01 -04:00
Jelle Raaijmakers
b1c3ce807b
AK: Rename Utf16View::trim_whitespace() to ::trim_ascii_whitespace()
...
This reflects the naming of String::trim_ascii_whitespace() and better
indicates what exactly we're trimming.
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
e029e785d2
LibWeb: Convert Editing API internals to UTF-16
...
Both sides of the Editing internals now have to deal with some awkward
converting between UTF-8 and UTF-16, but the upside is that it
immediately exposed an issue with the `insertText` command: instead of
dealing with code units, it was iterating over code points causing the
selection to be updated only once instead of twice. This resulted in the
final selection potentially ending up in between a surrogate pair.
Fixes #5547 (pasting/typing surrogate pairs).
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
9a03ee1c24
AK: Fix mention of renamed member in Utf16View
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
15178d5230
AK: Add ::ends_with() to Utf16View and Utf16StringBase
...
I noticed that we can significantly simplify ::starts_with(), and based
the new ::ends_with() on that.
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
7f8468b0e6
AK: Compare pointers in TypedTransfer<T>::compare()
...
We can return `true` quickly if the two pointers are identical.
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
54dd45d3f6
AK: Add Span::ends_with()
...
Originally I added this to use it in Utf16View::ends_with(), but the
final implementation ended up a lot simpler. I chose to keep this anyway
since it mirrors Span::starts_with().
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
a9862d60bf
LibGfx: Add Color::from_utf16_string()
2025-07-24 07:18:25 -04:00
Jelle Raaijmakers
fd066d2b58
LibWeb: Update two stray "take the action for command" invocations
...
This is the more idiomatic (although functionally equivalent) way of
taking the action for any command.
2025-07-24 07:18:25 -04:00
aplefull
e2f8f5a350
LibRegex: Fix capture groups in quantified alternations
...
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This prevents empty matches from overwriting non-empty captures in
quantified alternations. Fixes patterns like (a|a?)+ where the optional
branch would incorrectly overwrite meaningful captures with empty
strings.
2025-07-24 10:40:16 +02:00
Timothy Flynn
173bb67004
LibJS+LibUnicode: Port Intl.RelativeTimeFormat to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
abcb2d42bc
LibUnicode: Port Intl.PluralRules to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
6fe0e13474
LibJS+LibUnicode: Port Intl.DurationFormat to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
e637e148d4
LibJS+LibUnicode: Port Intl.NumberFormat to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
db2148b44a
LibJS+LibUnicode: Port Intl.ListFormat to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
7d80aabbdb
LibJS+LibUnicode: Port Intl.DisplayNames to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
ee01f857d1
LibJS+LibUnicode: Port Intl.DateTimeFormat to UTF-16 strings
2025-07-24 10:39:52 +02:00
Timothy Flynn
b2f053e783
LibJS+LibUnicode: Port Intl.Collator to UTF-16 strings
2025-07-24 10:39:52 +02:00