Commit Graph

49883 Commits

Author SHA1 Message Date
Ali Mohammad Pur
1403e56535 Shell: Place all variables in the closest nonlocal frame in POSIX mode 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
0d8b90aec6 Shell: Allow newlines before do in POSIX for loops 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
fca5a34ad3 Shell: Allow assignment-prefixed commands to run builtins
`env` is not capable of running shell builtins, so make a simple
builtin in its place.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
e2336d9de5 Shell: Add support for unset -v in POSIX mode 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
71441ea932 Shell: Allow lossy conversion from list -> string in POSIX mode
Similar to bash, this operation returns only the first element because
reasons.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
8a042cd9cb Shell: Allow non-exhaustive 'case' statements in POSIX 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
ef551a045d Shell: Add support for the POSIX 'read' builtin 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
aecd91aedc Shell: Correctly handle escaped quote characters in strings
Previously "foo\`bar" was treated literally, but \` is a valid escape
character.
This commit makes that string correctly evaluate as "foo`bar".
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
bbfedf17b7 Shell: Actually execute loop/case bodies when running them 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
7b031138fc Shell: Correctly handle commands after heredoc contents
Previously we did not emit a newline after the ending heredoc key, which
wreaked havoc on the parser logic, leading to parse errors.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
93413f8682 Shell: Use the correct range for named variable expansions
Previously we were starting the variable expansions before the starting
'$' and calculating the wrong length, this commit makes it so we
calculate the right range for them.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
79c76d67ce Shell: Add the 'break' and 'continue' POSIX builtins
These only support n=1 for now.
2023-05-05 09:35:24 +03:30
Aliaksandr Kalenik
0318ac5ce4 LibWeb: Remove setting length to 0px if it is not definite
If available width (or height) is max-content and width (or height)
value is 100% it should be resolved in infinite px, not 0 px.

Fixes #18639
2023-05-05 06:20:44 +02:00
Fabian Dellwing
b443c0b80b Ports: Update OpenJDK 2023-05-05 02:19:05 +02:00
Fabian Dellwing
36a26d7fa8 Userland: Fix wrong signature of dladdr
This function is supposed to take a `const void *addr` as first
parameter, but we took a `void *addr`.

https://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/baselib-dladdr-3.html
2023-05-05 02:19:05 +02:00
Ali Mohammad Pur
87e95ceb69 LibXML: Notify the listener about the root node as well
We previously did not notify the listener about entering the root node,
which caused the following snippet to produce the wrong output:
    a = new DOMParser
    a.parseFromString("<x/>", "text/xml").documentElement // != null
2023-05-05 01:33:49 +02:00
kleines Filmröllchen
0ab19dc4cd Piano: Allow per-track controls (again)
This makes Piano exactly as usable as when I started the large refactor
some years ago, which *sounds* like I'm a terrible person but now it (1)
looks nicer and (2) has a flexible backend that can already deal with
aribtrary kinds of processors on any track.
2023-05-05 01:32:09 +02:00
kleines Filmröllchen
d757027638 Piano: Use size_t for track count 2023-05-05 01:32:09 +02:00
kleines Filmröllchen
876f00e635 Base: Demonstrate ArgsParser and format strings in cli project template
This demonstrates both an option and an optional positional argument, as
well as some simple format string printing with {}.
2023-05-05 02:15:43 +03:30
kleines Filmröllchen
fd68e9f1ac Base: Split out cpp-library template files into actual files
These were part of the postcreate script previously, but with the new
powers of sed, we can text-replace the library name and make changing
them much more convenient.
2023-05-05 02:15:43 +03:30
kleines Filmröllchen
2451e97a11 Base: Adjust serenity-application template with some cpp-gui pieces
Namely, the window title and size are carried over, since a larger
window with a more readable "Example Application" title is better to
understand. I also took the opportunity to add a missing trailing
newline to the generated CMake file.
2023-05-05 02:15:43 +03:30
kleines Filmröllchen
7a0fae7be1 Base: Remove the cpp-gui HackStudio template
This template is essentially an older version of the
serenity-application template, it does not compile anymore and is
therefore entirely redundant.
2023-05-05 02:15:43 +03:30
kleines Filmröllchen
5ebc741594 sed: Implement in-place file editing
This implements the '-i' flag in the GNU version, without suffix
support.
2023-05-05 02:15:43 +03:30
kleines Filmröllchen
34f8147385 sed: Correctly unveil all paths
- The veil was never closed.
- unveil() only works with absolute paths.
- Files from the regular input list weren't unveiled.
2023-05-05 02:15:43 +03:30
MacDue
95c571ca53 PixelPaint: Make gradient tool hardness slider width match other inputs 2023-05-04 23:59:51 +02:00
MacDue
3a60ddc5a8 PixelPaint: Correct variable names in GradientTool.cpp
Previously these variables were all prefixed `size_`, but used for
the opacity value.
2023-05-04 23:59:51 +02:00
Tim Schumacher
56d861ebe0 AK: Prevent bit counter underflows in the new BitStream
Our current `peek_bits` function allows retrieving more bits than we can
actually provide, so whenever someone discards the requested bit count
afterwards we were underflowing the value instead.
2023-05-04 20:01:16 +02:00
Tim Schumacher
dffef6bb71 LibCompress: Remove special casing for looping DEFLATE seekbacks
The `copy_from_seekback` method already handles this exactly as DEFLATE
expects, but it is slightly more optimized.
2023-05-04 20:01:16 +02:00
Tim Schumacher
00ac73be57 Tests: Add a zlib test for "missing end bits"
The actual cause for the "missing bits" is currently unknown, and this
test case doesn't actually start obviously breaking yet unless we start
reporting errors about missing bits. However, since we are touching the
BitStream implementation already, let's add the test early to make extra
sure that we aren't breaking anything.
2023-05-04 20:01:16 +02:00
Daniel van Gerpen
98badc1466 Ports/ncdu: Update to version 1.18.1 2023-05-04 19:45:24 +02:00
Andreas Kling
66c41e7c45 LibWeb: Use JS::SafeFunction for module fetching callbacks
This fixes another GC crash seen on https://shopify.com/

