Commit graph

56557 commits

Author SHA1 Message Date
Matthew Olsson
536596632b LibWeb: Implement Animation::update_finished_state 2023-11-19 18:54:37 +01:00
Matthew Olsson
979b9b942b LibWeb: Add Document's pending animation event queue
This is needed for Animation's update finished state procedure
2023-11-19 18:54:37 +01:00
Matthew Olsson
8053d40fd5 LibWeb: Add Animation helpers needed for update_finished_state 2023-11-19 18:54:37 +01:00
Shannon Booth
1daded768d LibWeb: Implement ReadableStreamBYOBReader::read
Similiarly to the underlying AO's, currently only TypedArrays are
supported.
2023-11-19 18:53:17 +01:00
Shannon Booth
dcb7bb4a92 LibWeb: Support BYOB readers in ReadableByteStreamControllerEnqueue 2023-11-19 18:53:17 +01:00
Shannon Booth
9662872b20 LibWeb: Implement AO ReadableStreamByobReaderRead
We've finally implemented enough of the Streams AOs so that we are close
to actually performing read operations with BYOB readers.
2023-11-19 18:53:17 +01:00
Shannon Booth
3d37cb0753 LibWeb: Partially implement ReadableByteStreamControllerPullInto
This implementation does not handle DataViews at the moment, but should
handle all of the typed arrays.
2023-11-19 18:53:17 +01:00
Shannon Booth
1443715775 LibWeb: Add ReadableBSControllerProcessPullIntoDescriptorsUsingQueue 2023-11-19 18:53:17 +01:00
Shannon Booth
737dc6ce4e LibWeb: Add ReadableByteStreamControllerFillPullIntoDescriptorFromQueue 2023-11-19 18:53:17 +01:00
Shannon Booth
aca63fd947 LibWeb: Implement ReadableByteStreamControllerCommitPullIntoDescriptor 2023-11-19 18:53:17 +01:00
Shannon Booth
cdcc1ebbba LibWeb: Implement ReadableByteStreamControllerFillHeadPullIntoDescriptor 2023-11-19 18:53:17 +01:00
Shannon Booth
8d4095d00e LibWeb: Add some const overloads in ReadableByteStreamController 2023-11-19 18:53:17 +01:00
Shannon Booth
26e393fbbc LibWeb: Implement ReadableByteStreamControllerConvertPullIntoDescriptor 2023-11-19 18:53:17 +01:00
Shannon Booth
25f8b80eab LibWeb: Use move on ByteBuffer in TransferArrayBuffer 2023-11-19 18:53:17 +01:00
Shannon Booth
446a78f30e LibWeb: Implement Streams AO ReadableStreamAddReadIntoRequest
This is effectively identical to ReadableStreamAddReadRequest besides
from the fact that it takes a ReadIntoRequest instead of a ReadRequest,
and is instead intended to be used for BYOB readers.
2023-11-19 18:53:17 +01:00
Shannon Booth
f27e76b0b7 LibWeb: Make ReadableStreamAddReadRequest take a NonnullGCPtr
Make it more obvious in the function signature that this function will
be taking a GC ref to a ReadRequest by appending it to the
ReadableStreams pending read requests.
2023-11-19 18:53:17 +01:00
Shannon Booth
5ef41dca53 LibWeb: Implement Streams AO ReadableStreamFulfillReadIntoRequest 2023-11-19 18:53:17 +01:00
Shannon Booth
0880ea3e1c LibWeb: Add missing initialize override for ReadableStreamBYOBReader
This hasn't really come up as of yet because not enough of this class
has been implemented yet to actually do anything with it.
2023-11-19 18:53:17 +01:00
Shannon Booth
746526ca29 LibWeb: Add ReadIntoRequest to forwarding header 2023-11-19 18:53:17 +01:00
Andreas Kling
3c74dc9f4d LibJS: Segregate GC-allocated objects by type
This patch adds two macros to declare per-type allocators:

- JS_DECLARE_ALLOCATOR(TypeName)
- JS_DEFINE_ALLOCATOR(TypeName)

When used, they add a type-specific CellAllocator that the Heap will
delegate allocation requests to.

