Commit graph

23764 commits

Author SHA1 Message Date
MacDue ceffca9a75 WebDriver: Use Core::Process::spawn() to launch browsers 2023-03-24 22:06:38 +00:00
MacDue 2aa8c9950e FileManager: Use GUI::Process::spawn_or_show_error() to open terminals 2023-03-24 22:06:38 +00:00
MacDue d27a513dc5 LibCore: Add KeepAsChild option to Core::Process::spawn()
This now allows spawning a process without disowning.
2023-03-24 22:06:38 +00:00
MacDue b3edd83e0a LibGUI: Allow passing working directory to spawn_or_show_error() 2023-03-24 22:06:38 +00:00
MacDue 62e8360dcf LibCore: Fix memory leak in Core::Process::spawn()
Previously the spawn_actions were not destroyed, which leaked a
little memory.
2023-03-24 22:06:38 +00:00
Andreas Kling aeb8224ec8 LibCompress: Speed up deflate decompression by ~11%
...simply by using LittleEndianInputBitStream::read_bit() instead of
read_bits(1). This puts us on the fast path for single-bit reads.

There's still lots of money on the table for bigger optimizations to
claim here, just picking an embarrassingly low-hanging fruit. :^)
2023-03-24 17:08:35 +01:00
Jelle Raaijmakers ea9707ec29 LibCrypto: Update entire blocks in SHA*::update()
Instead of going byte by byte, copy entire blocks at once and only check
if we need to update the state once per block. This pretty much
eliminates `::update()` from profiles and measurably improves
performance for utilities like `sha256sum`.
2023-03-24 15:28:10 +00:00
Jelle Raaijmakers 88b0b80aab LibCrypto: Stop shadowing i variable 2023-03-24 15:28:10 +00:00
Cameron Youell c048cf2004 Libraries: Convert DeprecatedFile usages to LibFileSystem 2023-03-24 10:58:43 +00:00
Cameron Youell 1dc3ba6ed5 Applications: Convert DeprecatedFile usages to LibFileSystem 2023-03-24 10:58:43 +00:00
MacDue dd77b878b3 LibWeb: Add scalable radio buttons (with theme/accent-color support)
These are similar to the checkboxes now (though no SDFs here all just
plain AA painter).
2023-03-24 09:57:48 +00:00
MacDue 56bc653e72 LibWeb: Move checkbox color palette computation to helper header
This will allow these to be more easily reused for other inputs.

Note that we need this as the base LibGfx pallet does not quite have
the required range for HTML inputs (though these shades are based off
the LibGfx palette).
2023-03-24 09:57:48 +00:00
MacDue 98040c508f LibGfx: Handle signed distance field edges better
Small change to treat pixels outside the signed distance field bitmap
as outside the shape.
2023-03-24 09:57:48 +00:00
Lucas CHOLLET fcaa535dec LibGfx/PortableFormat: Use static_cast instead of C-style casts 2023-03-24 10:56:58 +01:00
Lucas CHOLLET fd04b2dc9b LibGfx/PortableFormat: Propagate errors from decode() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 7ec310384a LibGfx/PortableFormat: Propagate errors from read_image_data() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 2356b48f13 LibGfx/PortableFormat: Propagate errors from read_magic_number() 2023-03-24 10:56:58 +01:00
Lucas CHOLLET f96b61fdd8 LibGfx: Remove unused class Streamer 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 7cafd7d177 LibGfx/PortableFormat: Port to Stream
Each one of `[PBM, PGM, PPM]Loader` used yet another stream-like relic.
This patch ports all of them to `AK::Stream`.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET b9574c180e LibGfx/PortableFormat: Use finite loops in read_image_data
The `read_image_data` function of each one of[PBM, PGM, PPM]Loader use
the same structure to read an image. This patch harmonizes the three
functions and use finite loops instead of reading until EOF. It allows
to quit early on bloated file, but it's mainly done for refactoring
purpose.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET 24087ef6eb LibGfx: Return true from PortableImageDecoderPlugin::initialize()
Reading the two magic bytes are always done in `decode()` by calling
`read_magic_number()`. So no need to read it twice.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET 4554d10fe5 LibGfx: Remove unused functions load_from_memory and load_impl 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 05e6ed6ecb LibGfx/PortableFormat: Propagate errors from some read_* functions
These functions are:
 - read_width
 - read_height
 - read_max_val
2023-03-24 10:56:58 +01:00
Lucas CHOLLET bab2113ec1 LibGfx/PortableFormat: Make read_whitespace return an ErrorOr 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 74f893e9f4 LibGfx/PortableFormat: Make read_comment return an ErrorOr 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 964172754e LibGfx/PortableFormat: Don't accept comments that don't start with # 2023-03-24 10:56:58 +01:00
Lucas CHOLLET 9052a6febf LibGfx/PortableFormat: Simplify read_number signature
The function signature goes from:
`bool read_number(Streamer& streamer, TValue* value)`
to
`ErrorOr<u16> read_number(Streamer& streamer)`

It allows us to, on one hand use `ErrorOr` for error propagation,
removing an out parameter in the meantime, and on the other hand remove
the useless template.
2023-03-24 10:56:58 +01:00
Lucas CHOLLET 387894cdf2 LibGfx: Make PortableImageDecoderPlugin constructor private 2023-03-24 10:56:58 +01:00
Caoimhe 208e3f1978 ImageViewer: Use LibFileSystemAccessClient
This commit also starts the adoption of ErrorOr<T> and the String class
in ImageViewer. However, there is still a few more changes that could
be made.

