Commit graph

51610 commits

Author SHA1 Message Date
Lucas CHOLLET 102fdf6305 AK: Override read_until_filled in FixedMemoryStream
This specialized method allow significant performance improvements for
the user.
2023-06-22 21:32:45 +02:00
Lucas CHOLLET d00a563462 LibGfx/PortableFormat: Write directly to the bitmap
No need to copy the data first to a Vector and then to the Bitmap. We
can skip this unnecessary step.
2023-06-22 21:32:45 +02:00
Daniel d8c1150f6b LibWeb: Respect "no-store" directive in cache-control header 2023-06-22 21:24:23 +02:00
Andreas Kling cd08515957 LibJS/Bytecode: Support named evaluation of anonymous functions 2023-06-22 21:16:17 +02:00
Andreas Kling f4fe9f09a1 LibJS/Bytecode: Perform ShadowRealm evaluations in bytecode when enabled 2023-06-22 21:16:17 +02:00
Andreas Kling 6537ed8fff LibJS/Bytecode: Simplify Bytecode::Interpreter lifetime model
The JS::VM now owns the one Bytecode::Interpreter. We no longer have
multiple bytecode interpreters, and there is no concept of a "current"
bytecode interpreter.

If you ask for VM::bytecode_interpreter_if_exists(), it will return null
if we're not running the program in "bytecode enabled" mode.

If you ask for VM::bytecode_interpreter(), it will return a bytecode
interpreter in all modes. This is used for situations where even the AST
interpreter switches to bytecode mode (generators, etc.)
2023-06-22 21:16:17 +02:00
Andreas Kling 6150960671 Tests: Remove test-bytecode-js
This was meant to be a temporary unit testuntil we could run test-js
in bytecode mode. This has been possible for a long time now, so let's
remove the unnecessary extra program.
2023-06-22 21:16:17 +02:00
Lucas CHOLLET b7c30f3096 image: Support JPEG as an output format 2023-06-22 21:13:04 +02:00
Lucas CHOLLET 226b214142 LibGfx/JPEG: Add a JPEG encoder :^)
This encoder is very naive as it only output SOF0 images and uses
pre-defined Huffman tables.

There is also a small bug with quantization which make using it
over-degrade the quality.
2023-06-22 21:13:04 +02:00
Lucas CHOLLET 503720b574 LibGfx/JPEG: Put generic definitions in a shared header
That file holds information that are used by both a decoder and an
encoder.
2023-06-22 21:13:04 +02:00
Timothy Flynn 3dac2f7e58 LibWeb: Decrease size of the media timeline box a tiny bit
Had this staged and meant to amend 8e3e068d75, as it makes the media
controls look a bit more balanced in size, but forgot to actually
commit.
2023-06-22 14:20:26 -04:00
Timothy Flynn 8e3e068d75 LibWeb: Paint the media timeline above the other media controls
It's a little bit of a battle to fit all of the media controls in the
available width of the media element. We currently cram everything on
one horizontal line. We've made adjustments to be able to fit it all,
but the controls (in particular the media timeline) are rather squished.

This paints the timeline above the other media controls now. This
provides much more granular control over the playback position when
scrubbing, and makes it much more likely for the timeline to render at
all.
2023-06-22 20:05:19 +02:00
Timothy Flynn b306db359a LibWeb: Begin scrubbing the media timeline and volume on mouse-down
This feels a bit more natural than waiting until the first mouse-move
event to begin scrubbing.
2023-06-22 20:05:19 +02:00
Timothy Flynn f6e10ecbfd Ladybird: Set the sample rate on the audio device's audio format
For example, on https://xboygeniusx.bandcamp.com/album/the-record, a
song with a duration of 03:52 would actually complete in 03:33 on my
machine. This issue only affects Ladybird on Lagom; on Serenity, we
already take the entire 03:52 to play the song.
2023-06-22 18:19:21 +02:00
Aliaksandr Kalenik 2cbc9a6642 LibWeb: Start fleshing out Navigable::choose_a_navigable()
Equivalent of `choose_a_browsing_context` for navigables.
2023-06-22 18:18:50 +02:00
Aliaksandr Kalenik 473848be0e LibWeb: Do not treat size of abspos items as definite
This fixes the issue when size of abspos items is considered to be
resolvable without performing layout which is not correct in the
scenarious when top/right/bottom/left properties are not auto.
2023-06-22 18:18:04 +02:00
Timothy Flynn 1c991e5582 LibWeb: Add missing invocation to forget a media element's tracks
On bandcamp, this missing invocation would cause a playlist to loop one
single track indefinitely.
2023-06-22 14:58:43 +02:00
Shannon Booth 9cb4bf0683 LibWeb: Implement QueuingStrategy for Web::Streams::WritableStream 2023-06-22 06:58:23 +02:00
Shannon Booth 33f6e5d516 LibWeb: Implement Streams AO ExtractSizeAlgorithm(strategy) 2023-06-22 06:58:23 +02:00
Shannon Booth 060c130c82 LibWeb: Implement SetUpReadableByteStreamControllerFromUnderlyingSource 2023-06-22 06:58:23 +02:00
Shannon Booth 9ea597016a LibWeb: Implement Streams AO ExtractHighWaterMark(strategy, defaultHWM) 2023-06-22 06:58:23 +02:00
Shannon Booth e1d71454eb LibWeb: Correct parameter name in Web::Streams::ReadableStream::cancel
This aligns with the name given in the implementation file and is a
better description of what is being passed in.
2023-06-22 06:58:23 +02:00
Shannon Booth 314eeeb9b2 LibWeb: Const qualify Web::Streams::ReadableStream::locked 2023-06-22 06:58:23 +02:00
Shannon Booth 42c102ecb6 LibWeb: Add IDL definition for Web::Streams::QueuingStrategy 2023-06-22 06:58:23 +02:00
Timothy Flynn 9df2d6ee0f LibWeb: Implement scrubbing of the media element timeline and volume
This implements the ability to drag the timeline and volume buttons on
UA-rendered media controls. The two behave a bit differently:

