Commit graph

51910 commits

Author SHA1 Message Date
Sebastian Zaha
553694679e LibWeb: Fix alternating-sides float positioning
The "y" check for when to reset float side positioning was comparing an
offset that included the border, while the offset of the other side does
not.
2023-07-02 18:43:20 +02:00
Andreas Kling
c37b204ce1 LibJS/Bytecode: Add Call opcode for fixed-argument-count calls
This avoids the overhead of allocating a new Array on every function
call, saving a substantial amount of time and avoiding GC thrash.

This patch only makes use of Op::Call in CallExpression. There are other
places we should codegen this op. We should also do the same for super
expression calls.

~5% speed-up on Kraken/stanford-crypto-ccm.js
2023-07-02 18:30:02 +02:00
Andreas Kling
7eb87dec9f LibJS/Bytecode: Rename Call and SuperCall to &WithArgumentArray
Forcing every function call to allocate a new Array just to accommodate
spread parameters is not very nice, so let's start moving towards making
this a special case rather than the general (and only) case.
2023-07-02 18:30:02 +02:00
Andreas Kling
dc884aa0d3 LibJS/Bytecode: Remove unnecessary variable environment stack
The var environments will unwind as needed with the ExecutionContext
and there's no need to include it in the unwind info.

We still need to do this for lexical environments though, since they
can have short local lifetimes inside a function.
2023-07-02 18:30:02 +02:00
Niklas Lahnstein
e2b0cacb89 3DFileViewer: Properly handle ENOENT errors 2023-07-02 17:35:35 +02:00
Niklas Lahnstein
8534506ab0 3DFileViewer: Use ArgsParser 2023-07-02 17:35:35 +02:00
stelar7
0fc73679f1 LibTLS: Fix typo in ecdsa_sha512 OID 2023-07-02 16:13:37 +02:00
stelar7
77080fbade LibTLS: Rename parse_version to parse_certificate_version
This is not a generic version, but specifically for certificates.
2023-07-02 16:13:37 +02:00
Torstennator
0c95564533 PixelPaint: FilterGallery fix preview
This patch fixes an issue where the preview for an filter was always
based on the content bitmap even if the edit mode was set to Mask.
Now the preview is using the content or mask bitmap based on the
current edit mode and therefore generates the correct preview of
what is going to be changed.
2023-07-02 15:23:42 +02:00
Torstennator
d9d9103cbb PixelPaint: Start using Editing-Masks for some tools
This patch starts to integrate the usage of Editing-Masks for the
following tools: Spray-Tool, Brush-Tool and Erase-Tool
2023-07-02 15:23:42 +02:00
Torstennator
0a120e239a PixelPaint: Remove todo from LevelDialog
This patch removes a todo where the revert for any changes could be
optimized. Previously every single pixel was copied back from the
reference bitmap to the content bitmap. Now the editors content
bitmap is just replaced with the reference bitmap that is a copy
of the unchanged content bitmap.
2023-07-02 15:23:42 +02:00
Torstennator
1f31e72843 PixelPaint: LevelDialog enhancements
This patch adds the ability to apply slider changes only to regions
where a editing-mask was drawn.
2023-07-02 15:23:42 +02:00
Torstennator
e3509efc1b PixelPaint: Introduce new mask features
This patch adds a new Editing-Mask type to layers. This kind of mask
is used to restrict changes on the content bitmap only to areas where
the mask is drawn. The intensity of a pixel change is controlled by the
alpha-value of the mask.

