Commit graph

61982 commits

Author SHA1 Message Date
Dan Klishch 7b2250e47f Meta: Remove test262 workflow
The runner is gone now and that results in workflows that never end.
2024-06-14 02:08:27 +02:00
Diego cafc66f272 LibWasm: Tighten validation algorithm
The big improvement included in this commit is stack height mismatch
validation. There are other minor improvements included (related to the
validation algorithm). The method of supporting stack polymorphism has
changed to be more like the spec, which was necessary for confidently
handling stack height mismatches.

See:
https://webassembly.github.io/spec/core/appendix/algorithm.html
(cherry picked from commit 9b58271f8b6de2dbfff416780a54e0322f9c6799)
2024-06-13 23:14:39 +02:00
Diego cdf15887db LibWasm: Refactor validator to use one stack for frame information
Previously, the validator had a lot of extraneous information related to
frames. Now, there's just one stack with all the necessary information
derived from it.

(cherry picked from commit ad54b69de9df6ccd44178cbe49779e313f95f273)
2024-06-13 23:14:39 +02:00
Diego ab95169d3c LibWasm: Enable the loop.wast test file
(cherry picked from commit 1486780676fb558904b9bb9966b5a06c7eb128d8)
2024-06-13 23:14:39 +02:00
Diego f6d7702411 LibWasm: Make loops work
This commit should hopefully allow for `loop.wast` to be run in CI.

(cherry picked from commit 6ca6fd248a14ab394f11131c3df029b486952d54)
2024-06-13 23:14:39 +02:00
Diego 1c86b8146a LibWasm: Make memory.fill fill with single bytes
Previously, `memory.fill` filled memory with 4-byte values, even though
`memory.fill` should fill with just one byte. Also fixes some other
issues with some of the bulk memory instructions, like `memory.init`.

(cherry picked from commit d8ee2e343df25d12637e08d54908b4fd86a22dc3)
2024-06-13 23:14:39 +02:00
Diego 3131736164 LibWasm: Add missing spec-test imports
(cherry picked from commit 69e151e79f11d27fbe53ee0f2391ae8e86f90b5b)
2024-06-13 23:14:39 +02:00
Diego 510bfbbbc3 LibWasm: Validate imports
(cherry picked from commit a1ed3e5d8f4f7b9f44ec4d3e15432d60cba9f2ee)
2024-06-13 23:14:39 +02:00
Diego 15effbaf2a LibWasm: Validate that function and code sections match
(cherry picked from commit cda0d6d27746672058b26b0e61d0900dc73b1fb3)
2024-06-13 23:14:39 +02:00
Diego 985c4c590d LibWasm: Validate that data section exists for some instructions
(cherry picked from commit 5e5df136849c1d450a6e0dd4af3805f7e56f6e76)
2024-06-13 23:14:39 +02:00
Diego be3bc9bd7c LibWasm: Disallow multiple start sections
(cherry picked from commit 6b9977a265b8175cf4da68d601ded427cb49e44e)
2024-06-13 23:14:39 +02:00
Diego 96fb79bb98 LibWasm: Make sure no duplicate export names are possible
(cherry picked from commit c51c018fb13f4fb182da5b12e9e3fda69f6b72ef)
2024-06-13 23:14:39 +02:00
Diego 5502c1a1f8 LibWasm: Validate number of data sections
(cherry picked from commit f7d3ab8e160a61abddfe4db9c8d79260e890bb41)
2024-06-13 23:14:39 +02:00
Dan Klishch 7d1d0fe6ad LibHTTP: Support chunked transfer encoding in async HTTP client
This uses AK::{Generator,AsyncStreamTransform,AsyncStreamBuffer} added
in the previous commits.
2024-06-13 17:40:24 +02:00
Dan Klishch 77be5254e1 LibHTTP: Implement bare-bones HTTP/1.1 client using coroutines
We don't have asynchronous TCP socket implementation, so its usefulness
is a bit limited currently but we can still test it using memory
streams. Additionally, it serves as a temporary {show,test}case for the
asynchronous streams machinery.
2024-06-13 17:40:24 +02:00
Dan Klishch 79051e5f79 AK: Add AK::AsyncStreamBuffer
This class encapsulates all the logic required for a buffer of
asynchronous stream.
2024-06-13 17:40:24 +02:00
Dan Klishch 73b4d39189 AK: Add AK::AsyncStreamTransform
This class allows to convert an asynchronous generator which generates
chunks of data into an AsyncInputStream. This is useful in practice
because the said generator often ends up looking very similar to the
underlying synchronous algorithm it describes.
2024-06-13 17:40:24 +02:00
Dan Klishch 0f1d67f2f0 AK: Introduce AK::Generator 2024-06-13 17:40:24 +02:00
Dan Klishch aeb17a864e AK: Instantiate GenericLexer::consume_decimal_integer<size_t> on MacOS
u64 and size_t are different types on it.
2024-06-13 17:40:24 +02:00
Dan Klishch 60476e247b AK: Introduce a few asynchronous stream helpers
These were proven to be generally useful after writing some asynchronous
streams code.
2024-06-13 17:40:24 +02:00
Dan Klishch 205bfcc6c8 LibTest: Add Test::AsyncMemory{Input,Output}Stream
They are useful for unit testing other asynchronous streams. They have
to be tested themselves in the first place though.
2024-06-13 17:40:24 +02:00
Dan Klishch 7fb6d24402 LibTest: Support asynchronous tests 2024-06-13 17:40:24 +02:00
Dan Klishch 6662d5de2b AK: Introduce asynchronous streams 2024-06-13 17:40:24 +02:00
Dan Klishch b15b51f9da AK: Don't delete Badge move constructor
Otherwise it is impossible to use Badge as an argument of a coroutine.
2024-06-13 17:40:24 +02:00
Dan Klishch 8263e0a619 AK: Introduce AK::Coroutine 2024-06-13 17:40:24 +02:00
Dan Klishch 9054682536 AK: Qualify forward call in AK::exchange
Otherwise it fails to resolve ambiguity between std::forward and
AK::forward when called with the std:: type.
2024-06-13 17:40:24 +02:00
Nico Weber 3780499761 CI: Remove Nightly Android workflow 2024-06-11 19:40:08 -04:00
Nico Weber bb2d80a2bb Everywhere: Gently remove the ladybird android port
With Ladybird now being its own repository, there's little reason
to keep the Ladybird Android port in the SerenityOS repository.

