Commit graph

51693 commits

Author SHA1 Message Date
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
Timothy Flynn 421aa8da1e Meta: Document that clang-15 is required, and update the compiler checks
We require clang-15 for consteval.
2023-06-21 06:49:47 -04:00
Tim Ledbetter b4939295c2 Base: Remove outdated exit values section from groupadd man page 2023-06-21 12:27:46 +02:00
Tim Ledbetter 09787dbf27 groupadd: Add -U option for adding members to a new group 2023-06-21 12:27:46 +02:00
Shannon Booth 464e428e94 LibWeb/Tests: Add basic tests for {ByteLength,Counting}QueuingStrategy 2023-06-21 12:27:04 +02:00
Shannon Booth f86c3ab148 LibWeb: Implement ByteLengthQueuingStrategy highWaterMark property 2023-06-21 12:27:04 +02:00
Shannon Booth c9941ba95b LibWeb: Implement CountQueuingStrategy highWaterMark property 2023-06-21 12:27:04 +02:00
Shannon Booth 0d714ad165 LibWeb: Add IDL definition for Web::Streams::QueuingStrategyInit
This is used in the constructor for ByteLengthQueuingStrategy and
CountQueuingStrategy.
2023-06-21 12:27:04 +02:00
Jelle Raaijmakers 4a86861a9d Kernel: Set audio sample rate to 44.1 KHz by default
Ideally, we would want the audio controller to run a channel at a
device's initial sample rate instead of hardcoding 44.1 KHz. However,
most audio is provided at 44.1 KHz and as long as `Audio::Resampler`
introduces significant audio artifacts, let's set a sensible sample
rate that offers a better experience for most users.

This can be removed after someone implements a higher quality
`Audio::Resampler`.
2023-06-21 12:26:32 +02:00
Jelle Raaijmakers 2133bae1a4 Kernel: Move AC'97 to its own subdirectory 2023-06-21 12:26:32 +02:00
Jelle Raaijmakers 5080419b61 Kernel: Do not set a default sample rate for AC'97
Let's use the device's initial sample rate as our active sample rate and
work from there.
2023-06-21 12:26:32 +02:00
Caoimhe 5ef01e562a LibWeb: Generate JavaScript bindings for CSSKeyframesRule
This one also needs a bit of work, but it's a nice start.
2023-06-21 12:26:22 +02:00
Caoimhe e3612708c7 LibWeb: Generate JavaScript bindings for CSSKeyframeRule
We still need to do a bit of work. For example: `set_key_text` isn't
implemented due to its requirements being quite complex, but it's
a start.
2023-06-21 12:26:22 +02:00
Tim Ledbetter f02ccffaa8 WebServer: Show the correct port when using port 0
Specifying port 0 on the command line causes WebServer to select a
random available port. We now show the port WebServer is actually
using rather than assuming it is the same as the command line argument.
2023-06-21 08:35:44 +02:00
Lucas CHOLLET e5685078c1 Meta: Add a gdb pretty-printer for Optional 2023-06-21 06:15:35 +02:00
Andi Gallo 5bd9f4c31c LibWeb: Add undistributable space to GRID{MIN, MAX} instead of content
Adding undistributable space right before setting the content width is
incorrect when it's a percentage. Follow the specification and add it to
GRIDMIN and GRIDMAX instead.
2023-06-21 06:15:04 +02:00
Aliaksandr Kalenik a8211abc1e LibWeb: Support CSS functions other than calc() for grid sizes
Makes grid size parser to handle not only calc() but min(), max() and
other CSS functions we support.
2023-06-21 06:14:51 +02:00
Timothy Flynn afe53a4856 Ladybird: Respect the audio channel configuration and buffer size
We are currently forcing audio to play with a sample size of 16 bits. We
are also feeding the output audio device a hard-set amount of samples
without considering the actual size of its sample buffer. This would
cause a wide array of issues when playing audio elements. On my Linux
machine, we would hear some cracking; on my macOS machine, audio was
quite garbled.

We now write samples of the size requested by the output audio device.
We also limit the samples we provide to the audio device to however many
bytes are available in its buffer.
2023-06-21 06:14:15 +02:00