Commit graph

52683 commits

Author SHA1 Message Date
Shannon Booth
016b31fae2 LibJS/Tests: Add a test for an async function which returns a thenable
This test passes when running in the AST interpreter, but fails when
running for bytecode.
2023-07-17 12:33:01 +01:00
Andreas Kling
eb1f61f3b1 LibWeb: Fix logic typo in URL::parse()
I couldn't find a way to hit this function with our current testing
infrastructure, but since it breaks many websites, let's just get a
fix in immediately.

Regressed in 6fecd8cc44.
2023-07-17 09:50:49 +02:00
Andreas Kling
8dd489da61 LibWeb: Fully resolve min- and max-sizes for flex items
We do this by piggybacking on FormattingContext helpers instead of
reinventing the wheel in FlexFormattingContext.

This fixes an issue where `min-width: fit-content` (and other
layout-dependent values) were treated as 0 on flex items.

This makes the cookie banners look okay on https://microsoft.com/ :^)
2023-07-17 08:40:15 +02:00
Lucas CHOLLET
5d94bb4fcc LibGfx/PNG: Remove the useless HeaderDecoded state 2023-07-17 06:49:03 +01:00
Lucas CHOLLET
a173275afa LibGfx/PNG: Reject files that doesn't start with a IHDr chunk 2023-07-17 06:49:03 +01:00
Lucas CHOLLET
8d907b6535 LibGfx/PNG: Don't use a loop to read chunks in decode_png_ihdr()
This chunk is the first one, so we can remove that loop.
2023-07-17 06:49:03 +01:00
Lucas CHOLLET
ff6d82c3e7 LibGfx/PNG: Decode the header in create() and remove initialize()
This is done as a part of #19893. As `create()` is now the last user of
`decode_png_ihdr()`, we can easily make it return an `ErrorOr`.
2023-07-17 06:49:03 +01:00
Lucas CHOLLET
07f72b6d41 LibGfx/PNG: Don't try to guess if IHDR has been decoded 2023-07-17 06:49:03 +01:00
Lucas CHOLLET
07d3232f2d LibGfx/PNG: Use PNG specific vocabulary over a generic name 2023-07-17 06:49:03 +01:00
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