Furthermore a function to invert and clear masks has been introduced.
When a new mask is created for a layer the edit mode of the layer is
also changed to Mask so that the user can immediately start to draw the
mask.
2023-07-02 15:23:42 +02:00
Ali Mohammad Pur
7e5f1fa895 LibLine: Defer handling SIGWINCH and SIGINT
Performing these immediately can introduce a race condition between the
user's signal-related logic and LibLine's own, so defer the handlers to
make sure they run when our terminal IO cannot interfere with the
user's.
2023-07-02 16:27:52 +03:30
Andreas Kling
fb979dcf34 LibJS/Bytecode: Make Bytecode::Interpreter participate in GC marking
Since the relationship between VM and Bytecode::Interpreter is now
clear, we can have VM ask the Interpreter for roots in the GC marking
pass. This avoids having to register and unregister handles and
MarkedVectors over and over.

Since GeneratorObject can also own a RegisterWindow, we share the code
in a RegisterWindow::visit_edges() helper.

~4% speed-up on Kraken/stanford-crypto-ccm.js :^)
2023-07-02 14:50:02 +02:00
Kim Kulak
cfb6baf973 Base: Add Wiby Search To New Tab Page 2023-07-02 13:20:04 +01:00
Andreas Kling
cea2071349 LibJS/Bytecode: Infer name of anonymous exported classes when possible
5 new passes on test262. :^)
2023-07-02 12:18:25 +02:00
Andreas Kling
b0ae1e80fb LibJS/Bytecode: Support using MemberExpression as rest property
Also, don't assert while dumping an AST with this construct.

7 new passes on test262. :^)
2023-07-02 11:53:10 +02:00
Daniel Bertalan
0df7255fe7 LibJS/Bytecode: Do not clobber completion value with VariableDeclaration
While the completion value of a variable declaration is specified to be
empty, we might already have a completion value in the accumulator from
a previous statement. Preserve it so as to avoid clobbering it.

This fixes 6 tests on test262.
2023-07-02 10:54:35 +02:00
Andreas Kling
bd2c3ace68 LibJS/Bytecode: Make sure empty with statement results in undefined
2 new passes on test262. :^)
2023-07-02 10:54:28 +02:00
kleines Filmröllchen
8ba4036bba Base: Add accept(2) man page
This man page was referenced from some places. This is mostly a
condensed version of the POSIX behavior that the system call
implementation already has, only documenting the obviously visible
errors (in source code) we do actually report.
2023-07-02 02:29:09 +02:00
kleines Filmröllchen
6cddee98a9 LibAudio: Don't overread MP3 granule samples if big_values is too large
There are at most 576 granule samples/frequency lines, but the side data
can specify that the big_values granule type take up to 1024 samples.
The spec says in 2.4.3.4.6 that we should always stop reading Huffman
data once we have 576 samples, so that is what this change does. I also
add some useful spec comments while I'm here.
2023-07-02 02:15:32 +02:00
kleines Filmröllchen
53785a9206 LibAudio: Handle bitstream errors in MP3 Huffman decode 2023-07-02 02:15:32 +02:00
djwisdom
2ba77489ee Ports: Update serenity theming use latest commit 49d499b
Add font HuntingRegular10
Update font AnodeRegular10
Update font GenodeRegular10
Update font VanligaMonoRegular10
2023-07-02 02:12:52 +02:00
MacDue
40fa07a6e1 LibWeb: Force paintable to exist for SVG <g> elements
This (along with the previous commit) fixes the missing tears on the
sad Duolingo owl.
2023-07-02 01:31:18 +02:00
MacDue
7d26383426 LibWeb: Remove SVGContext
The SVGContext is a leftover from when SVG properties were more ad-hoc.
All properties are now (for better or worse) treated as CSS properties
(or handled elsewhere). This makes the SVGContext's fill/stroke
inheritance handling unnecessary.
2023-07-02 01:31:18 +02:00
Liav A
23a7ccf607 Kernel+LibCore+LibC: Split the mount syscall into multiple syscalls
This is a preparation before we can create a usable mechanism to use
filesystem-specific mount flags.
To keep some compatibility with userland code, LibC and LibCore mount
functions are kept being usable, but now instead of doing an "atomic"
syscall, they do multiple syscalls to perform the complete procedure of
mounting a filesystem.

