Commit graph

49050 commits

Author SHA1 Message Date
Tim Ledbetter 72ea046b68 AK: Add option to the string formatter to use a digit separator
`vformat()` can now accept format specifiers of the form
{:'[numeric-type]}. This will output a number with a comma separator
every 3 digits.

For example:

`dbgln("{:'d}", 9999999);` will output 9,999,999.

Binary, octal and hexadecimal numbers can also use this feature, for
example:

`dbgln("{:'x}", 0xffffffff);` will output ff,fff,fff.
2023-04-11 13:03:30 +02:00
Tim Schumacher 605b4e96a8 readelf: Pledge map_fixed for loading ELFs 2023-04-11 06:45:08 -04:00
Daniel Bertalan 5ca1bd55a0 Toolchain: Move GDB build to a separate script
Target GDB is only used for debugging the kernel, which is not relevant
to most people. Starting with 924758c6f8, GDB would always be built
as part of the toolchain if the user didn't have it installed. This is
unnecessary.

This commit adds a separate script for building GDB, which the user
needs to explicitly invoke. A message is added to Meta/debug-kernel.sh
which alerts the user to this fact.
2023-04-11 06:44:13 -04:00
Fabian Dellwing 550635164d Tests+LibTLS: Use TRY_OR_FAIL for TestTLSHandshake 2023-04-11 06:40:33 -04:00
Jelle Raaijmakers 48d5cde299 Tubes: Remove unused includes 2023-04-11 06:38:18 -04:00
Jelle Raaijmakers be303facb8 3DFileViewer+Tubes: Add map_fixed to pledges
Both applications eventually reach LibGPU's loading of a dynamic library
(e.g. LibSoftGPU) which requires this pledge.

The pledge was always required, but went unchecked until 01318d8f9b.
2023-04-11 06:38:18 -04:00
Tim Schumacher dea65e33b4 LibELF: Remove leftover i386 entry files 2023-04-11 08:15:36 +02:00
Liav A e931b2ecd9 SystemMonitor: Handle zombie processes properly
SystemMonitor had a bug in which it would crash in case there are zombie
processes left in the system.
The fix for this is to check if a process has no threads (which will
indicate that the process is a zombie and is waiting to be reaped), and
if that's the case, artificially create a thread row that is just enough
to represent the zombie process.
2023-04-10 11:25:01 -06:00
Tim Schumacher dca56ce1cb Ports/lrzip: Switch to the actual preconfigured release tarball
This avoids us having to run autoconf ourselves, resulting in a nice and
deterministic source package.
2023-04-10 16:31:54 +02:00
Timothy Flynn d0e18b8a17 LibWeb: Convert video control dimensions from CSSPixels to DevicePixels
Rather than storing static DevicePixels dimensions, treat the desired
pixel sizes as CSSPixels and convert them to DevicePixels.

This was originally developed on a mac with a device-to-CSS-pixel ratio
of 2. Running it on another machine with a ratio of 1 made the controls
appear huge.
2023-04-10 10:15:48 -04:00
Liav A d05d938e73 LibC: Properly implement the futimens function
Use the new futimens syscall to ensure futimens can actually work.
This change for example allows a user to run "touch non-existing-file"
without getting any error, as expected.
2023-04-10 10:21:28 +02:00
Liav A cbf78975f1 Kernel: Add the futimens syscall
We have a problem with the original utimensat syscall because when we
do call LibC futimens function, internally we provide an empty path,
and the Kernel get_syscall_path_argument method will detect this as an
invalid path.

This happens to spit an error for example in the touch utility, so if a
user is running "touch non_existing_file", it will create that file, but
the user will still see an error coming from LibC futimens function.

This new syscall gets an open file description and it provides the same
functionality as utimensat, on the specified open file description.
The new syscall will be used later by LibC to properly implement LibC
futimens function so the situation described with relation to the
"touch" utility could be fixed.
2023-04-10 10:21:28 +02:00
Cameron Youell 71e665f0f9 Settings: Improve default window size
Before, one icon was hidden slightly out of sight and there was a
scrollbar.
2023-04-09 21:35:34 -06:00
Cameron Youell ef5cca71dc CertificateSettings: Update to be more consistent with other settings 2023-04-09 21:35:34 -06:00
Kemal Zebari 0060b8c4e5 Browser: Have BookmarksBarWidget signal bookmark changes for Tab
This fixes an issue with a tab not updating its bookmark button when
we either edit or delete a bookmark and the tab happens to be on the
same page associated with the bookmark URL. `BookmarksBarWidget`
"signals" a `Tab` object of any bookmark changes, where it will
update the bookmark button depending on if the current URL is an
existing bookmark or not.
2023-04-09 21:34:20 -06:00
Cameron Youell 86781f0c08 Documentation: Update readlink.md to use LibFileSystem api 2023-04-09 20:58:54 -06:00
Cameron Youell 58af4c85a4 KeyboardSettings: Port to Core::File 2023-04-09 20:58:54 -06:00
Cameron Youell 03008ec4e0 Tests: Use FileSystem instead of DeprecatedFile 2023-04-09 20:58:54 -06:00
Cameron Youell 1c54c8a01c ConfigureComponents: Use FileSystem instead of DeprecatedFile 2023-04-09 20:58:54 -06:00
Cameron Youell 97cc2b33b7 Ladybird: Use FileSystem instead of DeprecatedFile 2023-04-09 20:58:54 -06:00
Cameron Youell 7734eba03f Piano+LibAudio: Port to Core::File 2023-04-09 20:58:54 -06:00
Liav A fb8d4b7032 Kernel/Memory: Explain better why we don't use the first 1 MiB on x86_64 2023-04-09 19:40:45 -06:00
huttongrabiel ad5abc9a8f DisplaySettings: Use FileSystemAccessServer instead of FilePicker
Make a call to the FileSystemAccessServer instead of using FilePicker to
select a new wallpaper in BackgroundSettings.
2023-04-09 18:19:57 -06:00
Rodrigo Tobar 150ffc7336 Tests: Add tests for sed utility
While the tests for sed itself are simple to begin with, some
infrastructure was needed to make them simple.

Firstly, there was no home for tests for the applications under
Utilities, so I had to create a new subdirectory under Tests to host
them.

Secondly, and more importantly, there was previously no easy way to
launch an executable and easily feed it with data for its stdin, then
read its stdout/err and exit code. Looking around the repo I found that
the JS tests do a very similar thing though, so I decided to adapt that
solution for these tests, but with the higher purpose of someday moving
this new Process class to LibCore/Process, where the existing spawn
helpers are still very low level, and there is no representation of a
Process object that one can easily interact with.

Note that this Process implementation is very simple, offers limited
functionality, and it doesn't use the EventLoop, so it can break on long
inputs/outputs depending on the executable behavior.
2023-04-09 18:09:23 -06:00
Rodrigo Tobar 41fa1a1461 Utilities: Add more commands, addresses, spaces, cmdline parsing to sed
The initial version of sed implements only the `s` command (given on the
command line) applied to all lines of the input file. While this is
probably the most common scenario that people use sed with in the wild,
it's limited in several ways:

 * `s` is only one of the many commands that sed is meant to implement.
 * Commands may take one or two addresses that limits its applicability
   to input lines.
 * Commands in general operate over the "pattern" and "hold" spaces
   rather than blindly over input lines.
 * Command line parameters include specifying a script file, and
   optionally input file(s) and/or a script to execute.

This commit implements a big portion of these missing features:

 * It adds support for parsing *almost* all commands and their
   arguments.
 * It also implements the execution of a big portion of the commands.
 * It adds support for parsing the optional addresses that prefix a
   command, and enables/disables commands based on these address ranges.
 * It implements the pattern and hold spaces, which are the source of
   input/output for most of the commands.
 * It improves the command line argument handling to receive a script
   file, potentially multiple execution scripts, and optional input
   files.

Some know missing functionality:

 * The `{` and `}` commands are not supported yet.
 * Pattern-based addresses are not supported yet.
 * Labels and branches are parsed, but not supported at runtime.
2023-04-09 18:09:23 -06:00
Rodrigo Tobar 5a8373c6b9 LibCore: Fix corner case for files without newlines
When BufferedFile.can_read_line() was invoked on files with no newlines,
t incorrectly returned a false result for this single line that, even
though doesn't finish with a newline character, is still a line. Since
this method is usually used in tandem with read_line(), users would miss
reading this line (and hence all the file contents).

This commit fixes this corner case by adding another check after a
negative result from finding a newline character. This new check does
the same as the check that is done *before* looking for newlines, which
takes care of this problem, but only works for files that have at least
one newline (hence the buffer has already been filled).

A new unit test has been added that shows the use case. Without the
changes in this commit the test fails, which is a testament that this
commit really fixes the underlying issue.
2023-04-09 18:09:23 -06:00
stelar7 371974ed4a LibCrypto: Add PBKDF2 2023-04-09 17:05:18 -06:00
Matthew Olsson 0a220a19da LibWeb: Set up the DefaultController when constructing a WritableStream 2023-04-10 00:45:03 +02:00
Matthew Olsson 58f3009faa LibWeb: Implement WritableStreamDefaultWriter.write() 2023-04-10 00:45:03 +02:00
Matthew Olsson 48b67e41f0 LibWeb: Accept a JS::Value for size in enqueue_value instead of a double
This matches what the spec does, and consolidates all of the size-
related errors in one spot instead of distributing them throughout the
various uses of enqueue_value_with_size()
2023-04-10 00:45:03 +02:00
Matthew Olsson 1f7f63ae5a LibWeb: Move Streams/QueueOperations.h to Streams/AbstractOperations.h
This made more sense in the beginning, but now AbstractOperations.h is
so large that there isn't much benefit. This will resolve some ugly
include order issues in the coming commits.
2023-04-10 00:45:03 +02:00
Timothy Flynn edf85d39c6 LibWeb: Port HTMLVideoElement to play videos with Video::PlaybackManager
This has several advantages over the current manual demuxing currently
being performed. PlaybackManager hides the specific demuxer being used,
which will allow more codecs to be added transparently to LibWeb. It
also provides buffering and controls playback rate for us.

Further, it will allow us to much more easily implement the "media
timeline" to render a timestamp and implement seeking.
2023-04-09 23:55:05 +02:00
Timothy Flynn 7132047c92 LibVideo: Add a forwarding header
And change some non-plain structs to classes for consistency.
2023-04-09 23:55:05 +02:00
Timothy Flynn 918ed5c920 LibVideo: Add a getter for the PlaybackManager's selected track 2023-04-09 23:55:05 +02:00
Timothy Flynn 519b79abde LibVideo: Add a factory to create a PlaybackManager from in-memory data
The demuxer already has such a factory, so this just exposes the same
factory in the PlaybackManager.
2023-04-09 23:55:05 +02:00
Timothy Flynn 3591a13e85 LibVideo+VideoPlayer: Convert playback event handler to callbacks
To pass events from LibVideo's PlaybackManager to interested parties, we
currently dispatch Core::Event objects that outside callers listen for.
Dispatching events in this manner rely on a Core::EventLoop. In order to
use PlaybackManager from LibWeb, change this mechanism to instead use a
set of callbacks to inform callers of events.
2023-04-09 23:55:05 +02:00
Timothy Flynn 0f2b863c01 LibVideo: Initialize primitive member variables in PlaybackManager
Using uninitialized primitives is undefined behavior. In this case, all
videos would autoplay on Serenity, but not play at all on Lagom, due to
some m_playing booleans being uninitialized.
2023-04-09 23:55:05 +02:00
Ben Wiederhake 560133a0c6 Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Matthew Olsson 6bbd920008 LibWeb: Implement WritableStreamDefaultWriter.releaseLock() 2023-04-09 21:45:39 +02:00
Matthew Olsson 5f4da20a56 LibWeb: Implement WritableStreamDefaultWriter.close() 2023-04-09 21:45:39 +02:00
Matthew Olsson 0c441fa7af LibWeb: Implement WritableStreamDefaultWriter.abort() 2023-04-09 21:45:39 +02:00
Matthew Olsson c421b6113c LibWeb: Implement WritableStream.abort() 2023-04-09 21:45:39 +02:00
Matthew Olsson ae2d67c28b LibWeb: Implement WritableStream.getWriter() 2023-04-09 21:45:39 +02:00
Matthew Olsson f358ae1b13 LibWeb: Remove duplicate declaration in Streams/AbstractOperations.h 2023-04-09 21:45:39 +02:00
Aliaksandr Kalenik 47f03c3a9a LibWeb/Fetch: Use a basic filtered response for redirect navigations
Match following change in the spec:
8f109835dc
2023-04-09 19:10:45 +02:00
Ben Wiederhake c94924691d Ports: Make libksba/libassuan/ntbtls use Serenity's gpg-error-config
This is likely because we usually used the host's version of the file.
I happen to use a newer libgpg-error (which is relevant because that
particular executable has been renamed, so my system no longer contains
a file of the name gpg-error-config), which revealed this latent bug.
2023-04-09 18:57:49 +02:00
Liav A 5a94e8dfd0 Kernel: Ensure jailed processes can be reaped by a jailed parent process
We were detaching from the jail process list too early. To ensure we
detach properly, leverage the remove_from_secondary_lists method
so the possibly jailed parent process can still see the dying process
and therefore clean it properly.
2023-04-09 18:49:01 +02:00
MacDue 67aceb6c67 Base: Add canvas clip path test page 2023-04-09 18:42:45 +02:00
MacDue 20e9213cc4 LibWeb: Add initial implementation of CRC2D.clip()
This allows clipping your drawing by any path you like! To do this
all painting has been wrapped around a new draw_clipped() helper
method, which handles the clipping before/after painting.

Note: This clipping is currently missing support for intersecting
clip paths.
2023-04-09 18:42:45 +02:00
MacDue 92d9b6edb8 LibWeb: Add simple canvas path clipper
This adds CanvasPathClipper and ScopedCanvasPathClip. These allow
clipping the canvas by some arbitrary path.

This initial implementation is fairly naive, with a good few
allocations, though this can probably be improved in future.
2023-04-09 18:42:45 +02:00