Commit graph

52474 commits

Author SHA1 Message Date
Andreas Kling f0ec104131 AK: Implement IPv6 host parsing in URLParser
This is just a straight (and fairly inefficient) implementation of IPv6
parsing and serialization from the URL spec.

Note that we don't use AK::IPv6Address here because the URL spec
requires a specific serialization behavior.
2023-07-17 07:47:58 +02:00
Lucas CHOLLET 545fdc849f LibCore: Register the image/vnd.ms-dds mime type 2023-07-17 06:44:37 +01:00
Lucas CHOLLET 0520490577 LibGfx/DDS: Read the header in create() and remove initialize()
This is done as a part of #19893.
2023-07-17 06:44:37 +01:00
Lucas CHOLLET aa9470880f LibGfx/DDS: Prefer static constexpr Array over Vector<u32> 2023-07-17 06:44:37 +01:00
Lucas CHOLLET 742897519d LibGfx/DDS: Move the code to read the header in its own function 2023-07-17 06:44:37 +01:00
Lucas CHOLLET 76efdaeecd LibGfx/DDS: Save the format in the context
This allows us to simplify the signature of a few functions.
2023-07-17 06:44:37 +01:00
Lucas CHOLLET 4cb7573582 LibGfx/DDS: Only use a FixedMemoryStream
This allows us to drop the data pointer in the `DDSLoadingContext`.
2023-07-17 06:44:37 +01:00
Lucas CHOLLET 8946c0c104 LibGfx/DDS: Don't double-check the magic number
This is already done in `decode_dds()`.
2023-07-17 06:44:37 +01:00
Lucas CHOLLET c336cef065 LibGfx/BMP: Decode the header in create() and remove initialize()
This is done as a part of #19893.
2023-07-17 06:39:57 +01:00
Lucas CHOLLET 7b72bf2910 LibGfx: Don't assume that image decoder plugin creation succeeds
An image with an incorrect header should fail at this step, so we have
to handle that without crashing.
2023-07-17 06:39:57 +01:00
Ryan Liptak 074ea60bb6 Base: Add 2 new emojis
⚱️ U+26B1 - Funeral Urn
👼 U+1F47C - Baby Angel
2023-07-17 06:31:54 +01:00
Andrew Kaster 5c2c412318 Meta: Bind WritableStreamDefaultController to JS
This was missed in 868cd95069.
2023-07-17 00:00:49 +01:00
Andrew Kaster 6ffed4d62a Meta: Port LibWeb/Streams changes to gn build
This ports the following commits:

c9941ba95b
f86c3ab148
12ff48047f
f1d69d789b
0091a60448
2023-07-17 00:00:49 +01:00
Andrew Kaster 57ad638dcc Meta: Port 618c0402 to gn build 2023-07-17 00:00:49 +01:00
Timothy Flynn 0e63d04a35 LibJS: Implement %IteratorHelperPrototype%.return 2023-07-16 23:56:55 +01:00
Timothy Flynn 57e7112a20 LibJS: Handle abrupt closures from Iterator.prototype.flatMap
This is in preparation of implementing %IteratorHelperPrototype%.return.
That will invoke GeneratorResumeAbrupt, which will execute the generator
with an abrupt completion. At that time, we must take care to close the
current inner iterator.
2023-07-16 23:56:55 +01:00
Timothy Flynn c04476f09d LibJS: Convert IteratorHelper to be a GeneratorObject
This is required for %IteratorHelperPrototype%.return, which needs to
operate on the internal slots of the base GeneratorObject. Doing so also
provides us with the appropriate VM to be used in invocations to the
overridden IteratorHelper::execute.
2023-07-16 23:56:55 +01:00
Timothy Flynn 82df3cee66 LibJS: Fix a couple of Generator.prototype spec headers 2023-07-16 23:56:55 +01:00
Timothy Flynn 566a8dfd93 LibJS: Allow GeneratorObject to be subclassed
In the Iterator Helpers proposal, we must create a generator object with
additional internal slots and behavior differences.