The FileBackedFileSystem IntrusiveList in the VFS code is now changed to
be protected by a Mutex, because when we mount a new filesystem, we need
to check if a filesystem is already created for a given source_fd so we
do a scan for that OpenFileDescription in that list. If we fail to find
an already-created filesystem we create a new one and register it in the
list if we successfully mounted it. We use a Mutex because we might need
to initiate disk access during the filesystem creation, which will take
other mutexes in other parts of the kernel, therefore making it not
possible to take a spinlock while doing this.
2023-07-02 01:04:51 +02:00
Kim Kulak
63fc36d00d Base: Add "Wiby.me" To "SearchEngines.json" 2023-07-01 23:37:04 +01:00
kleines Filmröllchen
b4fbd30b70 AudioServer+Userland: Decouple client sample rates from device rate
This change was a long time in the making ever since we obtained sample
rate awareness in the system. Now, each client has its own sample rate,
accessible via new IPC APIs, and the device sample rate is only
accessible via the management interface. AudioServer takes care of
resampling client streams into the device sample rate. Therefore, the
main improvement introduced with this commit is full responsiveness to
sample rate changes; all open audio programs will continue to play at
correct speed with the audio resampled to the new device rate.

The immediate benefits are manifold:
- Gets rid of the legacy hardware sample rate IPC message in the
  non-managing client
- Removes duplicate resampling and sample index rescaling code
  everywhere
- Avoids potential sample index scaling bugs in SoundPlayer (which have
  happened many times before) and fixes a sample index scaling bug in
  aplay
- Removes several FIXMEs
- Reduces amount of sample copying in all applications (especially
  Piano, where this is critical), improving performance
- Reduces number of resampling users, making future API changes (which
  will need to happen for correct resampling to be implemented) easier

I also threw in a simple race condition fix for Piano's audio player
loop.
2023-07-01 23:27:24 +01:00
Sebastian Zaha
d52a2ff10e LibGfx: Fix error & crash in Rect::closest_to
Assertion fails if the point is outside of the rect. This was introduced
in introduced in #18970 and causes serenity to crash when changing to 2x
resolution for a monitor, if the cursor after resizing is outside of
the new screen.

Added test to reproduce.
2023-07-01 23:27:00 +02:00
Andreas Kling
0cb9c9e81e LibJS: Add fast paths for bitwise ops on 2x Int32 JS::Value
~9% speed-up on Kraken/stanford-crypto-aes.js :^)
2023-07-01 20:29:12 +01:00
Andreas Kling
1efe4b58aa LibJS/Bytecode: Store current interpreter register window as a Span
This avoids a bunch of indirections on every single register access.

~17% speed-up on Kraken/stanford-crypto-aes.js :^)
2023-07-01 20:29:12 +01:00
Shannon Booth
e7435d68b0 LibJS: Extract named vm variables in ArrayBufferPrototype::slice 2023-07-01 16:55:17 +01:00
Shannon Booth
3781948f0c LibJS: Add initial implementation for SharedArrayBuffer
None of the actual sharing is implemented yet, but this is enough for
most basic functionality.

Diff Tests:
    +260     -262    +2 💀
