Commit graph

24187 commits

Author SHA1 Message Date
Nico Weber
df6b47609a LibGfx/ICC: Add evaluate() member functions to both curve types 2023-04-11 18:23:07 +02:00
Nico Weber
5df35d030f LibGfx/ICC: Extract sRGB_curve() function
This returns just the tone reproduction curve of the sRGB profile.
2023-04-11 18:23:07 +02:00
Nico Weber
5da9057a8f icc: Extract out_curve_tag() helper function 2023-04-11 18:23:07 +02:00
networkException
b1e43c9ea1 LibWeb: Implement URL.canParse(url, base)
This patch adds an implementation of the URL.canParse(url, base) static
function :^)
2023-04-11 16:28:20 +02:00
networkException
0e552f1d7a LibWeb: Update URL constructor steps to match the specification
This patch adds the API URL parser used by the URL constructor. This
makes the URL constructor steps match the spec again.
2023-04-11 16:28:20 +02:00
networkException
9915fa72fb AK+Everywhere: Use Optional for URLParser::parse's base_url parameter 2023-04-11 16:28:20 +02:00
Tim Ledbetter
994a861019 FileManager: Use a thousands separator for numbers in PropertiesWindow 2023-04-11 13:03:30 +02:00
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
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
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
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
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
7734eba03f Piano+LibAudio: Port to Core::File 2023-04-09 20:58:54 -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
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
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
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
MacDue
ef58062f71 LibGfx: Floor draw origin in fill path implementation
This is done to be consistent with enclosing_int_rect() which is
used elsewhere to work out offsets in PaintStyles. Without this, you
can get an off-by-one in painting.
2023-04-09 18:42:45 +02:00
MacDue
78aad28dba LibGfx: Add Point::to_floored<T>() 2023-04-09 18:42:45 +02:00
MacDue
26e56bdd08 LibGfx: Fix crash due to vector resize in close_all_subpaths()
Since close_all_subpaths() appends while iterating, the vector can
end up being resized and the iterator invalidated. Previously, this
led to a crash/UAF in some cases.
2023-04-09 18:42:45 +02:00
MacDue
064ca625df LibGfx: Add BitmapPaintStyle
This is a simple paint style for filling a path with a bitmap.
2023-04-09 18:42:45 +02:00
Matthew Olsson
5faa0014f2 LibWeb: Implement WritableStream.close() 2023-04-09 18:37:34 +02:00
Tim Schumacher
5f806ec53a LibTest: Add a TRY_OR_FAIL macro
This macro has the usual `TRY` semantics, but instead of returning the
error, it will let the test fail with the formatted error as the fail
message.
2023-04-09 18:27:06 +02:00