Kenneth Myhra
f7442ae907
LibWeb: Remove unnecessary as_if<SVGGradientPaintStyle>() on paint_style
...
This causes a compiler error on GCC 15.0.1 and should be unnecessary
since paint_style already is of type SVGGradientPaintStyle.
2025-08-17 21:18:28 +01:00
Idan Horowitz
1f1adb6d7e
LibWeb+LibURL: Default empty string paths to URL's path in CookieStore
2025-08-17 22:17:36 +02:00
Idan Horowitz
2f61199b01
LibWeb: Rename __hosthttp- to __host-http- in CookieStore
2025-08-17 22:17:36 +02:00
Idan Horowitz
d126b31b92
LibWeb: Consistently trim whitespace from name and value in CookieStore
2025-08-17 22:17:36 +02:00
Andreas Kling
3ab6d43ae2
LibWeb: Add missing null check in root_intersection_rectangle()
2025-08-17 19:09:50 +02:00
Andreas Kling
efd4f63454
LibWeb: Allow blockification across display: contents
boundary
...
Flex/grid items are always blockified (have their CSS display forced
into "block") by style computation.
We were doing this by looking at the CSS display of the parent. However,
if the parent has `display: contents`, we must look at the *grandparent*
instead.
This corrects the layout of buttons underneath Reddit article cards.
2025-08-17 19:09:50 +02:00
Aliaksandr Kalenik
80c8e787a8
LibWeb: Fix abspos layout when box is contained by grid area
...
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
Before this change, `layout_absolutely_positioned_element()` in GFC
had an assumption that all contained by grid container abspos boxes were
also direct children of the grid container. This change adds handling
for the cases when it's not true and, in order to identify grid area
abspos box belongs to, we have to find ancestor grid item.
2025-08-17 17:58:16 +02:00
Tete17
08284e0ef6
LibJS: Implement console.dirxml
...
This function actually gets tested in WPT.
2025-08-17 07:28:56 -04:00
Tim Ledbetter
ad06ac0d58
LibWeb: Implement the color-interpolation
property for SVG gradients
...
This changes the operating color space for gradient `<linearGradient>`
and `<radialGradient>` elements.
2025-08-17 10:51:05 +02:00
Vaxry
040ccc3b42
LibWeb: Allow loading style sheets without a MIME type
...
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
Some websites do not specify the MIME type of style sheets, instead
using as= or just leaving it empty.
Both Chromium and Firefox do load them regardless, so let's do it too.
2025-08-17 02:34:35 +02:00
Andreas Kling
9208a54b0b
LibWeb: Allow style inheritance through slots
...
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
When a subtree is projected through a slot, its root now inherits style
from the slot's parent, rather than the parent of the unprojected root.
This fixes a ton of subtle issues, and is very noticeable on Reddit.
2025-08-16 21:03:31 +02:00
Callum Law
ba62679a7a
LibWeb: Make text cursor same height as text
...
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
Previously we would paint the cursor the entire height of the text
fragment - this didn't look great with large line-heights. Now we only
paint it the height of the actual text, with the top of the cursor
aligning with the font "ascent" and the bottom the "descent".
2025-08-16 15:47:44 +02:00
Callum Law
71b039a721
LibWeb: Use document's global object in is_base_allowed_for_document
...
Previously we were using the document's window - this was both contrary
to spec and causing crashes when the document did not have a window (for
instance the `temp_document` in `HTMLParser::parse_html_fragment`.
This means we no longer crash when navigating between pages on
https://rocketlabcorp.com
2025-08-16 14:19:05 +02:00
Timothy Flynn
017ae80668
LibWeb: Validate form submissions whose submitter is not form-associated
...
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 spec for checking the no-validate state ends with a default return
value of "false". However, we were only hitting this case for form-
associated elements. If the submitter is the form itself, we want to
enter the form validation steps.
2025-08-15 15:28:37 +02:00
mikiubo
23aadc02ca
LibWeb: Implement up/down arrow navigation in textarea
2025-08-15 06:32:11 -04:00
Sam Atkins
888cb038e8
LibWeb/CSS: Expose a couple of types on PaintWorklet and LayoutWorklet
...
This has no actual effect, but it's nice to remove the FIXMEs.
2025-08-15 09:21:28 +02:00
Sam Atkins
6be9f0757f
LibIDL: Add LayoutWorklet and PaintWorklet parsing
...
We don't support these yet, but this avoids having to comment out IDL
definitions that are exposed to them.
2025-08-15 09:21:28 +02:00
Sam Atkins
24c5dc2f7f
LibIDL: Deduplicate code that parses an ExposedTo name
2025-08-15 09:21:28 +02:00
Sam Atkins
80a6dc4da0
LibIDL: Make ExposedTo an enum class
2025-08-15 09:21:28 +02:00
Timothy Flynn
c369f68eff
LibWeb: Delete entire graphemes when the delete/backspace key is pressed
...
We currently delete a single code unit. If the user presses backspace on
a multi code point emoji, they are going to expect the entire emoji to
be removed. This now matches the behavior of Chrome and Firefox.
2025-08-14 22:21:51 +02:00
Timothy Flynn
76bab90812
LibWeb: Use rendered text to find word boundaries when double-clicking
...
This effectively reverts da26941b50
.
When the user double-clicks a word on screen, they are interacting with
the rendered text, which has e.g. whitespace collapsing applied. If we
acquire word boundaries from the raw text, the resulting selection is
not right.
We still have issues with acquiring the right selection via APIs such as
`document.getSelection`. The offsets computed here are effectively then
applied to the raw text. But this issue is present all over EventHandler
and this patch at least makes the selection visually accurate.
2025-08-14 19:36:38 +02:00
Timothy Flynn
e314ca5e9d
LibJS: Introduce ParseMonthCode and CreateMonthCode Temporal AOs
...
This is an editorial change in the Temporal proposal. See:
28357ea
32f4b02
f860ac6
e6f565d
2025-08-14 11:35:28 -04:00
Timothy Flynn
0f4d5d3abc
LibJS: Remove no-op call to ValidateTemporalUnitValue
...
This is an editorial change in the Temporal proposal. See:
07c924b
2025-08-14 11:35:28 -04:00
Glenn Skrzypczak
d25d62e74c
AK/Time+LibWeb/HTML: Fix ISO8601 week conversions
...
This reimplements conversions between unix date times and ISO8601
weeks. The new algorithms also do not use loops, so they should be
faster.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
ec807d40dd
LibWeb/HTML: Correctly convert number to time/local datetime string
...
This fixes a bug where non-zero milliseconds were previously not
included if the second component was zero.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
354fd56046
LibWeb/HTML: Step to next value without step mismatch
...
Inputs now correctly step to the next valid value if they suffer a step
mismatch.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
a127f77602
LibWeb/HTML: Implement default value of range inputs
...
Range inputs now always uses the default value if the value attribute
is not set and the input is not dirty.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
aea8650d8b
LibWeb/HTML: Enforce constraints on range inputs
...
This extends the sanitization algorithm for range inputs in order to
prevent overflow, underflow and step mismatch.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
57376f8701
LibWeb/HTML: Ensure the year of month and week values is greater than 0
...
The validation algorithm for month and week inputs now also checks if
the year is greater than zero.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
544a6b21fc
LibWeb/HTML: Correctly normalize local datetime values
...
Now trailing zeros in the second and millisecond part of local datetime
values are removed during normalization.
2025-08-14 11:05:28 -04:00
Glenn Skrzypczak
cac2ee41b9
LibWeb/HTML: Correctly compute whether element is mutable
...
This adapts the implementation of `is_mutable` to align more closely
with the spec. Specifically, it is now also taken into account whether
the element is enabled.
2025-08-14 11:05:28 -04:00
Kenneth Myhra
1228063a85
LibWeb: Enforce Integrity Policy on Fetch requests
2025-08-14 13:37:38 +01:00
CountBleck
ec051bdec2
LibWeb: Import css/selectors/user-valid.html from WPT
2025-08-14 11:55:02 +02:00
CountBleck
d49fb169bc
LibWeb: Correct typos for user validity of form elements on submission
...
The spec and comments say "set field's user validity to true", but we
now actually set it to true and not false.
This passes one subtest in WPT's css/selectors/user-valid.html.
2025-08-14 11:55:02 +02:00
norbiros
783ae44462
LibWeb: Fix color interpolation by premultiplying alpha
...
The current Color::interpolate_color method does not follow the specs
properly. Started improving it by handling premultiplied alpha in color
interpolation.
Only one WPT test covers this (color-transition-premultiplied), which we
currently pass due to a different approach in Color.mixed_with.
2025-08-14 11:09:05 +02:00
ayeteadoe
d91d28dc2a
Meta: Replace lint-clang-format.sh with lint-clang-format.py
...
Currently you need to use Git Bash or alternative bash implementations
to fully run the pre-commit checks on Windows. This will now allow
for formatting changes without bash.
2025-08-14 10:57:31 +02:00
stelar7
8addd5771f
LibWeb/IDB: Add debug dump to Keys
2025-08-14 09:31:56 +01:00
stelar7
9e66f49b44
LibWeb/Tests: Update IDB keyorder test file
2025-08-14 09:31:56 +01:00
stelar7
75054aeecd
LibWeb/IDB: Allow null errors during abort
2025-08-14 09:31:56 +01:00
stelar7
474b748275
LibWeb/IDB: Check the request error instead of the transaction
2025-08-14 09:31:56 +01:00
stelar7
a7bcb1b0c5
LibWeb/IDB: Dont set state in IDBTransaction::abort
2025-08-14 09:31:56 +01:00
Timothy Flynn
70db474cf0
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.
2025-08-14 10:27:08 +02:00
Timothy Flynn
cf61171864
LibJS: Port remaining bytecode identifiers to UTF-16
2025-08-14 10:27:08 +02:00
Timothy Flynn
829fd25264
LibJS: Add a UTF-16 variant of Value::to_string_without_side_effects
2025-08-14 10:27:08 +02:00
Timothy Flynn
c87122eb32
LibJS: Add a method to stringify a BigInt to UTF-16
...
And remove the ByteString variant while we are here.
2025-08-14 10:27:08 +02:00
Luke Wilde
12dc771186
CI: Create wasm artifact and use it in the js-benchmarks workflow
2025-08-14 10:02:35 +02:00
Jamie Mansfield
73a05f9163
LibWeb: Implement VTTCue.position
2025-08-13 23:05:50 +02:00
Jamie Mansfield
8204143b08
LibWeb: Implement VTTCue.line
2025-08-13 23:05:50 +02:00
Jelle Raaijmakers
9080af4085
RequestServer: Don't set CURLOPT_HTTPGET _and_ CURLOPT_CUSTOMREQUEST
...
CI / macOS, arm64, Sanitizer, Clang (push) Has been cancelled
CI / Linux, x86_64, Fuzzers, Clang (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, GNU (push) Has been cancelled
CI / Linux, x86_64, Sanitizer, Clang (push) Has been cancelled
Package the js repl as a binary artifact / Linux, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / macOS, arm64 (push) Has been cancelled
Package the js repl as a binary artifact / Linux, x86_64 (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Label PRs with merge conflicts / auto-labeler (push) Has been cancelled
Push notes / build (push) Has been cancelled
We always set CURLOPT_CUSTOMREQUEST, so we can skip setting
CURLOPT_HTTPGET.
2025-08-13 10:30:04 -04:00
Jelle Raaijmakers
ed57d2de98
RequestServer: Don't return unused bool when setting curl options
2025-08-13 10:30:04 -04:00