2023-07-01 16:55:17 +01:00
Ali Mohammad Pur
1c1aa2c0d0 Shell: Handle (most) errors in the parsers
This turns all errors into either "OOM" or a proper shell error (if
propagation is impossible or meaningless).
Fixes `echo -en '\xfe\x4a' | $SHELL` crashing.
2023-07-01 17:01:54 +03:30
Andreas Kling
3f022f4040 LibWeb: Treat non-finite containing block width as zero for percentages
Fixes an assertion when loading https://bun.sh/
2023-07-01 09:06:49 +02:00
Andreas Kling
c0a5787395 Ladybird: Don't scroll web view if wheel event is a Ctrl+Wheel zoom 2023-07-01 08:12:42 +02:00
Haikal Zain
bf16618fba LibWeb: Add vertical border heights to tr
tr y offset is not being computed correctly.
This is causing errors in hit testing since
td and tr are misaligned.
2023-07-01 08:07:49 +02:00
Zack Penn
5775993a2a Ladybird: Add initial support for Ctrl+Scroll to zoom in/out
This commit adds basic functionality to zoom in/out using the
Ctrl+Scroll shortcut.
2023-07-01 08:07:33 +02:00
Andi Gallo
6b649af447 LibWeb: Fix inset shadow with zero offset and blur
Before this change, we only blurred the shadows which would've been
generated without blur. This meant that we didn't generate a shadow when
the offset was zero, even with blur. However, other browsers generate a
shadow when blur is set.

Instead, always generate a rectangular contour of sufficient thickness,
blur it if needed and blit it into the right position at the very end.
Thanks to the blur radius, we'll have a shadow even when the offset is
zero.
2023-07-01 07:48:33 +02:00
Andrew Kaster
e0cf52b024 CI: Enable detect_stack_use_after_return ASAN option 2023-07-01 07:03:11 +02:00
Andrew Kaster
31440687a3 LibJS: Check the ASAN fake stack for heap pointers when ASAN is enabled
This is a similar strategy to what v8 does. Use the ASAN API function
__asan_addr_is_in_fake_stack to check any fake stack frames associated
with each stack address we scan. This fully allows running test-js -g
with the option detect_stack_use_after_return turned on.
2023-07-01 07:03:11 +02:00
Andrew Kaster
7d71acf1bb AK: Use __builtin_frame_address to find current stack depth remaining
Instead of checking the address of a temporary, grab the address of the
current frame pointer to determine how much memory is left on the stack.

This better communicates to the compiler what we're trying to do, and
resolves some crashes with ASAN in test-js while the option
detect_stack_use_after_return is turned on.
2023-07-01 07:03:11 +02:00
Daniel Bertalan
96b197ef46 LibJS/Temporal: Perform floating point arithmetic in RoundTime
The valid range for temporal values (`nsMinInstant`/`nsMaxInstant`)
means performing nanosecond-valued integers could lead to an overflow.

NB: Only the `roundingMode: "day"` case was affected, as all others were
already performing the division on floating-point `fractional_second`
values. I'm adding `.0` suffixes everywhere to make this fact clearer.

This adds a few local tests as well, as those are tested with sanitizers
enabled by default, unlike test262.
2023-07-01 06:51:25 +02:00
Daniel Bertalan
1dce1994eb LibJS: Make the options arg of InterpretTemporalDateTimeFields nullable
This fixes "reference binding to null pointer" UBSan warnings.
2023-07-01 06:51:25 +02:00
Daniel Bertalan
6eb06384b3 Kernel: Increase SD Data Timeout
Otherwise, reading will sometimes fail on the Raspberry Pi.

This is mostly a hack, the spec has some info about how the correct
divisor should be calculated and how we can recover from timeouts.
2023-06-30 23:45:47 +02:00
Daniel Bertalan
bbe614c6c5 Kernel: Implement Changing Bus Width per the SDHC specification
Namely, we previously forgot to configure the SD Host Controller for
4-bit mode after issuing ACMD6, which caused data transfers to fail on
bare metal.
2023-06-30 23:45:47 +02:00
Daniel Bertalan
73228fc742 Kernel: Clear previous value before setting new clock divisor
Otherwise it would just get OR'ed together with the previous value,
leading to a slower than expected operation.
2023-06-30 23:45:47 +02:00
Daniel Bertalan
6185a19618 Kernel: Wait for transactions to complete before stopping SD clock 2023-06-30 23:45:47 +02:00
Daniel Bertalan
b90a20aee6 Kernel: Make the PresentState register a bitfield in the SDHC driver 2023-06-30 23:45:47 +02:00