GeneratorObject is currently implemented assuming it wraps around an
ECMAScriptFunctionObject with generated bytecode. In this proposal, we
instead have "Abstract Closure" blocks. So this marks the `execute`
method as virtual, to allow the future subclass to essentially just
invoke those closures.

We will also require mutable access to the [[GeneratorState]] internal
slot.
2023-07-16 23:56:55 +01:00
Timothy Flynn 60adeb11c9 LibJS: Convert GeneratorObject's [[GeneratorBrand]] to a StringView
This optional parameter is not currently set by any caller, but will be
for the Iterator Helpers proposal. In all specs, this parameter is a
static string, so we can just use a StringView rather than allocating a
(Deprecated)String on each invocation.

This also changes this optional parameter to be passed by const-ref, as
it does not need to be copied.
2023-07-16 23:56:55 +01:00
Timothy Flynn f8cb4f9686 LibJS: Remove GeneratorObject::initialize() override
This was missing its Base invocation. But since this override is not
doing anything anyways, just remove it.
2023-07-16 23:56:55 +01:00
Kenneth Myhra f7d8fb6366 Ports/jfduke3d: Add post_install() section
This adds a post_install() section printing out useful information on
how to install the game files.
2023-07-16 23:45:23 +02:00
Kenneth Myhra 7fb2c79054 Ports/jfduke3d: Add game icon 2023-07-16 23:45:23 +02:00
Kenneth Myhra ae1039387a Ports/jfduke3d: Install into '/usr/local/share/games/jfduke3d' 2023-07-16 23:45:23 +02:00
Lucas CHOLLET 35dcd16ea6 LibGfx/TinyVG: Decode the header in create() and remove initialize()
This is done as a part of #19893.
2023-07-16 20:39:51 +02:00
MacDue dcb7c299bf LibGfx: Use stroke_to_fill() for Painter::stroke_path() 2023-07-16 18:52:38 +02:00
MacDue a9b4e876d0 LibGfx: Only attempt to paint strokes with a width > 0 2023-07-16 18:52:38 +02:00
Florian Stellbrink d4d7550588 LibJS/Tests: Test splice at non zero index 2023-07-16 17:13:44 +01:00
Florian Stellbrink 60750d864e LibJS: Align array splice with spec 2023-07-16 17:13:44 +01:00
Ali Mohammad Pur a720feba2f Meta: Pass -- to sudo instead of '$SHELL -c' in build scripts
fddbd11baa made it so the command executed
read `sh -c -- '"script" args*'`, the -- in this command is redundant as
the script name never starts with a dash and can never be interpreted as
an option or a flag.
The actually meaningful placement for -- here is after `$SUDO`, to make
sure `$SUDO` does not incorrectly treat `-c` as an option to itself, and
`$SHELL` cannot be interpreted as an option/flag in the extremely
unlikely event that it starts with a dash.
2023-07-16 16:28:18 +01:00
Sebastian Zaha 3cbfd6382c Meta: Port 16b487c270 to gn build 2023-07-16 09:27:12 -06:00
Linus Groh a83ae9f8a7 Revert "LibJS: Align array splice with spec"
This reverts commit b6cb8d8dea as it broke
11 test262 tests.
2023-07-16 15:21:29 +01:00
Florian Stellbrink b6cb8d8dea LibJS: Align array splice with spec 2023-07-16 14:57:42 +01:00
Shannon Booth ba758e9f4d LibJS/Tests: Add some basic tests for Array.fromAsync 2023-07-16 14:56:10 +01:00
Shannon Booth fe4f2923f8 LibJS: Implement Array.fromAsync 2023-07-16 14:56:10 +01:00
Shannon Booth 80b48b708f LibJS: Allow AsyncBlockStart to accept a SafeFunction
This is needed for the implementation of Array.fromAsync
2023-07-16 14:56:10 +01:00
Shannon Booth 98c4606544 LibJS: Link AsyncBlockStart AO to Explicit Resource Management proposal
As this function already implements that proposal.
2023-07-16 14:56:10 +01:00
Shannon Booth 930dd2948f LibJS: Make AsyncFunctionStart and AsyncBlockStart templates
This will allow implementing a version of these functions that accepts a
JS::SafeFunction, which is needed for the implementation of
Array.fromAsync.
2023-07-16 14:56:10 +01:00
Shannon Booth 7b5362fea6 LibJS: Make AsyncFunctionStart a standalone AO
This function may be called by places outside of
ECMAScriptFunctionObject.
2023-07-16 14:56:10 +01:00
Aliaksandr Kalenik 07f451044b LibWeb: Fix inline-block percentage height calculation
If an inline-block has a percentage height that relies on the auto
height of the containing block, it should always resolve to the
automatic height of the box, regardless of the percentage value. This
change may seem confusing, but it aligns with the behavior of other
engines.
2023-07-16 15:00:30 +02:00
Shannon Booth 4e911cb40e Toolchain: Update cmake to 3.26.4
Also update the comment so that people remember to update the port at
the same time, and clarify that updating `cmake-version.cmake` is not
required if there is no change in cmake that we need in our buildsystem.
2023-07-16 00:05:53 -06:00
Shannon Booth b980224640 Ports/cmake: Update cmake to version 3.26.4 2023-07-16 00:05:53 -06:00
MacDue 1bc7b0320e LibGfx: Approximate elliptical arcs with cubic beziers
Unlike all other primitives elliptical arcs are non-trivial to
manipulate, it's tricky to correctly apply a Gfx::AffineTransform to
them. Prior to this change, Path::copy_transformed() was still
incorrectly applying transforms such as flips and skews to arcs.

