Commit graph

70447 commits

Author SHA1 Message Date
Tim Ledbetter
28b24b72bc LibWeb: Don't resolve flow-relative values for float too early
This allows `getComputedStyle()` to return the correct value if `float`
is set to `inline-start` or `inline-end`
2025-06-17 09:26:26 +02:00
dependabot[bot]
3f5c339d59 CI: Bump dawidd6/action-download-artifact from 9 to 11
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 9 to 11.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v9...v11)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-version: '11'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-17 09:25:36 +02:00
Tim Ledbetter
6c6219db05 LibWeb: Use shorthand keywords for contain used value where possible
The used value of `contain` is now set to `strict` or `content` when
the relevant set of containment keywords are specified.
2025-06-17 08:17:33 +01:00
Tim Ledbetter
96d8bed35b LibWeb/CSS: Serialize contain values in canonical order 2025-06-17 08:17:33 +01:00
R-Goc
8534370dbc Meta: Remove incorrect flag from lagom
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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 commit removes the /J flag when compiling with clang-cl. The /J
flag changes the default char type from signed char to unsigned char
which is the opposite of what we want. Now char will be signed, which is
the default on msvc and what we set on linux.
2025-06-16 11:48:41 -06:00
R-Goc
cdc851141d Meta: Increase compilation speed with clang-cl
This commit increases compilation speed when using clang-cl. It also
decreases object size as well as adds -fstrict-aliasing to match the
default on linux. The linker option added is not recognized by link.exe
so we enable lld-link by default, which will also increase compilation
speed by itself, and allow for LTO.
2025-06-16 11:48:41 -06:00
R-Goc
af056581f6 Meta: Format common_compile_options.cmake
This commit formats common_compile_options to use 4 space indenting
consistently.
2025-06-16 11:48:41 -06:00
Viktor Szépe
19f88f96dc Everywhere: Fix typos - act III
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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-06-16 14:20:48 +01:00
Manuel Zahariev
51b4b4a270 LibWeb: Tests for recalculating ordinals after list manipulation
FIXME: Rendering modifications to a list is sometimes not pixel-perfect
       vs. reference (likely a bug). After this is fixed, screenshot
       tests from this commit will likely fail + can be moved to
       ref tests.
2025-06-16 12:44:58 +01:00
Manuel Zahariev
20546725be LibWeb: Tests for rendering lists and their ordinals
The following tests also expose bugs before this PR:
- Layout/input/ol-render-item-values.html: negative ordinal values
- Layout/input/ol-render-deep-hybrid-list-item-list.html: ordinals
  deep into the list owner subtree
2025-06-16 12:44:58 +01:00
Manuel Zahariev
00d43b39d1 LibWeb: Retain calculated Element::ordinal_value for lists
`Element::ordinal_value` is called for every `li` element in
a list (ul, ol, menu).

Before:
  `ordinal_value` iterates through all of the children of the list
  owner. It is called once for each element: complexity $O(n^2)$.

After:
  - Save the result of the first calculation in `m_ordinal_value`
  then return it in subsequent calls.
  - Tree modifications are intercepted and trigger invalidation
    of the first node's `m_ordinal_value`:
    - insert_before
    - append
    - remove
  Results in noticeable performance improvement rendering' large
  lists: from 20s to 4s for 20K elements.
2025-06-16 12:44:58 +01:00
Manuel Zahariev
d27b43c1ee LibWeb: Add specialized fast_is for lists
Before:
  `is<HTMLOLListElement>` and other similar calls in this commit
  are resolved to `dynamic_cast`, which incurs runtime overhead
  for resolving the type. The Performance hit becomes apparent
  when rendering large lists. Callgrind analysis points to a
  significant performance hit from calls to `is<...>` in
  `Element::list_owner`.

Reference: Michael Gibbs and Bjarne Stroustrup (2006) Fast dynamic
casting. Softw. Pract. Exper. 2006; 36:139–156

After:
  Implement inline `fast_is` virtual method that immediately
  resolves the type. Results in noticeable performance improvement
  2x-ish for lists with 20K entries.

Bonus: Convert starting value for LI elements to signed integer
    The spec requires the start attribute and starting value to be
    "integer". Firefox and Chrome support a negative start attribute.