Volume is updated as the user drags the volume button. This isn't a very
expensive operation, so updating in real-time and hearing the volume
change feels nice.

The current time, on the other hand, is not committed until the user
releases the mouse button. Performing a seek every time we get a mouse-
move event is pretty laggy, especially for video. However, we still want
to render updates on the timeline itself (so the position of the button
and the timestamp update as you drag). To do so, we internally pause the
media and override the timestamp provided to the layout node.

In the future, we may be able to seek video periodically to provide some
visual feedback. For example, we can seek after every N seconds of
scrubbing, or when the user pauses scrubbing for a while.
2023-06-22 06:58:07 +02:00
Timothy Flynn bcd222cfae Ladybird+LibWeb+WebContent: Prevent out-of-bounds seeking audio elements
It's currently possible to seek to the total sample count of an audio
loader. We must limit seeking to one less than that count.

This mistake was duplicated in both AudioCodecPluginSerenity/Ladybird,
so the computation was moved to a helper in the base AudioCodecPlugin.
2023-06-22 06:58:07 +02:00
Aliaksandr Kalenik 20edbb70f8 LibWeb: Implement distributing space to tracks beyond limits in GFC
Implements "Distribute space beyond limits" step from:
https://www.w3.org/TR/css-grid-2/#distribute-extra-space
2023-06-22 06:48:12 +02:00
Tim Ledbetter e3ade95d24 pro: Change the download speed reporting interval to 1000 ms
This gives a good balance between update frequency and readability.
2023-06-22 06:46:48 +02:00
Tim Ledbetter 35169ef640 pro: Ensure that progress reporting intervals are respected
The `report_time_in_ms` and `speed_update_time_in_ms` variables
weren't previously being respected. This was causing the progress
display to update too frequently, making it difficult to read.
2023-06-22 06:46:48 +02:00
Timothy Flynn 396655d145 LibJS: Begin implementing console.dir
The intent of the spec is that the output of console.dir is interactable
within the console. Our Printer implementation currently just prints the
provided object as a string, and doesn't check the provided `options`
argument. But having console.dir defined prevents exceptions from being
thrown on real websites.
2023-06-22 06:46:27 +02:00
Timothy Flynn 9f8e5f0b1c LibJS: Sort Console methods in spec order
Easier to compare to the spec side-by-side when everything is in the
same order.
2023-06-22 06:46:27 +02:00
Andi Gallo caa24d0805 LibWeb: Implement top and bottom vertical-align for table cells 2023-06-22 06:45:58 +02:00
Optimoos 4ed7456486 Ping: Add TTL config option and value to output
This change adds the TTL value of the inbound packet to the output of
the userland ping program, bringing it more in line with other common
ping utilities. It also adds the (optional) -t option to configure the
TTL of the outgoing packet if desired.
2023-06-22 00:14:56 +02:00
Tim Ledbetter 16fcbe555e touch: Don't bail immediately on error
Previously, touch would exit immediately if there was an error
changing file permissions. We now print an error to stderr and
continue when an error occurs.
2023-06-22 00:09:26 +02:00
Kristoffer Højelse 05bc98a410 Kernel: Fix panic when switching to out-of-bounds console
This was caused by an off-by-two error.
Fixes #19034
2023-06-21 23:52:34 +02:00
Tim Schumacher cbdd44b6d2 Base: Insert newlines in the checksum(1) synopsis 2023-06-21 23:50:23 +02:00
Andreas Kling 8648355783 LibWeb: Modernize handling of the CSS flex-basis property
Instead of a custom struct, use an AK::Variant for flex-basis.
A flex-basis is either `content` or a CSS size value, so we don't need
anything custom for that.

By using a CSS size, we also avoid having to convert in and out of size
in various places, simplifying the code.