This patch very closely approximates arcs with cubic beziers (I can not
visually spot any differences), which can then be easily and correctly
transformed in all cases.

Most of the maths here was taken from:
https://mortoray.com/rendering-an-svg-elliptical-arc-as-bezier-curves/
(which came from https://www.joecridge.me/content/pdf/bezier-arcs.pdf,
now a dead link).
2023-07-16 06:22:55 +02:00
MacDue 2a1bf63f9e LibGfx: Use AK::sincos() and AK::Pi<double> in Path::elliptical_arc_to() 2023-07-16 06:22:55 +02:00
MacDue 8d4f90df4e LibGfx: Pass angles as floats to Path::elliptical_arc_to()
These are stored as floats internally and other parameters are
FloatPoints, so taking doubles is a little inconsistent. Doubles are
needed for the endpoint -> center parametrization conversion, but that
does not need exposing in the API.
2023-07-16 06:22:55 +02:00
Sam Atkins 58c91f0a99 LibC: Remove duplicate log statement
Now that warnln() also outputs to the debug console, this would print
the error twice.
2023-07-16 00:59:13 +02:00
Sam Atkins e0b7717a6a FileManager: Remove duplicate log statement
Now that warnln() also outputs to the debug console, this would print
the error twice.
2023-07-16 00:59:13 +02:00
Sam Atkins d48c68cf3f AK: Automatically copy all warn/warnln logs to debug console
This is only enabled inside Serenity, as on Lagom, all out/warn/dbg logs
go to the same console anyway.
2023-07-16 00:59:13 +02:00
MacDue d2766bd5fe Tests/LibGfx: Test we can decode everything in TinyVG
This tests that we can successfully parse the "everything" TVG files,
which make use of every feature in TinyVG.

Test files taken from https://github.com/TinyVG/examples (MIT).
2023-07-15 21:36:28 +02:00
MacDue cf05da131f LibGfx/TinyVG: Close polygon path in OutlineFillPolygon 2023-07-15 21:36:28 +02:00