FIXME: At the time of this PR, about 134 other objects resolve
`is<...>` to `dynamic_cast`. It may be a good idea to coordinate
similar changes to at least [some of] the ones that my have impact
on performance (maybe open a new issue?).
2025-06-16 12:44:58 +01:00
Callum Law
12c9da2d3f LibWeb: Serialize grid/grid-template as "none" when applicable
This exposes a bunch of false-positives in the
grid-{shorthand,template}-invalid.html WPT tests, but gains us some
new passes as well.
2025-06-16 12:37:40 +01:00
Callum Law
7d81823eb3 LibWeb: Handle CSS-wide keywords in style_property_for_sided_shorthand
CSS-wide keywords should not be concatenated in the same way as other
values unless they are all the same.
2025-06-16 12:37:40 +01:00
Callum Law
62da650992 LibWeb: Don't serialize longhands if we directly serialized shorthand
The spec assumes that we only store values against expanded longhands,
there are however limited circumstances where we store against
shorthands directly in addition to the expanded longhands. For example
if the value of the shorthand is unresolved we store an
UnresolvedStyleValue against the shorthand directly and a
PendingSubstitutionStyleValue against each of the longhands.

This commit updates the logic so that in the case we serialize a
shorthand directly we should also mark it's longhands as serialized to
avoid serializing them separately.

This also avoids the scenario where we tried to create and serialize a
ShorthandStyleValue with PendingSubstitutionStyleValue longhands, so we
can remove the check and related FIXME for that.
2025-06-16 12:37:40 +01:00
Callum Law
f8f4da3b90 LibWeb: Don't serialize shorthand with non-uniform CSS-wide keywords 2025-06-16 12:37:40 +01:00
Callum Law
3c6b8d5a2c LibWeb: Propagate CSS-wide keyword to transition longhands
Previously we would treat CSS-wide keywords as equivalent to "none"
2025-06-16 12:37:40 +01:00
Callum Law
335190e925 LibWeb: Handle nested shorthands in all-same-CSS-wide-keyword to_string
Previously we only checked direct sub-properties, not accounting for the
nested case.
2025-06-16 12:37:40 +01:00
Prajjwal
e1d2582680 LibWeb: Resolve FIXME in media select resource algorithm
Fixes at least three WPT test that were previously timing out:
- html/semantics/embedded-content/media-elements/error-codes/error.html
- html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html
- html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
2025-06-16 23:28:10 +12:00
aplefull
bfc79a403d LibGfx: Fix ICC v2 profiles with table-based L* curves
Skia's SkColorSpace::Make() doesn't seem to like ICC v2 profiles
containing table-based L* transfer curves. Now we use
skcms_ApproximateCurve() to convert these tables to parametric curves
that Skia supports in case Skia's SkColorSpace::Make() fails.
2025-06-16 11:31:42 +02:00
aplefull
c4fadc1abf LibMedia: Add support for YUVJ pixel formats in FFmpegVideoDecoder 2025-06-16 10:26:41 +02:00
Lucas CHOLLET
b844f3219e AK: Avoid a copy in StringBuilder's default constructor 2025-06-16 09:44:29 +02:00
Tim Ledbetter
7faeef8d0d LibWeb: Treat font-variant values with unknown keywords as invalid
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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-06-15 16:44:51 +02:00
Tim Ledbetter
d89a67ffee LibWeb: Don't serialize omitted box-shadow and text-shadow values 2025-06-15 16:05:12 +02:00
Tim Ledbetter
68d3ddb1a7 LibWeb: Parse the transform-origin z-value 2025-06-15 16:01:54 +02:00
Tim Ledbetter
a8d5758777 LibWeb: Only resolve transform-origin keywords for the computed value
Previously, we were resolving these keywords at parse time, which gave
an incorrect serialization of the specified value.
2025-06-15 16:01:54 +02:00
Tim Ledbetter
a3f6e71e33 LibWeb/CSS: Disallow third argument in 2D scale functions 2025-06-15 15:59:02 +02:00
Tete17
e7906f4332 LibWeb: Import decompression-corrupt-input.tentative.any.html tests
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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
It is now fully green :)
2025-06-14 18:26:56 -04:00
Tete17
81bfb51756 LibCompress: Handle the error state where a dictionary is needed
For zlib is not necessarily an error state but the web standards do not
support this feature and the WPT tests explicitly check for this case
to be handled as an error.
2025-06-14 18:26:56 -04:00
Tete17
7a235537e8 LibCompress: Error out when encounters and incomplete stream
If we find ourselves in a situation where zlib can't make any progress,
we don't have any more data to feed in and no output has been produced,
we need to raise an error as the compressed data is incomplete.

