Commit graph

51582 commits

Author SHA1 Message Date
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
Timothy Flynn 1c4dd0caad Ladybird+LibWeb+WebConent: Drive audio in Ladybird off the main thread
The main thread in the WebContent process is often busy with layout and
running JavaScript. This can cause audio to sound jittery and crack. To
avoid this behavior, we now drive audio on a secondary thread.

Note: Browser on Serenity uses AudioServer, the connection for which is
already handled on a secondary thread within LibAudio. So this only
applies to Lagom.

Rather than using LibThreading, our hands are tied to QThread for now.
Internally, the Qt media objects use a QTimer, which is forbidden from
running on a thread that is not a QThread (the debug console is spammed
with messages pointing this out). Ideally, in the future AudioServer
will be able to run for non-Serenity platforms, and most of this can be
aligned with the Serenity implementation.
2023-06-21 06:14:15 +02:00
Timothy Flynn 0fd35b4dd8 Meta: Ignore local includes of .moc files
These are generated by Qt and added to the include path automatically by
CMake.
2023-06-21 06:14:15 +02:00
Luke Wilde f4446cdf8c LibWeb: Resolve padding against 0 and not inf for indefinite width more
In particular, in BFC:
- Non-floating, non-replaced elements
- Floating, non-replaced elements
- Floating, replaced elements

The first two regressed in 1d76126abe

The third one seems to have been introduced by this regression, as it
was seemingly copied from compute_width_for_floating_box in
7f9ede07bc
2023-06-21 06:13:05 +02:00
Andreas Kling 0ec522ab54 LibWeb: Don't infer SVG viewBox if width and/or height is zero
The fix here has two parts:
1. Don't use the fallback viewBox at all if we're not in SVG-as-image.
2. Don't make a fallback viewBox with zero width and/or height.

This fixes a crash on Bandcamp pages. Thanks Tim Flynn for reporting!
2023-06-20 20:55:12 +02:00
Aliaksandr Kalenik ffd5b3da16 LibWeb: Implement reload for navigables 2023-06-20 18:30:27 +02:00
Aliaksandr Kalenik 21f39061fd LibWeb: Set 0px fixed size to collapsed auto-fit tracks in GFC
Fixes the issue that before we set base_size and growth_limit of
collapsed tracks to 0px which still allowed them to grow by space
distribution.
2023-06-20 18:24:26 +02:00
Andi Gallo e4d0c077c3 LibWeb: Don't skip width computation for intrinsic table width
The shortcut we put in place didn't resolve percentage widths and
ignored border spacing. We can still return early after we compute the
width per the specifications.
2023-06-20 18:24:19 +02:00
Aliaksandr Kalenik aafa09e7a5 LibWeb: Implement "traverse the history by delta" for traversables 2023-06-20 17:36:44 +02:00
Sam Atkins 0e2684b10f LibWeb: Fix serialization of CSSFontFaceRule
- The check for `local()` sources wasn't working, and output `local()`
  every time. Since we don't parse `local()` yet, let's just always
  output a regular URL source.
- Put a space between the URL and the `format()`.
- Stop double-quoting the format string.
2023-06-20 15:50:26 +01:00
Andreas Kling c808f6c637 LibWeb: Don't use BFC auto height for non-BFC abspos elements
While CSS 2.2 does tell us to use the "auto height for BFC roots"
calculation when resolving auto heights for abspos elements, that
doesn't make sense for other formatting context roots, e.g flex.

In lieu of implementing the entire new absolute positioning model from
CSS-POSITION-3, this patch borrows one small nugget from it: using
fit-content height as the auto height for non-BFC-root abspos elements.
2023-06-20 13:42:31 +02:00
Andreas Kling 38a6b7ad3d LibWeb: Don't assert when flex-item has align-self: end
We were missing the code to convert this to `align-items: end`.
2023-06-20 13:26:41 +02:00