Commit Graph

51217 Commits

Author SHA1 Message Date
Andreas Kling
358a4fe3cb Tests/LibWeb: Update rebaseline-libweb-test for path changes 2023-06-10 21:46:33 +02:00
Andreas Kling
69c33bd4ca LibGfx/OpenType: Load x-height metrics from OS/2 table if available
Before this change we always returned the font's point size as the
x-height which was basically never correct.

We now get it from the OS/2 table (if one with version >= 2 is available
in the file). Otherwise we fall back to using the ascent of the 'x'
glyph. Most fonts appear to have a sufficiently modern OS/2 table.
2023-06-10 21:46:33 +02:00
Andi Gallo
8090adf268 LibWeb: Add partial implementation of border conflict resolution
Fix handling of border style specified per column as well.
2023-06-10 11:17:21 +02:00
Andi Gallo
6c2712764d LibWeb: Add table-column-group to layout tree dump 2023-06-10 11:17:21 +02:00
Andi Gallo
48706742d8 LibWeb: Fix remove_irrelevant_boxes
It's supposed to remove children of table-column-group which are *not*
table-column, we were doing the opposite.
2023-06-10 11:17:21 +02:00
Tim Ledbetter
23af2cfbc5 Base: Add man page for pkill 2023-06-10 07:35:52 +02:00
Tim Ledbetter
1e21e95a1b pkill: Add --ignore-case as an alias for the -i option 2023-06-10 07:35:52 +02:00
Tim Ledbetter
69b6c6f62c pkill: Add -x option to only select exact matches 2023-06-10 07:35:52 +02:00
Tim Ledbetter
a253be6abf pkill: Add -U option to filter matches by UID or login name 2023-06-10 07:35:52 +02:00
Tim Ledbetter
caa7edff92 pkill: Add -c option to print the number of matches 2023-06-10 07:35:52 +02:00
Tim Ledbetter
6753cf8b20 pkill: Print errors when killing a process to stderr 2023-06-10 07:35:52 +02:00
Lucas CHOLLET
e252b6e258 LibGfx/JPEG: Use a more aggressive inline policy
Some of these functions can be called millions of times even for images
of moderate size. Inlining these functions really helps the compiler and
gives performance improvements up to 10%.
2023-06-10 07:30:02 +02:00
Lucas CHOLLET
5a0d702f21 LibGfx/JPEG: Avoid the copy of each scan
Inside each scan, raw data is read with the following rules:
- Each `0x00` that is preceded by `0xFF` should be discarded
- If multiple `0xFF` are following, only consider one.

That, plus the fact that we don't know the size of the scan beforehand
made us put a prepared stream in a vector for an easy, later on, usage.

This patch remove this duplication by realizing these operations in a
stream-friendly way.
2023-06-10 07:30:02 +02:00
Lucas CHOLLET
9a317267de LibGfx/JPEG: Make JPEGLoadingContext::current_scan optional
This allows us to construct a context without calling `Scan`'s
constructor.
2023-06-10 07:30:02 +02:00
Lucas CHOLLET
df63e14da7 LibGfx/JPEG: Introduce JPEGStream
This class is similar to some extent to an implementation of `Stream`,
but specialized for JPEG reading.

Technically, it is composed of a `Vector` to bufferize the input and
provides a simple interface to read bytes.

This patch aims for a future better and specialized control over the
input data. The encapsulation already allows us to get rid of the last
`seek` in the decoder, thus the ability to use the decoder with a raw
`Stream`.

As it provides faster `read` routines, this patch already reduces time
spend on reading.
2023-06-10 07:30:02 +02:00
Simon Wanner
a2efecac03 LibJS: Parse slashes after reserved identifiers correctly
Previously we were unable to parse code like `yield/2` because `/2`
was parsed as a regex. At the same time `for (a in / b/)` was parsed
as a division.

