Commit graph

35867 commits

Author SHA1 Message Date
stelar7
2b65e86ec7 LibWeb: Add debug log message for missing calc() context 2024-10-29 14:40:40 +00:00
stelar7
488436fb54 LibWeb: Parse the rotate css property 2024-10-29 14:40:40 +00:00
Pavel Shliak
8ac60273a6 LibAudio: Manage channelCount in DynamicsCompressorNode
That helps to pass more WPT tests
under /webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html
2024-10-29 13:31:52 +00:00
Pavel Shliak
f2ed59879f LibAudio: Manage channelCountMode in DynamicsCompressorNode
That helps to pass more WPT tests
under /webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html
2024-10-29 13:31:52 +00:00
Tim Ledbetter
472d5e87e9 Meta+LibCore: Include git hash in version string
If the `LADYBIRD_GIT_VERSION` environment variable is set, then use it
to set the version number printed by the `--version` argument.
2024-10-29 13:30:12 +00:00
Tim Ledbetter
e815847f86 LibCore: Remove SerenityOS specific version number code 2024-10-29 13:30:12 +00:00
Gingeh
ebb8342cf2 LibWeb: Implement and use "isomorphic decoding" 2024-10-29 08:26:13 -04:00
Timothy Flynn
3ca2ee9c72 LibWeb+WebContent+WebDriver+UI: Make window min/maximize asynchronous
This follows suit of previous changes to never block the WebContent
process in WebDriver endpoints.
2024-10-29 11:03:20 +00:00
Timothy Flynn
9e10010c54 LibWeb: Add a document observer for visibility state changes 2024-10-29 11:03:20 +00:00
Timothy Flynn
bc67bdb160 LibWeb+UI: Initialize the system visibility state to 'hidden'
Not only does this match the spec, but otherwise when the UI process
sends us the initial visibility update, we would ignore the message as
we believed we were already visible (thus the update would not reach the
document).
2024-10-29 11:03:20 +00:00
Timothy Flynn
fa83cc722c LibWeb+WebContent+WebDriver+UI: Make window rect updates asynchronous
It's currently possible for window size/position updates to hang, as the
underlying IPCs are synchronous. This updates the WebDriver endpoint to
be async, to unblock the WebContent process while the update is ongoing.
The UI process is now responsible for informing WebContent when the
update is complete.
2024-10-29 11:03:20 +00:00
Timothy Flynn
102a125ea5 UI/AppKit: Inform WebContent of the UI window position/size
This is required for APIs like window.screenX, as well as for WebDriver
and WPT.
2024-10-29 11:03:20 +00:00
Timothy Flynn
47af8c6733 LibWeb: Defer handling of WebDriver endpoint invocations
We can currently crash on WebDriver session shutdown when we receive a
Delete Session command. This destroys the WebDriver client while we are
inside the client's socket's on_ready_to_read callback. This is not
allowed by AK::Function.

To avoid this, we now only read data from the socket in the callback. We
then defer handling the message to break out of the callback.
2024-10-28 23:27:25 +01:00
Timothy Flynn
db1bcb2c56 LibHTTP: Make HttpRequest default-movable
Otherwise, clangd correctly warns that this type is only copyable.
2024-10-28 23:27:25 +01:00
Lucas CHOLLET
f253246a6c LibWeb/CSS: Add support for the lch color function
This makes us pass all `css/css-color/lch-00*.html` tests.
2024-10-28 23:26:19 +01:00
Lucas CHOLLET
e8fc731b8c LibWeb/CSS: Introduce a base class for LCH-based color values
This will be used by both CSSLCH and CSSOKLCH.
2024-10-28 23:26:19 +01:00
Lucas CHOLLET
7a94709cd2 LibWeb/CSS: Factorize the parsing code for lch-like color functions 2024-10-28 23:26:19 +01:00
Shannon Booth
2c5cfbb968 LibWeb: Expose MessagePort.postMessage(message, transfer)
The overload resolution is no longer an issue, and we already had this
implemented :^)
2024-10-28 22:56:39 +01:00
Shannon Booth
897ba19e0f LibWeb: Use FIXME extended attribute for ServiceWorker.postMessage
The old FIXME is no longer relevant :^)
2024-10-28 22:56:39 +01:00
Shannon Booth
bf81e2fd64 LibWeb: Implement Worker.postMessage(message, transfer) 2024-10-28 22:56:39 +01:00
Shannon Booth
755b63132b LibWeb: Implement DedicatedWorkerGlobalScope postMessage(msg, transfer)
Unfortunately the added test (which passes locally) is skipped as it is
based off other Worker tests which are also skipped due to being flakey
in CI.
2024-10-28 22:56:39 +01:00
Shannon Booth
70599d3f8d LibWeb: Add support for dictionaries in overload resolution
By making use of the known set of supported dictionary names in that
overload set. Note that this list is typically very small (the max that
we have currently is 1).
2024-10-28 22:56:39 +01:00
Lucas CHOLLET
48bbebc636 LibWeb/CSS: Start parsing the color() function
This is really bare bone as we only support the `xyz-d50` color space
for the moment.

