Commit Graph

52655 Commits

Author SHA1 Message Date
Shannon Booth
125145c682 LibCore: Port Command::write_lines to ErrorOr
Keeping this in line with Command::write.
2023-07-18 14:48:45 +01:00
Shannon Booth
5dd93474ee LibCore+Tests: Unify process handling into Command class
The Test262RunnerHandler class in test-test262 was made in order to
spawn a subprocess, connect to its input/output error pipes, and obtain
its return value.

Later on, a copy of this implementation was added to TestSed with
modifications, such as adding support for reading from the output pipes
as well.

Unify these two implementations into a new Core::Command class. This new
implementation is more closely modeled from the TestSed implementation
due to the extra functionality it implemented.
2023-07-18 14:48:45 +01:00
Shannon Booth
cb920b23cc LibCore: Add System::environment
Move this from an internal function of Core::Process so that it can be
used elsewhere.
2023-07-18 14:48:45 +01:00
Lucas CHOLLET
806808f406 LibGfx: Provide a default implementation for animation-related methods
Most image decoders that we have only support non-animated images,
providing a default implementation for them allows to remove quite some
code.
2023-07-18 14:34:35 +01:00
Lucas CHOLLET
7acb656826 LibGfx: Comment ImageDecoderPlugin's interface
This is done as an effort to unify the behavior of every plugin. See
#19893 for more details.
2023-07-18 14:34:35 +01:00
Lucas CHOLLET
4291288a31 LibGfx: Remove ImageDecoderPlugin::initialize()
No plugin is currently overriding the default implementation, which is a
no-op. So we can safely delete it.
2023-07-18 14:34:35 +01:00
Lucas CHOLLET
3752facfbc 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.

This should have been done in 7b72bf29.
2023-07-18 14:34:35 +01:00
Fabian Dellwing
f9e62bc947 Ports: Update and refactor opentyrian
- Add SDL2_net
- Bring CMake file closer to proposed upstream
- Remove opentyrian-data port and merge it into the main port
- Do a release build
- Add correct icon
2023-07-18 14:31:33 +01:00
Timothy Flynn
31e555aaa5 LibJS: Disallow negative set record sizes
This is a normative change in the Set Methods proposal. See:
https://github.com/tc39/proposal-set-methods/commit/4155e6e
2023-07-18 12:31:10 +01:00
Andreas Kling
ac124fbaae LibWeb: Resolve flex item percentages against used flex container sizes
Once we've resolved the used flex item width & height, we should allow
percentage flex item sizes to resolve against them instead of forcing
flex items to always treat percentages as auto while doing intrinsic
sizing layout.

Regressed in 8dd489da61.
2023-07-18 06:04:55 +02:00
Matthew Olsson
edd7de3c77 LibPDF: Fix incorrectly parsing subsections in xref stream
Subsections are generally not contiguous, however this logic assumed
that they were, and kept a persistent "entry_index" count while looping
through all subsections. This commit rewrites the logic to be more
straightforward; just loop through all of the subsections and handle
each one separately.
2023-07-18 00:51:23 +02:00
Matthew Olsson
bfd8faedf9 LibPDF: Assert compressed xref's 2nd field is non-zero 2023-07-18 00:51:23 +02:00
Matthew Olsson
f9c1d11380 LibPDF: Do not crash when linearized length is incorrect
This is a perfectly valid situation, and in this case we should just
parse a standard non-linearized xref table.
2023-07-18 00:51:23 +02:00
dependabot[bot]
e5a6c268ca CI: Bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 00:26:23 +02:00
Cameron Youell
ae845835d6 Meta: Dont finish lines with only one character in lint-ports.py 2023-07-18 00:17:34 +02:00
sin-ack
752d9d7c03 Ports: Bump Zig version to 0.11.0-dev.4003+c6aa29b6f
This commit fixes the build for LLVM 16 now that the toolchain has been
updated, and updates us to the latest available Zig commit.

The main patch changes are making more symbols available (and exposing
them through std.c.serenity) and working around new Zig build
requirements.

Co-Authored-By: Andre Herbst <moormaster@gmx.net>
2023-07-17 22:52:08 +01:00
Sebastian Zaha
92b56ded02 LibWeb: Fix whitespace getting trimmed incorrectly
Whitespace at the end of line should only be trimmed when
'white-space' is set to 'normal', 'nowrap', or 'pre-line'.
2023-07-17 21:47:34 +02:00
Lucas CHOLLET
ce4b09dfd1 LibGfx: Register the mime type image/x-icon 2023-07-17 20:17:08 +01:00
Lucas CHOLLET
38dd4168be LibGfx/ICO: Decode the header in create() and remove initialize()
This is done as a part of #19893.
2023-07-17 20:17:08 +01:00
Aliaksandr Kalenik
a8587fe54e LibWeb: Add support for "place-items" CSS property
Adds support for place-items property which allows to specify both
align-items and justify-items in a single declaration.
2023-07-17 18:58:05 +02:00
Sebastian Zaha
a74c56bc1b LibWeb: Remove unused code
The LineBoxFragment::Type enum was used earlier in the inline layouting,
but in the current algorithm there is a single type of LineBoxFragment.
2023-07-17 18:54:54 +02:00
Alan Kemp
3fd870a429 LibWeb: Create EdgeStyleValue for BackgroundPositionXY with no offset
When specifying either `background-position-x: right` or
`background-position-y: bottom` without an offset value no
EdgeStyleValue was created.

However, the spec says the offset should be optional.

Now, if you do not provide an offset, it creates the EdgeStyleValue
with a default offset of 0 pixels.
2023-07-17 14:53:52 +01:00
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