Commit graph

49071 commits

Author SHA1 Message Date
Timothy Flynn
4797f07883 LibWeb: Begin detecting the end of an HTMLMediaElement media resource 2023-04-11 19:27:55 +02:00
Timothy Flynn
33047b38ec LibVideo: Add a hook to notify clients upon reaching end of the stream 2023-04-11 19:27:55 +02:00
Timothy Flynn
fe66490399 LibWeb: Paint a media timeline on HTMLVideoElement layout nodes 2023-04-11 19:27:55 +02:00
Timothy Flynn
d5412f4e78 LibWeb: Move VideoPaintable's cached mouse position to HTMLVideoElement
The layout node, and therefore the painting box, is frequently destroyed
and recreated. This causes us to forget the cached mouse position we use
to highlight media controls. Move this cached position to the DOM node
instead, which survives relayout.
2023-04-11 19:27:55 +02:00
Timothy Flynn
cdf4c410bf LibWeb: Tweak the color used for hovered media controls
The link color is what closely resembled the color I was going for on
the machine I originally developed the controls on. But turns out this
is a very dark blue on most Serenity themes. Instead, hard-code the
original intended color, which is a lighter blue.
2023-04-11 19:27:55 +02:00
Timothy Flynn
59848086ba Base: Add the current playback position to the video test page 2023-04-11 19:27:55 +02:00
Timothy Flynn
3d9106b1b5 LibWeb: Begin tracking HTMLMediaElement playback positions
There are several playback positions to be tracked, depending on the
state of the media element.
2023-04-11 19:27:55 +02:00
Timothy Flynn
6b51c3c1ce LibWeb: Report HTMLMediaElement duration with sub-second accuracy
We currently use Time::to_seconds() to report a video's duration. The
video, however, may have a sub-second duration. For example, the video
used by the video test page is 12.05 seconds long.
2023-04-11 19:27:55 +02:00
Timothy Flynn
2ef4a51c39 LibWeb: Move dispatching timeupdate events to a helper for tracking
For some media APIs, we will need to know whether we are currently in an
event handler for the timeupdate event, and the last time we fired the
event.
2023-04-11 19:27:55 +02:00
Nico Weber
6c7b3c56f2 icc: Print if a curve looks like the sRGB curve 2023-04-11 18:23:07 +02:00
Nico Weber
fe8c0292ad icc: Use {: >{}}, "", indent_amount for indenting
No behavior change.
2023-04-11 18:23:07 +02:00
Nico Weber
5d14a0081e icc: Make out_curve_tag() fallible 2023-04-11 18:23:07 +02:00
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
Coderdreams
38bdf4d159 Meta: Do not require Tmux for lagom gdb 2023-04-11 07:16:25 -04:00
Tim Ledbetter
994a861019 FileManager: Use a thousands separator for numbers in PropertiesWindow 2023-04-11 13:03:30 +02:00
Tim Ledbetter
54539c42c2 AK: Allow human_readable_size_long to use a thousands separator 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
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