(The Qt port is useful to be able to test changes to LibWeb in lagom
so it'll stay around. Similar for the AppKit port, since getting
Qt on macOS is a bit annoying. But if the AppKit port is too much
pain to keep working, we should toss that too.

Eventually, the lagom browser ports should move out from Ladybird/
to Meta/Lagom/Contrib, but for now it might make sense to leave them
where they are to keep cherry-picks from ladybird easier.)
2024-06-11 19:40:08 -04:00
Tim Ledbetter ce11613677 CrashReporter: Don't update window progress if window has been closed
This prevents a crash that could happen if crash reporter was closed
while generating a crash report.
2024-06-10 23:44:09 -04:00
MacDue 860804baa5 LibWeb: Add support for text in the AffineCommandExecutorCPU 2024-06-10 17:41:33 -04:00
MacDue 0ca71009d0 LibGfx: Add Path::transform()
This applies an affine transform to a path in-place.
2024-06-10 17:41:33 -04:00
MacDue dae6015431 LibGfx: Add cache for glyph paths
These are only cached via the `append_glyph_path_to()` API, so uses of
fonts that only care about bitmaps do not pay for this cache.
2024-06-10 17:41:33 -04:00
MacDue d62d5079f4 LibGfx: Add relative to last point mode to Path::append_path() 2024-06-10 17:41:33 -04:00
Kenneth Myhra 702ff7eb46 LibWeb: Implement and wire up TransformStream's cancel callback
(cherry picked from commit e70886595ab83d650662f46be2ac2e147603c790)
2024-06-10 08:23:32 -04:00
Kenneth Myhra 8f8d577b52 LibWeb: Update steps for transform_stream_default_sink_abort_algorithm
Updating these steps enables the writable side of a TransformStream to
raise the cancel callback when it's aborted.

(cherry picked from commit 6d7885e25036bf08e31f2ad7a13db31767deabaf)
2024-06-10 08:23:32 -04:00
Kenneth Myhra 99d5f1ca2e LibWeb: Update cancel_algorithm steps in AO initialize_transform_stream
(cherry picked from commit 38142eaf53bfc5bb97adbc46d0ce0687716b7df5)
2024-06-10 08:23:32 -04:00
Kenneth Myhra 30c5bc3db4 LibWeb: Implement AO transform_stream_default_source_cancel_algorithm
(cherry picked from commit e848249b8d15fe722e569c22c06f6e92482f35bf)
2024-06-10 08:23:32 -04:00
Kenneth Myhra e072913bac LibWeb: Add internal slots [[cancelAlgorithm]] and [[finishPromise]]
This adds internal slots [[cancelAlgorithm]] and [[finishPromise]] to
TransformStreamDefaultController.