Since the actions of using LibFSAC and using String in more places are
tightly coupled, I decided to put them in one commit.
2023-03-24 09:38:46 +00:00
Andreas Oppebøen c943ab823d LibGUI: Paint slider track shorter to ensure the knob covers it
A 1px drop shadow from the track was peeking out behind the knob when
at rightmost or lowest position. That made it look like it was possible
to drag the knob even further right or down. Painting the track 1px
shorter seems like a good compromise to avoid the problem.
2023-03-24 10:33:22 +01:00
Andreas Oppebøen 0e4586dd3e LibGUI: Fix slightly wrong value slider knob position
When clicking the value slider bar, the knob was not positioned as
close to the mouse as expected. When moving the mouse right, the knob
would lag a bit behind, and the cursor would eventually be outside the
knob.

The bug was due to knob_rect() taking knob_thickness into account to
prevent the knob from protruding outside the bar. The value_at(pos)
calculated the relative position based on the entire width of the bar.
This discrepancy is fixed by taking knob_thickness into account in
value_at(position).
2023-03-24 10:33:22 +01:00
Andreas Oppebøen a30b341a2c LibGUI: Fix value slider so dragging left and right feels similar
When dragging value slider left, the handle would snap to lower value
with the slightest move of the mouse. When dragging to the right
however, it would take a lot more movement to cause a change in value.
This asymmetry made it feel awkward to drag the mouse around. It was
caused by always rounding down using a cast to int. By rounding to the
nearest integer first, we ensure symmetric behavior.
2023-03-24 10:33:22 +01:00
Andreas Oppebøen c8547124e2 LibGUI: Fix slider so dragging handle left and right feels similar
When dragging the slider handle left/down, the handle would
snap to lower value with the slightest move of the mouse. When dragging
to the right/up however, it would take a lot more movement to cause
a change in value. This asymmetry made it feel really awkward to drag
the slider. It was caused by always rounding down using a cast to int.
By rounding to the nearest integer first, we ensure symmetric behavior.
2023-03-24 10:33:22 +01:00
Jelle Raaijmakers 357538ed25 LibConfig: Use full include path for endpoints
This fixes the SDL2 port build which expects this path to exist in
`/usr/include`.
2023-03-24 00:31:03 +01:00
Luke Wilde cbe0901706 LibWeb: Implement performance.mark and performance.clearMarks 2023-03-23 21:00:43 +00:00
Luke Wilde 89ebef9730 LibWeb: Add a list of the entry names in the PerformanceTiming interface
Required for the PerformanceMark constructor, which doesn't allow any
mark names that have the same name as an attribute in the
PerformanceTiming interface in a Window context.
2023-03-23 21:00:43 +00:00
Luke Wilde 31b507afbf LibWeb: Introduce Performance Timeline and its Performance functions 2023-03-23 21:00:43 +00:00
Luke Wilde 4c3f1481ea LibWeb: Remove FIXME for existing [Default] object toJSON()functions 2023-03-23 21:00:43 +00:00
Luke Wilde 3f7fdfa807 LibIDL: Add Type::is_json which says if the type is convertible to JSON 2023-03-23 21:00:43 +00:00
Tim Ledbetter d1a964a43b LibThreading: Resolve BackgroundAction error callback use-after-free
This change ensures that a reference to the BackgroundAction is held
until after the error callback has executed on the event loop.

This fixes an intermittent crash in Assistant :^)
2023-03-23 21:05:12 +01:00
Luke Wilde ddec4cd7f2 LibWeb: Create the correct error objects in XHR::handle_errors
Aborts and network errors were accidentally creating TimeoutError
exceptions instead of AbortError and NetworkError respectively.
2023-03-23 20:01:38 +01:00
Caoimhe ac5f4792a8 ImageViewer: Fix crash when opening ImageViewer without an image
Seems like a thing which slipped through the cracks... We shouldn't try
to scale the image to the window's size if the bitmap doesn't exist.
2023-03-23 18:45:51 +00:00
Aliaksandr Kalenik 34224c42ef WebDriver: Unlink server socket before binding to it
Previously, the create_server function would fail with an "Address
already in use" error if a file that used for socket address is
already exists.
2023-03-23 19:38:44 +01:00
Hendiadyoin1 b76d3f287f LibJS: Make yy{/,-}mm{/,-}dd hh:mm test timezone independent
Otherwise this will fail in non UTC timezones.
2023-03-23 13:33:03 -04:00
Timothy Flynn 6d49eab8a6 LibJS+LibTimeZone: Explicitly canonicalize "GMT" to "UTC"
This is a normative change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/50eb413

Note that this canonicalization already occurred. As the above commit
alludes to, we parse the rearguard format of the TZDB, so GMT is already
an alias to Etc/GMT. But it doesn't hurt to be explicit here.
2023-03-23 15:30:21 +00:00
Timothy Flynn c5c6065611 LibJS: Add missing internal slots to creation of Intl.DateTimeFormat
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/f6c0c41
2023-03-23 15:30:21 +00:00
Timothy Flynn a13b6a3cb0 LibJS: Remove ! from AO calls that can't throw from Intl.DateTimeFormat
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/8f9080e
2023-03-23 15:30:21 +00:00
Timothy Flynn b74786d3c3 LibJS: Explicitly provide all GetIterator arguments from Intl.ListFormat
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/13895c8
2023-03-23 15:30:21 +00:00
Luke Wilde f0d0459c3e LibJS: Support the yy{/,-}mm{/,-}dd hh:mm format for Date
Required by a UK news website for loading a Piano configuration.
This is presumably configuration for piano.io Analytics.
2023-03-23 13:38:08 +01:00
Srikavin Ramkumar 5c8be3b072 LibWeb: Add missing constructors to HTMLElement IDLs 2023-03-23 13:37:40 +01:00