Commit graph

51880 commits

Author SHA1 Message Date
Andreas Kling bac500b9ad LibWeb: Add spec comments to HTML parser "in row" insertion mode 2023-07-03 11:50:58 +02:00
Shannon Booth 8c8b24d877 diff: Add support for writing diffs in context format 2023-07-03 10:41:30 +02:00
Shannon Booth 44f141dd24 LibDiff: Add Diff::write_context_header
This is used to write a context patch header.
2023-07-03 10:41:30 +02:00
Shannon Booth f02cf2704c LibDiff: Add support for writing formatted context hunks
There is a little bit more complexity involved here than the other
formats. In particular, this is due to the need to determine whether
an addition line or removal line is just that, or a 'change'.
2023-07-03 10:41:30 +02:00
Andre Herbst 4bcf3ea0e1 Ports/libgd: Added --without-x to prevent linking against /usr/lib 2023-07-03 10:39:21 +02:00
Carwyn Nelson e7da956090 man: Change all uses of DeprecatedString to String 2023-07-03 02:05:32 +02:00
Carwyn Nelson e44abaa777 LibMarkdown: Convert render_to_terminal to String
This commit converts render_to_terminal from DeprecatedString to return
an ErrorOr<String>. This is to aid moving `man` away from
DeprecatedString.

I have opted not to convert render_to_html and render_to_inline_html for
now to keep this commit as small as possible.
2023-07-03 02:05:32 +02:00
Carwyn Nelson e247da507f LibCore: Add new String variants to ArgsParser
This commit adds the ability to use the String class with `add_option`
and `add_positional_argument`.

This should help with the transition away from DeprecatedString.
2023-07-03 02:05:32 +02:00
Daniel Bertalan d165590809 LibJS/Bytecode: Do not coerce the receiver to Object for internal_set
This makes the behavior of `Symbol` correct in strict mode, wherein if
the receiver is a symbol primitive, assigning new properties should
throw a TypeError.
2023-07-02 22:08:48 +01:00
Daniel Bertalan 0cd85ab0fc AK+LibJS: Make Number.MIN_VALUE a denormal
ECMA-262 implies that `MIN_VALUE` should be a denormalized value if
denormal arithmetic is supported. This is the case on x86-64 and AArch64
using standard GCC/Clang compilation settings.

test262 checks whether `Number.MIN_VALUE / 2.0` is equal to 0, which
only holds if `MIN_VALUE` is the smallest denormalized value.

This commit renames the existing `NumericLimits<FloatingPoint>::min()`
to `min_normal()` and adds a `min_denormal()` method to force users to
explicitly think about which one is appropriate for their use case. We
shouldn't follow the STL's confusingly designed interface in this
regard.
2023-07-02 21:19:09 +01:00
Cameron Youell 978fe3c6d5 Shell: Add option Produce symbolic output to umask
Its a standard posix option thats always nice to have :^)
2023-07-02 11:19:10 -06:00
Cameron Youell d9ff37e1b1 Utilities: Make mktemp follow the spec directory path resolution
Previously an input like this:

mktemp -d /tmp/dirtest_-XXXXX

Would result in an error when it should have created a temp directory
2023-07-02 11:19:10 -06:00
Cameron Youell 9630fe3ebc Utilities: Remove unused variable in mktemp 2023-07-02 11:19:10 -06:00
Shannon Booth ff23426b6e headless-browser: Write failed diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 2c9db2de05 diff: Add support for writing diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 55a3dfec10 LibDiff: Add support for generating diffs with surrounding context
While not used in normal diffs due to limitations in the format, this
may be used in context and unified format diffs.
2023-07-02 11:18:11 -06:00
Shannon Booth f528aedc85 LibDiff: Add Diff::write_unified_header
This is used to write a unified patch header.
2023-07-02 11:18:11 -06:00
Shannon Booth a4e50deeea LibDiff: Add Diff::write_unified for formatting unified hunks 2023-07-02 11:18:11 -06:00
Shannon Booth f690807c5a LibDiff: Change underlying representation of Hunk to allow context
The existing hunk data structure does not contain any way to easily
store information about context surrounding the additions and removals
in a hunk. While this does work fine for normal diffs (where there is
never any surrounding context) this data structure is quite limiting for
other use cases.

Without support for surrounding context it is not possible to:
 * Add support for unified or context format to the diff utility to
   output surrounding context.
 * Be able to implement a patch utility that uses the surrounding
   context to reliably locate where to apply a patch when a hunk range
   does not apply perfectly.

This patch changes Diff::Hunk such that its data structure more closely
resembles a unified diff. Each line in a hunk is now either a change,
removal, addition or context.

Allowing hunks to have context inside of them exposes that HackStudio
heavily relies on there being no context in the hunks that it uses for
its' git gutter implementation. The fix here is simple - ask git to
produce us a diff that has no context in it!
2023-07-02 11:18:11 -06:00
Sebastian Zaha ef8f0f4f68 Meta: Update path to ladybird in gdb invocation 2023-07-02 18:43:46 +02:00
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