It makes us pass the following WPT tests:
 - css/css-color/predefined-016.html
 - css/css-color/xyz-d50-001.html
 - css/css-color/xyz-d50-002.html
2024-10-28 22:55:57 +01:00
Grubre
a6794627b0 LibWeb: Use Element::lang() in matches_lang_pseudo_class
The previous implementation went up the DOM tree until it found lang
attribute. The new version uses lang() function from the spec.
2024-10-28 17:55:05 -04:00
Grubre
95c511a3f6 LibWeb: Use the correct locale when applying titlecase
Previously with lang="nl" and text-transform: capitalize, inner text
"ijsland" would turn to "Ijsland" instead of "IJsland", now it's as it
should be.

This fixes:
https://wpt.fyi/results/css/css-text/text-transform/text-transform-tailoring-001.html
2024-10-28 17:55:05 -04:00
Grubre
5ac1a24255 LibWeb: Implement lang() function for DOM::Element
This is in accordance with:
https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes
2024-10-28 17:55:05 -04:00
Jonne Ransijn
5c1bbd3eff LibWeb: Make CSSRule::type() non-virtual
All its overrides return constants, and without virtual dispatch the
`qualified_layer_name` and `absolutized_selectors` functions can benefit
from slightly better optimizations.

`CSSRule`s aren't allocated that often, so the memory impact is minimal.
2024-10-28 22:53:57 +01:00
Kostya Farber
2f41be733f LibWeb: Add word spacing to tab size correctly
We should be adding the computed value for word spacing not letter
spacing twice.
2024-10-28 22:53:37 +01:00
Jelle Raaijmakers
1b82cb43c2 LibWeb+LibGfx: Fix SVG userSpaceOnUse gradient coordinate transformation
We were transforming coordinates for SVG gradients in a pretty
convoluted way: an inverse, unscaled transformation matrix was set up in
order to work around some (old?) technical limitations.

Rework this so the coordinate transformation no longer needs to be
inversed. This fixes gradients with "userSpaceOnUse" for its
gradientUnits attribute, which might cause coordinates to lie outside of
the bounding box of the gradient.

Two tests have updated reference screenshots with minor pixel updates;
this is probably the result of floating point precision improvements by
not inversing the matrix.

One test (svg-text-effects) has a bigger change: the gradient stops seem
to have moved along the text. This does seem to match other browsers
slightly better, so I'm moving forward with this ref update.
2024-10-28 22:53:17 +01:00
Jelle Raaijmakers
4d7da9878d LibWeb: Implement gradient offset clamping for color stops 2024-10-28 22:53:17 +01:00
Jelle Raaijmakers
66925a3d80 LibWeb: Misc. SVG improvements
No functional changes: added spec comments, moved some code, removed an
unused member.
2024-10-28 22:53:17 +01:00
Ben Wiederhake
3553861046 LibWeb: Omit padding in WebCrypto AES-CBC exportKey 2024-10-28 21:15:59 +01:00
Lucas CHOLLET
15121d63ad LibWeb/CSS: Make all children of CSSLabLike share the create() method
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Small code deduplication. NFC.
2024-10-28 20:35:57 +01:00
Ben Wiederhake
4a6ce210b0 LibWeb: Refuse to fill float array with random values
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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 passes an additional test in WPT:
WebCryptoAPI/getRandomValues.any
2024-10-28 10:42:27 +01:00
Michael Boonstra
157dbbad83 LibWebView: Fix ProcessAndClient template deduction
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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 resolves compiler errors in HelperProcess.cpp when instantiating
Process::spawn() with various client types like WebContentClient and
RequestClient.
2024-10-27 19:57:53 -07:00
Jonne Ransijn
c97af00355 LibCore: Respect system hard limit in set_resource_limits
This avoids an "Invalid argument (errno=22)" error
on systems with lower hard limits.
2024-10-27 16:15:43 -04:00
Andreas Kling
c5a54f1166 LibWeb: Allow intrinsic size keywords for min-height and max-height 2024-10-27 21:02:54 +01:00
Andreas Kling
5a9d538acc LibWeb: Disallow none for min-width and min-height 2024-10-27 21:02:54 +01:00
Andreas Kling
6c75a93ec0 LibWeb: Fix select element state update in three ways
1. We were not propagating selectedness updates from option to select
   if the option was inside an optgroup.