This used to lead to an infinite busy loop where we keep calling
zlib to decompressed but is not able. This causes the promise on the
read side of the transformer to never fulfill.

This gives us at least 24 more WPT tests :)
2025-06-14 18:26:56 -04:00
Tim Ledbetter
39cef6eeb5 LibWeb: Disallow default as a keyframe name 2025-06-14 17:56:10 -04:00
Tim Ledbetter
64728aef6c LibWeb: Disallow non-ASCII font-language-override values 2025-06-14 16:05:04 -04:00
Tim Ledbetter
cb818c8245 AK: Add FlyString::is_ascii()
This matches the method already available present in String.
2025-06-14 16:05:04 -04:00
Tim Ledbetter
c55f281475 LibWeb: Disallow empty font-language-override string values 2025-06-14 16:05:04 -04:00
rmg-x
a4d931d14a LibCore+LibIPC: Move various encode/decode specializations to LibIPC
This removes a dependency on LibIPC from LibCore.
2025-06-14 16:03:26 -04:00
rmg-x
18f28f398b LibCore+LibIPC: Remove badge on File::leak_fd
This removes a dependency on LibIPC from LibCore.
2025-06-14 16:03:26 -04:00
Daniel Bertalan
d06809dee6 AK: Use __is_trivially_destructible built-in with new enough GCC
GCC 16 trunk has started diagnosing calls to `__has_trivial_destructor`
if the destructor is inaccessible. At the same time, they added a
Clang-compatible `__is_trivially_destructible` built-in trait, so let's
just use that.
2025-06-14 16:02:40 -04:00
Tim Ledbetter
028bcd3d67 LibWeb/CSS: Backtrack the parser if a property does not accept a value
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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-06-14 08:22:56 +02:00
Tim Ledbetter
26293114d8 LibWeb/CSS: Treat repeated text-decoration-line values as invalid 2025-06-14 08:19:47 +02:00
Aliaksandr Kalenik
fdecdb9410 LibWeb/CSS: Remove unused default constructors in GridTrackSize.h
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (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-06-13 19:57:00 +02:00
Aliaksandr Kalenik
237356c5ca LibWeb: Return const& from GridSize::length_percentage() 2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
97639d1d74 LibWeb: Return const& from GridFitContent::max_grid_size() 2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
1009a6e8c4 LibWeb: Return const& from GridMinMax getters 2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
9c7c33e0aa LibWeb: Return const& from GridRepeat::grid_track_size_list() 2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
cdf3e52172 LibWeb: Return const& from GridTrackSizeList::list() 2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
286771457a LibWeb/CSS: Use default operator== where possible in GridTrackSize
No behavior change.
2025-06-13 19:57:00 +02:00
Aliaksandr Kalenik
8d83dce1d7 LibWeb: Use variant to represent CSS::ExplicitGridTrack
No behavior change.
2025-06-13 19:57:00 +02:00
Jelle Raaijmakers
a321eca9d7 LibWeb: Change default :focus-visible outline to a solid accent color 2025-06-13 17:39:11 +02:00
Jelle Raaijmakers
15c436b332 LibWeb: Implement basic focus indication for :focus-visible
This causes links to no longer show an outline when clicked; only when
using keyboard navigation with the tab key will the outline show up.
2025-06-13 17:39:11 +02:00
Jelle Raaijmakers
66813aea79 LibWeb: Run focusing steps on navigation with the tab key
We run these steps when focusing with a mouse pointer, and it seems
sensible to implement the same behavior for keyboard navigation so we
e.g. correctly unwind the previous focus chain.
2025-06-13 17:39:11 +02:00