This finally gets rid of the "Unsupported main size for flex-basis"
debug spam. :^)
2023-06-21 20:20:59 +02:00
Aliaksandr Kalenik 8c980cf75b LibWeb: Do not crash inside SVGDecodedImageData on invalid SVG input
Return error when input svg is not valid and SVGSVGElement is not
present in the tree instead of doing svg_root nullptr dereference.

Fixes crash on https://apps.kde.org/en-gb/
2023-06-21 19:10:37 +02:00
Timothy Flynn 33dbfa3281 Ladybird: Detect changes to the default audio device
When the default audio device changes on the host, it's convenient to
automatically switch to that device rather than needing to reload the
page to update.
2023-06-21 19:02:57 +02:00
Andreas Kling 8f927eaa68 LibWeb: Add HTMLDocument class
This class is currently not in the spec, but it *is* still in all the
major browser engines. For compatibility reasons, let's do what other
engines do.

There is discussion about bringing HTMLDocument back into specs:
- https://github.com/whatwg/html/issues/4792
- https://github.com/whatwg/dom/issues/221
2023-06-21 16:30:27 +02:00
Andreas Kling 40e7f64433 LibWeb: Implement most of "destroy a top-level traversable"
Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-06-21 16:26:44 +02:00
Andreas Kling 1b78e0f059 LibWeb: Implement "destroy" operation for documents
This is basically the old "discard" updated for the world of navigables.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-06-21 16:26:44 +02:00
Andreas Kling 7af09481f5 LibWeb: Implement getting "descendant navigables" of a document 2023-06-21 16:26:44 +02:00
Aliaksandr Kalenik 21e383c24f LibWeb: Add content navigable in NavigableContainer
"Each navigable container has a content navigable, which is either a
navigable or null. It is initially null."
2023-06-21 16:26:44 +02:00
Liav A 89a8920764 Kernel: Untie PS2 mouse and keyboard devices from i8042 implementation
To ensure actual PS2 code is not tied to the i8042 code, we make them
separated in the following ways:
- PS2KeyboardDevice and PS2MouseDevice classes are no longer inheriting
  from the IRQHandler class. Instead we have specific IRQHandler derived
  class for the i8042 controller implementation, which is used to ensure
  that we don't end up mixing PS2 code with low-level interrupt handling
  functionality. In the future this means that we could add a driver for
  other PS2 controllers that might have only one interrupt handler but
  multiple PS2 devices are attached, therefore, making it easier to put
  the right propagation flow from the controller driver all the way to
  the HID core code.
- A simple abstraction layer is added between the PS2 command set which
  devices could use and the actual implementation low-level commands.
  This means that the code in PS2MouseDevice and PS2KeyboardDevice
  classes is no longer tied to i8042 implementation-specific commands,
  so now these objects could send PS2 commands to their PS2 controller
  and get a PS2Response which abstracts the given response too.
2023-06-21 05:02:09 -06:00
Liav A d276cac82c Kernel: Re-organize the abstractions around i8042, PS2 and HID concepts
The HIDController class is removed and instead adding SerialIOController
class. The HIDController class was a mistake - there's no such thing in
real hardware as host controller only for human interface devices
(VirtIO PCI input controller being the exception here, but it could be
technically treated as serial IO controller too).

Instead, we simply add a new abstraction layer - the SerialIO "bus",
which will hold all the code that is related to serial communications
with other devices. A PS2 controller is simply a serial IO controller,
and the Intel 8042 Controller is simply a specific implementation of a
PS2 controller.
2023-06-21 05:02:09 -06:00
Fabian Dellwing a14dc9b569 sed: Fix unveil error for every run
`FileSystem::absolute_path()` does `stat` the file, this commit runs
all `absolute_path` calls before touching the veil to make sure this
works as intended.
2023-06-21 06:53:29 -04:00
Daniel Bertalan 3ee908df27 Meta: Always use the default host compiler for the toolchain on macOS
GCC's build fails in `libisl`'s configure step if `CC` is set to
Homebrew Clang with the message "Link Time Optimisation is not
supported". This is likely due to the fact that it tries to use ranlib
from Xcode, which is not compatible with the newer LLVM version's
bitcode format.

The toolchain build runs after `pick_host_compiler` is called, which
selects Homebrew Clang if the installed Xcode version is too old. We
need to unset `CC` and `CXX` for the toolchain build to sidestep the
issue.
2023-06-21 06:49:54 -04:00
Timothy Flynn 2714f99c1c AK: Update clang workaround for consteval StringView literals
The underlying issue was fixed in clang-15. See:
a4f8590247

However, Apple and BSD distributions do not yet have this patch.
2023-06-21 06:49:47 -04:00
Timothy Flynn 9f907ebb43 CI: Update Wasm pipeline to use emscripten 3.1.25
This is required for LLVM 15 support.
2023-06-21 06:49:47 -04:00