This is solved by defaulting to division in the lexer, but calling
`force_slash_as_regex()` from the parser whenever an IdentifierName
is parsed as a ReservedWord.
2023-06-10 07:20:33 +02:00
Karol Kosek
b0bd1e5eb5 MailSettings: Convert MailSettingsWidget to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
1ad81687e7 TerminalSettings: Convert setting widgets to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
754a5bda7a NetworkSettings: Convert NetworkSettingsWidget to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
956a932a87 KeyboardSettings: Convert KeyboardSettingsWidget to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
90819e2d71 MouseSettings: Convert setting widgets to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
ab8be9aed5 ClockSettings: Convert ClockSettingsWidget to a failable factory 2023-06-10 07:19:06 +02:00
Karol Kosek
e36e465b41 CalendarSettings: Propagate errors when creating CalendarSettingsWidget
We need to add another pair of parenthesizes when propagating an
initialization of ItemListModel, because a comma in a template argument
would work as a separator of macro arguments, leading to a compile
error.
2023-06-10 07:19:06 +02:00
Ali Mohammad Pur
538c308357 LibWasm: Stop passing a nonzero 'mode' to open(..., O_DIRECTORY)
Bionic warns on this, but not passing the mode argument is technically
undefined behaviour (depending on the libc implementation of open), as
our LibC reads `mode` unconditionally (yolo!), just pass a zero to avoid
the UB.
2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
5f999097e5 LibWasm: Implement wasi fd_read 2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
ae9c40451a LibWasm: Implement wasi fd_filestat_get() 2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
f62187ed5d LibWasm: Accept newly-created wasi file descriptors as well 2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
a608e87ff9 LibWasm: Show wasi function arguments and result in debug mode 2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
47248a3511 LibWasm: Keep track of created directory fds in path_create_directory 2023-06-10 07:18:02 +02:00
Ali Mohammad Pur
5121b368cd LibWasm: Implement the random_get() call 2023-06-10 07:18:02 +02:00
Zaggy1024
24ae35086d LibGfx/LibVideo: Check for overreads only at end of a VPX range decode
Errors are now deferred until `finish_decode()` is finished, meaning
branches to return errors only need to occur at the end of a ranged
decode. If VPX_DEBUG is enabled, a debug message will be printed
immediately when an overread occurs.

Average decoding times for `Tests/LibGfx/test-inputs/4.webp` improve
by about 4.7% with this change, absolute decode times changing from
27.4ms±1.1ms down to 26.1ms±1.0ms.
2023-06-10 07:17:12 +02:00
Zaggy1024
873b0e9470 LibGfx/LibVideo: Read batches of multiple bytes in VPX BooleanDecoder
This does a few things:

- The decoder uses a 32- or 64-bit integer as a reservoir of the data
  being decoded, rather than one single byte as it was previously.
- `read_bool()` only refills the reservoir (value) when the size drops
  below one byte. Previously, it would read out a bit-sized range from
  the data to completely refill the 8-bit value, doing much more work
  than necessary for each individual read.
- VP9-specific code for reading the marker bit was moved to its own
  function in Context.h.
- A debug flag `VPX_DEBUG` was added to optionally enable checking of
  the final bits in a VPX ranged arithmetic decode and ensure that it
  contains all zeroes. These zeroes are a bitstream requirement for
  VP9, and are also present for all our lossy WebP test inputs
  currently. This can be useful to test whether all the data present in
  the range has been consumed.

A lot of the size of this diff comes from the removal of error handling
from all the range decoder reads in LibVideo/VP9 and LibGfx/WebP (VP8),
since it is now checked only at the end of the range.

In a benchmark decoding `Tests/LibGfx/test-inputs/4.webp`, decode times
are improved by about 22.8%, reducing average runtime from 35.5ms±1.1ms
down to 27.4±1.1ms.

This should cause no behavioral changes.
2023-06-10 07:17:12 +02:00
Oskar Skog
edd847798a man: Use /bin/Shell as shell in non-POSIX mode
This fixes an issue where man breaks if you symlink `sh` to a different
shell because:
1: The target of the symlink isn't `unveil`ed.
2: The option `--skip--shellrc` isn't understood by other shells while
   at the same time being required for Shell when invoked in POSIX
   compatibility mode.