Found it by collecting garbage after every 500th heap allocation.
2023-05-04 18:30:57 +02:00
MacDue
390ade3cf4 Base: Add some SVG <radialGradient> examples 2023-05-04 16:50:01 +02:00
MacDue
9b652842e4 LibWeb: Add an initial implementation of SVG <radialGradient>
This follows on from the SVG linear gradients. It supports the same
features (xlink:href, gradientUnits, gradientTransform).

With this commit I have now implemented all web gradients :^)

(Though we are still missing a few parameters for SVG gradients,
e.g. spreadMethod).
2023-05-04 16:50:01 +02:00
MacDue
2826bd2b45 LibWeb: Move some common SVG gradient functions into SVGGradientElement
These functions will also be used by SVG radial gradients.
2023-05-04 16:50:01 +02:00
MacDue
eda429111e LibWeb: Don't inherit SVG color stops if current gradient has stops
The previous behaviour was incorrect, the template's stops should only
be used if the current gradient does not have any stops.
2023-05-04 16:50:01 +02:00
MacDue
9ecc5413de LibWeb: Add tag and attribute names for SVG linear gradients 2023-05-04 16:50:01 +02:00
MacDue
81cefab1b1 LibGfx: Implement PaintStyle for SVG radial gradients
This also slightly refactors things to share more implementation with
the SVG linear gradients, and improve accuracy (which fixes some banding
issues).
2023-05-04 16:50:01 +02:00
MacDue
3d54b9ffa3 LibWeb: Mark SVG::NumberPercentage accessors as const 2023-05-04 16:50:01 +02:00
MacDue
cf0e31ca87 LibWeb: Remove general SVGFormattingContext FIXME
Since this FIXME was added the SVGFormattingContext has got a fair bit
more spec compliant. The other more specific FIXMEs in this file should
be more useful.
2023-05-04 16:50:01 +02:00
Timothy Flynn
ac8b892a25 LibWeb: Pause HTMLMediaElement when its document becomes inactive
For example, when navigating to another page, this ensures any media
resource will not continue playing.
2023-05-04 16:48:10 +02:00
Timothy Flynn
f78eadf00f LibWeb: Add an interface to be notified of Document state changes
Some HTML elements, e.g. HTMLMediaElement, need to take action when the
document becomes inactive.
2023-05-04 16:48:10 +02:00
Timothy Flynn
88b8969443 LibWeb: Implement steps for removing an HTMLMediaElement from a document 2023-05-04 16:48:10 +02:00
Luke Wilde
344785ae3a LibWeb: Implement the EventTarget constructor
This is typically used as `class A extends EventTarget`. It's usage can
be found on websites such as https://loadout.tf/

This has the quirk that we don't do set the EventTarget prototype for
HTML::Window, as it would cause a null deref on startup. However, given
it wasn't doing this before, I don't think it should cause any issues.
2023-05-04 16:12:40 +02:00
Jelle Raaijmakers
1127bdb65c Ports: Add Serious Sam - The First Encounter
The actual port is SeriousSamClassic, but only The First Encounter is
built and installed. It should be relatively easy to also build and
install The Second Encounter from this port in the future.
2023-05-04 16:11:28 +02:00
Jelle Raaijmakers
ea2f88a483 LibGL: Implement support for the GL_RGB5_A1 internal image format
We already support this in all other logic and in LibSoftGPU, I just
forgot to add this constant to this list.
2023-05-04 16:11:28 +02:00
Nico Weber
54448040ec ICC: Verify curve types have valid types
LutAToBTagData::from_bytes() and LutBToATagData::from_bytes() already
reject curves for which this isn't true with an error.

Ensure potential future callers of the constructors get it right too.
2023-05-04 16:11:07 +02:00
Nico Weber
0079fad785 ICC: Prepare for eventually implementing conversions for LUT profiles
No behavior change yet (except for more detailed "not yet implemented"
messages), but it prepares for eventually implementing some of this.
2023-05-04 16:11:07 +02:00
Andreas Kling
4ad12f3cb2 LibWeb: Honor fill, stroke and stroke-width attribute on SVGSVGElement
These are presentational hints and are handled by SVGGraphicsElement (a
superclass of SVGSVGElement) so we just need to call up to it. :^)
2023-05-04 15:40:34 +02:00
Nico Weber
2abe62adfa LibWeb: Don't divide by 0 in DOMMatrix::invert_self()
We'd only check is_invertible() after calling inverse(), which would
do a divide-by-0 for non-invertible matrices.

Less ambitious version of #18593.
2023-05-04 15:39:34 +02:00
Andreas Kling
3811be2f7c LibWeb: Make module maps GC-allocated
This allows them to mark JS modules, and fixes a crash seen on
https://shopify.com/
2023-05-04 11:56:55 +02:00