The result of this is that GC objects of the same type always end up
within the same HeapBlock, drastically reducing the ability to perform
type confusion attacks.

It also improves HeapBlock utilization, since each block now has cells
sized exactly to the type used within that block. (Previously we only
had a handful of block sizes available, and most GC allocations ended
up with a large amount of slack in their tails.)

There is a small performance hit from this, but I'm sure we can make
up for it elsewhere.

Note that the old size-based allocators still exist, and we fall back
to them for any type that doesn't have its own CellAllocator.
2023-11-19 12:10:31 +01:00
Andreas Kling
84a8ee01e1 LibJS: Lower HeapBlock size to 4 KiB
This is to prepare for making per-type allocators, since we'll have a
*lot* more HeapBlocks in that world.
2023-11-19 12:10:31 +01:00
Shannon Booth
eca9874e56 LibWeb: Port Element::attribute_changed from DeprecatedString to String
Which as you would expect has a bunch of fallout, but also results in a
whole lot of awkward conversions falling away.
2023-11-19 08:16:34 +00:00
Shannon Booth
6a2a7cad61 LibWeb/LibJS: Avoid GC visit of raw pointers where possible
This is mostly motivated for aesthetics, but also helps avoid some null
checks when we have a NonnullGCPtr<T> or in some cases a T&.
2023-11-19 08:05:45 +00:00
MacDue
4e04f81626 LibWeb: Don't encode painting limitations in RecordingPainter API
The current set of stacking context commands do not encode the
information needed to correctly paint the stacking context, instead,
they're based on the limitations of the current CPU renderer.

Stacking contexts should be able to be transformed by an arbitrary
3D transformation matrix, not just scaled from a source to a destination
rect. The `_with_mask()` stacking context also should not be separate
from the regular stacking context.

```c++
push_stacking_context(
	bool semitransparent_or_has_non_identity_transform,
	float opacity, Gfx::FloatRect const& source_rect,
	Gfx::FloatRect const& transformed_destination_rect,
	Gfx::IntPoint const& painter_location);

pop_stacking_context(
	bool semitransparent_or_has_non_identity_transform,
	Gfx::Painter::ScalingMode scaling_mode);

push_stacking_context_with_mask(
	Gfx::IntRect const& paint_rect);

pop_stacking_context_with_mask(
	Gfx::IntRect const& paint_rect,
	RefPtr<Gfx::Bitmap> const& mask_bitmap,
	Gfx::Bitmap::MaskKind mask_kind, float opacity);
```

This patch replaces this APIs with just:

```c++
push_stacking_context(
	float opacity,
        bool is_fixed_position,
        Gfx::IntRect const& source_paintable_rect,
	Gfx::IntPoint post_transform_translation,
	CSS::ImageRendering image_rendering,
	StackingContextTransform transform,
	Optional<StackingContextMask> mask);

pop_stacking_context()
```

And moves the implementation details into the executor, this should
allow future backends to implement stacking contexts without these
limitations.
2023-11-18 19:32:31 +01:00
MacDue
848b0d9c81 LibGfx: Add Gfx::extract_2d_affine_transform(Matrix4x4) helper 2023-11-18 19:32:31 +01:00
MacDue
da00a5cdb5 AK: Add is_owned() method to MaybeOwned 2023-11-18 19:32:31 +01:00
Sam Atkins
69afb43922 LibWeb: Add ref test for background-repeat
This is adapted from one of our existing test pages.
2023-11-18 15:08:21 +00:00
Sam Atkins
d10f4a8590 LibWeb: Add ref test for general CSS background properties
This is an adaptation of the "misc/backgrounds.html" file in the
Serenity image. It tests a lot of background-related properties that we
otherwise have no tests for.
2023-11-18 15:08:21 +00:00
hanaa12G
1f0149e5a6 LibLine: Reset state after invalid character in DSR response
While parsing DSR response, we might encounter invalid characters, for
example, when we `cat` a binary file. Previously, we just pushed those
characters in `m_incomplete_data` buffer, which worked fine until we
didn't get a terminating character. We kept increasing coordinate value
and crashed in following assertion.
2023-11-18 18:33:00 +03:30
Aliaksandr Kalenik
7b3559f1c2 LibWeb: Remove navigate() in EventHandler::handle_mouseup()
Before this change `navigate()` was always invoked twice when a link
is clicked:
- From `activation_behavior` callback of `HTMLAnchorElement` during
  event dispatch.