This also restores the shell used by man to the non-POSIX mode as before
beaae6b420.
2023-06-10 07:14:08 +02:00
Tim Ledbetter
b863332415 pgrep: Add -O option to filter processes by age
This option allows the user to specify a number of seconds. Only
processes older than the given number of seconds are selected.
2023-06-10 07:13:25 +02:00
Tim Ledbetter
d03aaddb55 pgrep: Add -o option to display the oldest matching process only 2023-06-10 07:13:25 +02:00
Tim Ledbetter
47b530fa71 pgrep: Add -n option to display the newest matching process only 2023-06-10 07:13:25 +02:00
Tim Ledbetter
f95dccdb45 Kernel+LibCore: Add process creation time to /sys/kernel/processes 2023-06-10 07:13:25 +02:00
Andi Gallo
4d49852454 LibWeb: Distribute cell contribution to all spanned columns
The specification isn't explicit about it, but the contribution we
compute should be distributed to all columns, not just the first one.

The first reason for it is symmetry, it doesn't make sense for the
increased width of the spanning column to only affect the first column
in the span.

The second reason is the formula for the cell contribution, which is
weighted by the non-spanning width of the cell relative to the total
width of the columns in the same row. This only covers a fraction of the
gap, in order to fully cover it we have to add it to all columns in the
span. For this to be exactly the case when the columns don't all have
the same width, we'd have to add additional weighting based on the width
ratios, but given that the specification doesn't suggest it at all we'll
leave it out for now.
2023-06-10 07:10:06 +02:00
Andi Gallo
50df78d2a2 LibWeb: Fix upper limit of span when computing column measures
The maximum span limit has to be inclusive, not exclusive.
2023-06-10 07:10:06 +02:00
Andi Gallo
940d9b98ae LibWeb: Add support for table caption
Adds layout support and the CSS caption-side property.
2023-06-10 07:09:11 +02:00
MacDue
656f72adc0 LibWeb: Use fill_path() to paint <video> play buttons
With this, the play button is nicely antialiased.
2023-06-10 07:08:14 +02:00
Aliaksandr Kalenik
23f6674301 LibWeb: Rename TemporaryTrack to GridTrack in GFC
The word "Temporary" seems to lack any meaningful connection when
applied to grid tracks.
2023-06-10 07:08:01 +02:00
Aliaksandr Kalenik
10cab5fbdb LibWeb: Include gaps in for_each_spanned_track_by_item in GFC
This fixes the issue when left free space is calculated incorrectly
because for_each_spanned_track_by_item does not include gap tracks.
2023-06-10 07:08:01 +02:00
Tim Schumacher
85d14bdc5e Ladybird: Add Userland to the list of include directories
This now matches the Lagom-based Ladybird build and the SerenityOS
build.
2023-06-10 07:06:31 +02:00
Andreas Kling
df1748e1d1 LibWebView: Unbreak spawning WebContent process with valgrind
We now check if the WebContent is executable before passing it to
the valgrind wrapper. We can't rely on exec() to fail here, since it
will always succeed even when passing a bad WebContent path to valgrind.
2023-06-10 07:05:09 +02:00
Xexxa
5f39a3f911 Ladybird: Add "Open File..." to menu 2023-06-09 23:48:57 +02:00
Xexxa
e8af912e30 Ladybird: Add two separators to menus 2023-06-09 23:48:57 +02:00
thankyouverycool
9ecfacaffd LibFileSystemAccessClient: Don't crash when formatting error messages
Since c140b67 ESUCCESS Errors aren't allowed. FSAC was initializing
an ErrorOr<String> arbitrarily to 0 for scope, causing it to hit the
VERIFY().
2023-06-09 19:46:44 +01:00
Peter Brottveit Bock
49b29332f2 AK: Migrate IPv6Address::to_deprecated_string() to ::to_string()
Change the name and return type of
`IPv6Address::to_deprecated_string()` to `IPv6Address::to_string()`
with return type `ErrorOr<String>`.

It will now propagate errors that occur when writing to the
StringBuilder.

There are two users of `to_deprecated_string()` that now use
`to_string()`:

1. `Formatted<IPv6Address>`: it now propagates errors.

2. `inet_ntop`: it now sets errno to ENOMEM and returns.
2023-06-09 19:38:14 +01:00
Peter Brottveit Bock
fdfffe2d8c LibWeb: Use IPv6Address::loopback() instead of parsing "::1"
When comparing an ipv6 address against '::1', then compare against
the value object from `IPv6Address::loopback()`, instead of parsing the
string "::1" to an IPv6Address.
2023-06-09 19:38:14 +01:00