2. When two or more options were selected, we were always favoring the
   last one in tree order, instead of the last one that got checked.

3. We were neglecting to return in the `display size is 1` case when
   all elements were disabled.

This was covered by some of the :has() selector tests. :^)
2024-10-27 18:40:20 +01:00
Andreas Kling
6dad8ea584 LibWeb: Move pessimistic :has() invalidation hack to invalidate_style()
We basically need to do this for every invocation of invalidate_style()
right now, so let's just do it inside invalidate_style() itself.

Fixes one missing invalidation issue caught by a WPT test. :^)
2024-10-27 18:40:20 +01:00
Andreas Kling
9e080e197c LibWeb: Make :has() actually work for non-descendant relative selectors
The traversal for these was incorrect and awkward. Now it's less
incorrect but still very awkward. We should find better ways to
implement this, but for now this at least passes many more WPT tests.
2024-10-27 13:33:46 +01:00
Andreas Kling
f24b91b01e LibWeb: Invalidate whole document style on attr change if :has() present
This sucks, and we're gonna have to do better, but for now let's
invalidate the whole document's style, so that we get correct behavior
if there are :has() selectors present.
2024-10-27 13:33:46 +01:00
Andreas Kling
690d9c8752 LibWeb: Be more thorough when marking selectors as "contains :has()"
We were missing this flag on a lot of selectors, which led to
insufficient invalidation in some cases.
2024-10-27 13:33:46 +01:00
Jonne Ransijn
07cd7d479f LibWeb: Remove reference counting for CSS::StyleProperties
`AK::CopyOnWrite` already does reference counting, so there is no need
to do it again.
2024-10-27 13:26:30 +01:00
Andreas Kling
ec0838b84e LibWeb: Implement HTMLElement.innerText closer to spec
And here's the wild part: instead of cloning WPT tests, import the
relevant WPT tests that this fixes into our own test suite.

This works by adding a small Ladybird-specific callback in
resources/testharnessreport.js (which is what that file is meant for!)

Note that these run as text tests, and so they must signal the runner
when they are done. Tests using the "usual" WPT harness should just
work, but tests that do something more freestyle will need manual
signaling if they are to be imported.

I've also increased the test timeout here from 30 to 60 seconds,
to accommodate the larger WPT-style tests.
2024-10-27 12:10:28 +01:00
Jonne Ransijn
afe74afa9e LibWeb/Fetch: Do not clone stored responses
Some checks are pending
Push notes / build (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Reading the RFC9111 spec makes it clear that the stored response was
not intended to be cloned. This is because there is a "clone response"
operation that is used in other places, but never for stored responses.
2024-10-27 11:28:37 +01:00
Jonne Ransijn
c7a51ed297 LibWeb/Fetch: Update cached responses when revalidating
Responses returned from `http_network_or_cache_fetch` were copied
directly from the cache, which is incorrect, since revalidation may
later modify the response, or even invalidate it, such as when the
`Access-Control-Allow-Origin` header is changed.

This fixes WPT test [wpt/cors/304.htm](http://wpt.live/cors/304.htm)
2024-10-27 11:28:37 +01:00
stelar7
96c053b36e LibCrypto: Remove some debug spam from RSA generation 2024-10-27 11:26:12 +01:00
stelar7
37f2818e90 LibWeb: Fix modulus length being wrong for RSA-OAEP key import 2024-10-27 11:26:12 +01:00
stelar7
23fc04d264 LibWeb: Implement RSAOAEP.decrypt() 2024-10-27 11:26:12 +01:00