- Directly from `handle_mouseup`.
2023-11-18 15:27:10 +01:00
Aliaksandr Kalenik
4f2a0a3d56 LibWeb: Remove ongoing navigation id check in navigate_to_a_fragment()
It is a mistake to add this early return in fragment navigation because
"ongoing navigation id" is not used during this kind of navigation.

With this change we no longer crash in Acid2 test after reload button
is pressed.
2023-11-18 15:27:10 +01:00
Ali Mohammad Pur
aa73a7c961 Shell: Accept null heredocs in POSIX mode
Fixes #21837.
2023-11-18 16:50:01 +03:30
Ali Mohammad Pur
2eb0a8f3d2 Shell: Expand for loop's iterated expr before iterating over it
This only applies to the POSIX mode.
Fixes #21715.
2023-11-18 16:50:01 +03:30
Sam Atkins
b74f5b1ca1 Meta: Publish dumped ref-test images as an Azure CI artifact
Whenever the tests produce a `test-dumps` directory, publish the files
in it as an artifact. This lets us peek at the screenshots and see
what's mismatched, instead of just having to guess.
2023-11-18 07:49:59 -05:00
Sam Atkins
edaa5061c4 headless-browser: Add flag to dump screenshots of failing ref-tests
When the `--dump-failed-ref-tests` flag is provided, screenshots of the
actual and reference pages will be placed in
`Build/lagom/ladbybird/test-dumps`. This makes it a lot easier to spot
what's wrong with a failing test. :^)
2023-11-18 07:49:59 -05:00
Lachlan Jowett
4f5824cbd0 DisplaySettings: Desktop crash when non-image file type is used
If the user selects an non-image file
as their background, then at next
startup the desktop crashes.
2023-11-18 11:21:32 +00:00
Lucas CHOLLET
1afdf7f3c7 LibGfx/TIFF: Take the TIFF value by rvalue reference in handle_tag() 2023-11-18 11:14:37 +00:00
Lucas CHOLLET
4ab2903e25 LibGfx/TIFF: Make TIFFLoadingContext::handle_tag be a free function
And move it to another file. This code is going to be generated soon, so
let's put it in another file.
2023-11-18 11:14:37 +00:00
Lucas CHOLLET
34d91dec5b LibGfx/TIFF: Extract metadata-related definition to their own file 2023-11-18 11:14:37 +00:00
Lucas CHOLLET
1d1e7abba7 LibGfx/TIFF: Put the TIFFLoadingContext class in a TIFF namespace 2023-11-18 11:14:37 +00:00
Lucas CHOLLET
b78f93d0b5 LibGfx/TIFF: Put metadata fields in their own struct 2023-11-18 11:14:37 +00:00
Martin Janiczek
864e83079c AK: Add randomized tests for BuiltinWrappers 2023-11-18 10:01:29 +01:00
Martin Janiczek
8942041eee AK: Test is_ascii, to_ascii_*case over random Unicode samples 2023-11-18 10:01:29 +01:00
Martin Janiczek
65df1cd22c AK: Add randomized tests for Bitmap
These tests found the issue fixed in #21409 (but randomized test runner
wasn't merged yet).
2023-11-18 10:01:29 +01:00
Martin Janiczek
a00b4a5c1f AK: Add roundtrip tests for BitStream 2023-11-18 10:01:29 +01:00
Martin Janiczek
c802971f93 AK: Add liveness tests for BinarySearch 2023-11-18 10:01:29 +01:00
Martin Janiczek
1452693183 AK: Add randomized tests for BinaryHeap 2023-11-18 10:01:29 +01:00
Martin Janiczek
b56e022ce8 AK: Add roundtrip fuzzer for Base64 2023-11-18 10:01:29 +01:00
Martin Janiczek
6c1626e83b AK: Add tests for AllOf and AnyOf 2023-11-18 10:01:29 +01:00
Martin Janiczek
0465ba242b LibCompress: Upgrade compression fuzzer into a roundtrip fuzzer 2023-11-18 10:01:29 +01:00