Edwin Hoksberg
1be31c103f
LibWeb: Stub WebSerial API
2025-08-08 10:23:17 +02:00
Luke Wilde
59162342e6
LibWeb: Set LinkProcessingOptions' cryptographic_nonce_metadata
...
Fixes external CSS being blocked on https://beatsaver.com/ , where they
have a `style-src` directive set to `'self' 'nonce-[value]'`
Relates to #5643 , but does not make the website load.
2025-08-07 19:26:57 +02:00
Luke Wilde
1d57df6e26
LibWeb/CSP: Implement the sandbox directive
2025-08-07 19:24:39 +02:00
Luke Wilde
40bb50ac60
LibWeb: Parse and propagate the iframe sandbox attribute
2025-08-07 19:24:39 +02:00
Timothy Flynn
1bc80848fb
AK+LibWeb: Add a UTF-16 starts/ends with wrapper for a single code unit
2025-08-07 02:05:50 +02:00
Luke Wilde
4aa355658f
LibWeb/CSP: Implement the base-uri directive
2025-08-07 00:45:31 +02:00
Aliaksandr Kalenik
7a34bc2700
LibWeb: Re-evaluate media queries only when things they depend on change
...
Before this change we were re-evaluating media queries on every frame
which adds up in 1-4% in profiles on Discord.
2025-08-05 17:24:34 +02:00
Timothy Flynn
2dc0a3b3ce
AK: Add trim methods to Utf16String that skip allocation when not needed
...
If the string does not begin with any of the provided code units, we do
not need to create a new string.
2025-08-05 15:13:36 +02:00
Timothy Flynn
0efa98a57a
LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16
...
This has quite a lot of fall out. But the majority of it is just type or
UDL substitution, where the changes just fall through to other function
calls.
By changing property key storage to UTF-16, the main affected areas are:
* NativeFunction names must now be UTF-16
* Bytecode identifiers must now be UTF-16
* Module/binding names must now be UTF-16
2025-08-05 07:07:15 -04:00
Idan Horowitz
aeb7b442d3
LibWeb: Add initial support for bitmap cropping to createImageBitmap
2025-08-04 23:39:11 +02:00
Callum Law
e0e00220fe
LibWeb: Handle Auto
resolution within Page::preferred_color_scheme
...
Handling this here means we don't have to it within individual callers
2025-08-04 11:29:05 +01:00
Callum Law
46153910ec
LibWeb: Update to_color
to take ColorResolutionContext
...
Using a generic context argument will allow us to resolve colors in
places where we have all the required information but not in the form of
a layout node as was expected previously.
2025-08-04 11:29:05 +01:00
Idan Horowitz
ba6b82464c
LibWeb: Add initial support for SVGImageElement
in createImageBitmap
2025-08-03 21:47:48 +02:00
Idan Horowitz
3b8ccf4d77
LibWeb: Add initial support for HTMLImageElement
in createImageBitmap
2025-08-03 21:47:48 +02:00
Idan Horowitz
cc0496284b
LibWeb: Add a getter for the default image bitmap of HTMLImageElement
...
The default image bitmap is the first frame for animated bitmaps, and
the only frame for non-animated bitmaps.
2025-08-03 21:47:48 +02:00
Idan Horowitz
9b11e0051c
LibWeb: Support ImageBitmapOptions's resize{Width,Height} fields
2025-08-03 21:47:48 +02:00
Michael Manganiello
7fed49ea5c
LibWeb: Fix local storage type in Window::local_storage()
...
The storage type was being incorrectly set to Session instead of Local,
apparently because of copying the implementation from
`Window::session_storage()`.
Bug introduced in commit 2066ed2318
2025-08-03 19:23:09 +02:00
Tim Ledbetter
3e8ede5dc4
LibWeb: Remove HTMLImageElement::src()
...
This is no longer used.
2025-08-03 17:33:06 +02:00
Glenn Skrzypczak
3dd8b3230e
LibWeb/HTML: Only include direction if dirname applies
...
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
Label PRs with merge conflicts / auto-labeler (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
This commit changes form data to only include the direction of auto
directionality form associated elements.
2025-08-02 18:27:35 +01:00
Timothy Flynn
50fed1d65c
LibWeb+LibWebView+WebContent+UI: Port the document title to UTF-16
2025-08-02 10:10:14 -07:00
Aliaksandr Kalenik
1001ff2599
LibGfx+LibWeb: Delete unused PaintStyle::paint()
implementations
...
These are unused since we moved to Skia and it's misleading to keep
them around.
2025-08-01 04:39:50 -04:00
Jelle Raaijmakers
c9d4913bb4
LibWeb: Do not modify selection if editing host is already selected
...
If an editing host receives focus, we would always set a new selection
range. However, we only need to do that if we're not already part of the
active range. This corresponds to behavior shown by Chrome and Firefox.
2025-08-01 10:09:26 +02:00
Tete17
8fdd9b68dc
LibWeb: First implementation of the TrustedTypePolicyFactory
...
Most of the functions are either not implemented of filled with dummy
values.
2025-07-30 15:51:35 +01:00
Andreas Kling
66a19b8550
LibWeb: Make ESO "fetch group" weakly reference the fetch records
...
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / macOS, arm64, Sanitizer, Clang (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
Otherwise we end up holding on to every fetch record indefinitely.
Found by analyzing GC heap graphs on Discord.
2025-07-29 20:00:17 -04:00
Andreas Kling
77abe2a84d
LibWeb: Allow ImageProvider subclasses to visit additional GC edges
...
More prep work for CSS content:image.
2025-07-28 22:46:27 +02:00
Andreas Kling
0e94c4e270
LibWeb: Allow ImageProvider to not have a corresponding DOM node
...
This is prep work for CSS content:image.
2025-07-28 22:46:27 +02:00
Timothy Flynn
67cc02ab59
LibWeb+UI: Add an explicit IPC to handle mouse leave events
...
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
The faux position we created here is adjusted by the device pixel ratio
later on, which would invoke integer overflow on screens with a DPR
greater than 1.
Instead of creating special data for a mouse move event, let's just add
an explicit leave event handler.
2025-07-28 21:26:33 +02:00
Timothy Flynn
8600925713
LibWeb: Port HTMLElement innerText/outerText to UTF-16
2025-07-28 18:30:50 +02:00
Timothy Flynn
5c561c1a53
LibWeb: Port node text content to UTF-16
2025-07-28 18:30:50 +02:00
Timothy Flynn
27a4c1eaf6
LibWeb: Remove errant comment from HTMLElement::rendered_text_fragment
...
This became untrue in a1a740bb3e
.
2025-07-28 18:30:50 +02:00
Timothy Flynn
63bce2b78c
LibWeb: Remove the ad-hoc strip_newlines
method from HTMLSelectElement
...
This doesn't appear to be doing anything that the Infra method it calls
isn't already doing.
2025-07-28 18:30:50 +02:00
Timothy Flynn
c8888609f4
LibWeb: Port the FormAssociatedElement value to UTF-16
...
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
This porting effort makes it pretty clear we will want a UTF-16-aware
GenericLexer. But for now, we can actually make ASCII assumptions about
what we are parsing, and act accordingly.
2025-07-28 12:25:11 +02:00
Timothy Flynn
e7b08cf291
LibWeb: Add a DOM::Element::set_attribute override for UTF-16 strings
...
This just transcodes to UTF-8 for now, but primarily serves to to keep
compatibility with generated IDL definitions.
2025-07-28 12:25:11 +02:00
Aliaksandr Kalenik
8569124b87
LibWeb: Fix scroll state refresh in cached display list for iframes
...
6507d23
introduced a bug when snapshot for iframe is saved in
`PaintNestedDisplayList` and, since display lists are immutable, it's
not possible to update before the next repaint.
This change fixes the issue by moving `ScrollStateSnapshot` for
nested display lists from `PaintNestedDisplayList` to
`HashMap<NonnullRefPtr<DisplayList>, ScrollStateSnapshot>` that is
placed into pending rendering task, making it possible to update
snapshots for all display lists before the next repaint.
This change doesn't have a test because it's really hard to make a ref
test that will specifically check scenario when scroll offset of an
iframe is advanced after display list is cached. We already have
`Tests/LibWeb/Ref/input/scroll-iframe.html` but unfortunately it did
not catch this bug.
Fixes https://github.com/LadybirdBrowser/ladybird/issues/5486
2025-07-26 11:53:21 -04:00
Timothy Flynn
017a6cc687
LibWeb+WebContent: Port FormAssociatedTextControlElement APIs to UTF-16
2025-07-26 00:40:06 +02: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
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
73967ee90c
Everywhere: Use HashMap::update() where applicable
2025-07-25 16:22:06 +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
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
Glenn Skrzypczak
6e6507c8c5
LibWeb/HTML: Sanitize email input with multiple attribute
...
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (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
This implements the missing part of the value sanitization algorithm
for email inputs with the multiple attribute.
2025-07-22 23:02:33 +01:00
Jelle Raaijmakers
526615bc10
LibWeb: Stub Navigator.getGamepads()
2025-07-22 11:55:29 -04:00
Jelle Raaijmakers
a6dfc6cdff
LibWeb: Resolve NavigatorBeacon FIXME regarding the partial interface
2025-07-22 13:07:06 +01:00
Tim Ledbetter
92f85d180e
LibWeb: Serialize empty ImageBitmap data as null
2025-07-21 19:19:50 -04:00
Luke Wilde
45127aee88
LibWeb: Check if transferred ImageBitmap is exposed in target realm
...
This was forgotten in ed3d0d7
.
2025-07-21 00:52:07 +12:00
Gingeh
28774efa22
LibWeb: Don't crash when drawing null image from offscreen canvas
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-20 08:54:53 +02:00
Tim Ledbetter
48417152df
LibWeb: Don't crash when creating empty bitmap from a HTMLCanvasElement
2025-07-20 16:26:57 +12:00
Kenneth Myhra
ed3d0d76ec
LibWeb: Implement transfer {,receiving} steps for ImageBitmap
2025-07-20 12:30:43 +12:00
Kenneth Myhra
c0976b18e0
LibWeb: Implement {,de}serialization steps for ImageBitmap
...
To make {,de}serialization of ImageBitmap work we also had to add
support for creating an ImageBitmap from a HTMLCanvasElement in
WindowOrWorkerGlobalScopeMixin::create_image_bitmap_impl().
2025-07-20 12:30:43 +12:00
Kenneth Myhra
7b4ee57037
LibWeb: Add get_bitmap_from_surface() and use it from to_blob()
...
This refactors out the reading part of Gfx::Bitmap from
HtmlCanvasElement::surface(). We can then reuse this from
WindowOrWorkerGlobalScopeMixin::create_image_bitmap_impl() when we
create an ImageBitmap from a HtmlCanvasElement.
2025-07-20 12:30:43 +12:00