Commit graph

61974 commits

Author SHA1 Message Date
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
MacDue b2f63632f1 LibWeb: Support clipping in the AffineCommandExecutorCPU
This adds two paths for clipping. If the clip rect is known to be
rectangular (and axis-aligned), then normal/fast painter clipping is
used. Otherwise, a temporary buffer is made for 'expensive' clipping
(i.e. clipping by an arbitrary quadrilateral). All draw commands are
then redirected to the temporary buffer until the clipping needs to be
flushed. Clipping is flushed when the clip rect or target bitmap
changes. Flushing expensive clipping requires applying a clip mask to
the temporary buffer, and then blitting it to the target bitmap.

Note: If the bounds of a draw command are known to be within the current
clip 'expensive' clipping can be elided.

In future, it may be possible to avoid some of this masking by applying
path-clipping algorithms (but that's fairly tricky, and normally
requires stronger guarantees about paths than we currently have).
2024-06-09 14:12:06 -04:00
brody-qq 5058873d45 Kernel/Memory: Make release_all_clean_pages use try_release_clean_pages
The methods try_release_clean_pages() and release_all_clean_pages() in
InodeVMObject are almost identical. This commit makes them both use the
same code path.
2024-06-09 14:00:41 -04:00
Ali Mohammad Pur 0c99ce91f8 Meta: Use Python>=3.10 in the test262 action
The new Wasm test generation script needs this.
2024-06-09 18:10:37 +02:00
Kenneth Myhra 7cbe5c9d4a LibWeb: Implement static method ReadableStream.from(asyncIterable)
(cherry picked from commit 0ec0e92b100faf92256e704b9e94e9c90a04b642)
2024-06-09 16:24:09 +01:00
Kenneth Myhra 2e45967127 LibWeb: Implement AO readable_stream_from_iterable
(cherry picked from commit 01a8b5ee542c006665a0623c23df59bc6a94cb22)
2024-06-09 16:24:09 +01:00
Kenneth Myhra 9d016f5c7e LibWeb: Add non-standard AO set_up_readable_stream
This AO can be used instead of CreateReadableStream in cases where we
need to set up a newly allocated ReadableStream before initialization of
said ReadableStream, i.e. ReadableStream is captured by lambdas in an
uninitialized state.

(cherry picked from commit ce521a196dc3a50b5a7e35a09917e435b78da1d4)
2024-06-09 16:24:09 +01:00
Diego 11d81d6487 LibWasm: Validate that names are UTF-8 2024-06-09 16:30:09 +02:00
Diego 9721b63d13 CI+Documentation: Use WABT version 1.0.35
Required for `wast2json` to work with latest spec-tests.
2024-06-09 16:30:09 +02:00