(cherry picked from commit ff5be1fd363c4cb9ba510679b1ee65a0c0b10bc2)
2024-06-10 08:23:32 -04:00
Kenneth Myhra 44bc3a54a3 LibWeb: Implement AO transform_stream_unblock_write
(cherry picked from commit afb74eca52fda83475a863b307db50a7a9f86f7a)
2024-06-10 08:23:32 -04:00
Kenneth Myhra 2668aa90da Test/LibWeb: Add test to prove a ReadableStream can be cancelled
(cherry picked from commit fc37bc328e065465f4d60cf90a3185973be10598)
2024-06-10 08:23:32 -04:00
Andreas Kling 8994dcb4f9 Everywhere: Use HTTP::HeaderMap for request headers
No longer just for response headers! The same type is obviously useful
and ergonomic when making requests as well.

(cherry picked from commit 260c5c50ad19f19d0d4c30984e512f56c055ecff)

Updated various SerenityOS components to make it build.
2024-06-10 12:01:57 +02:00
Andreas Kling bec8d73cb3 LibHTTP+LibWeb: Stop bundling "Set-Cookie" headers as JSON
Before we had HTTP::HeaderMap (which preserves multiple headers with the
same name), we collected multiple "Set-Cookie" headers and bundled them
together as a JSON array.

This was a huge hack, and now we can stop doing that, since LibWeb gets
access to the full set of headers now.

(cherry picked from commit 5ac093885922246529a467054888e598f8832450)
2024-06-10 12:01:57 +02:00
Andreas Kling c9a1eebcb9 Everywhere: Add HTTP::HeaderMap and use for response headers
Instead of using a HashMap<ByteString, ByteString, CaseInsensitive...>
everywhere, we now encapsulate this in a class.

Even better, the new class also allows keeping track of multiple headers
with the same name! This will make it possible for HTTP responses to
actually retain all their headers on the perilous journey from
RequestServer to LibWeb.

(cherry picked from commit e636851481eabdf00953573a5eb459ee52feeacc)

Updated various SerenityOS components to make it build.

Fetch: Make sure we iterate over HeaderMap's headers()

This fixes a build failure when built with CMake option
'-DENABLE_ALL_THE_DEBUG_MACROS=ON'.

(cherry picked from commit c51d01bea712d75f9b2cd700be942935044e49b4)
2024-06-10 12:01:57 +02:00
Ali Mohammad Pur bf5c2d0859 Utilities: Add a crypto benchmarking tool 2024-06-10 11:59:14 +02:00
Andreas Kling 3d61428bb0 Tests: Skip Text/input/HTML/form-image-submission.html (flaky)
Issue: https://github.com/LadybirdWebBrowser/ladybird/issues/100
(cherry picked from commit LadybirdBrowser/ladybird@533eea1958)
2024-06-09 19:48:43 -04:00
Abhishek Raturi ceec7cd537 Hackstudio: Add a window title when diff is opened
Set window title when a diff is opened from Git
widget in HackStudio.
2024-06-09 14:13:29 -04:00
MacDue 9597403bf8 LibWeb: Slightly simplify popping SCs in AffineCommandExecutorCPU 2024-06-09 14:12:06 -04:00
MacDue d30350e951 LibWeb: Make methods for common AffineCommandExecutorCPU operations 2024-06-09 14:12:06 -04:00
MacDue 318f2925d3 LibGfx+LibWeb: Move generally useful path methods to LibGfx
This adds:

  - Path::rect()
  - Path::quad()
  - Path::rounded_rect()

Moving the corresponding implementations from LibWeb.
2024-06-09 14:12:06 -04:00
MacDue f9c944cc85 LibWeb: Support opacity in the AffineCommandExecutorCPU
This supports opacity via the standard method of painting stacking
context to a new bitmap, then blitting it back when popping the stacking
context.

One extra complication is we have to ensure clipping is flushed between
any change of the target bitmap. But other than that is all standard.
2024-06-09 14:12:06 -04:00