Commit Graph

52551 Commits

Author SHA1 Message Date
Matthew Olsson
fa1b1f8244 LibGfx: Forward-declare TagData in WellKnownProfiles 2023-07-20 06:56:41 +01:00
Sebastian Zaha
7696738140 Meta: Port recent LibWeb and LibJS changes to gn build
This ports the following commits:
a8587fe54e
9d7215c636
2023-07-20 06:48:13 +01:00
Shannon Booth
a0d1ef34e2 LibJS: Deduplicate labelled continue & break bytecode generation
Similar to the scoped continue and break, the only two differences
between these functions is the scope that is scanned for a matching
label, and the specific handling of a continue/break boundary.
2023-07-20 07:24:31 +02:00
Shannon Booth
663e4507ea LibJS: Deduplicate scoped continue & break bytecode generation
The only two differences between these two functions are the name of the
block that is created and the specific jump/break handling per boundary.
2023-07-20 07:24:31 +02:00
Nico Weber
c4bad2186f LibPDF: Implement 7.6.4.3.4 Algorithm 2.B: Computing a hash
This is a step towards AESV3 support for PDF files.

The straight-forward way of writing this with our APIs is pretty
allocation-heavy, but this code won't run all that often for the
regular "open PDF, check password" flow.
2023-07-19 21:26:55 +01:00
Nico Weber
492962502f LibCrypto: Make create_aligned_buffer() static
I ended up not needing this, but there's no reason for this function
to not be static.
2023-07-19 21:26:55 +01:00
Sebastian Zaha
919033fffd Ladybird: Prevent QAction leaking
In some places in the code QAction instances are added to a parent
directly on instantiation. In the case they are not, Valgrind
reports them as leaking.
2023-07-19 21:26:43 +01:00
Sebastian Zaha
d974142c7e Ladybird: Allow copying text in the js console 2023-07-19 21:26:43 +01:00
Sebastian Zaha
8e8f124ca9 Ladybird: Implement JS console input history
One can now use KeyUp and KeyDown to navigate through the already run
commands in the JS console.
2023-07-19 21:26:43 +01:00
Sebastian Zaha
6f15b92ace Ladybird: Fix typo in variable name 2023-07-19 21:26:43 +01:00
Sebastian Zaha
5d430b276c Ladybird: Scroll the JS console to the bottom on input 2023-07-19 21:26:43 +01:00
Sam Atkins
d00f489cdc SoundPlayer: Rename main widget to SoundPlayerWidget
This is the main widget, and is never replaced by something else, so
having "AdvancedView" in there is a bit confusing.
2023-07-19 19:37:27 +01:00
Sam Atkins
fae350be3f SoundPlayer: Use an enum for PlaylistModel columns
Also correct some const-positioning.
2023-07-19 19:37:27 +01:00
Sam Atkins
32e5593ca9 SoundPlayer: Use AK::human_readable_size() for file sizes 2023-07-19 19:37:27 +01:00
Sam Atkins
ca3e0288e9 GMLPlayground: Keep a RefPtr to the "Save As..." action
Previously, the Save action held a reference to the local variable for
the Save As action, which goes out of scope at the end of
`initialize_menubar()`. This meant that if you tried to Save a new
file, it would instead crash and yeet your work into the abyss.
2023-07-19 19:36:17 +01:00
Andrew Kaster
e02b2a7b9a Ladybird: Make Android build work again, and tidy up files
We don't need the extra gradle files in our sources, the Qt CMake
integration will generate suitable ones for us.

Make sure that assets is always a folder, so that we can get the proper
layout for the ladybird-assets.tar.gz and CMake doesn't create a gzip
file with the name "assets".

Fix up the AndroidPlatform file and make sure it's linked into all the
applications that need it. Also make sure to copy all the application
shared libraries into the ladybird APK so that when we make them into
proper Services, the libs are already there.
2023-07-19 12:25:37 -06:00
Andrew Kaster
7de4fb2947 LibCore: Build LocalSocket on Android 2023-07-19 12:25:37 -06:00
Aliaksandr Kalenik
babadc19df Tests/LibWeb: Update WPT expectations
Updates WPT tests expectations in metadata.txt and changes run.sh to
checkout more recent commit in WPT upstream repository.
2023-07-19 18:34:36 +02:00
Aliaksandr Kalenik
2d12a91cd0 Tests/LibWeb: Remove MANIFEST.json from WPT
I added this file thinking it was necessary for the wpt run command.
However, it's only needed for updating expectations metadata. Since wpt
run always regenerates MANIFEST.json before updating expectations, we
can safely delete this file from the repository.
2023-07-19 18:34:36 +02:00
Shannon Booth
7b00b4d6f6 LibJS: Add spec comments to FunctionDeclarationInstantiation 2023-07-19 14:14:03 +01:00
Timothy Flynn
9d7215c636 LibJS+LibWeb: Move IteratorOperations.h AOs to Iterator.h
Rather than splitting the Iterator type and its AOs into two files,
let's combine them into one file to match every other JS runtime object
that we have.
2023-07-19 14:11:43 +01:00
Sam Atkins
7d0f70bfa0 Userland: Use AK::human_readable_digital_time() instead of custom code
Use this handy AK function instead of reimplementing the formatting code
several times. The one minor difference is that now, hours are only
shown if the duration is at least an hour long, but that seems like an
improvement to me. :^)
2023-07-19 08:45:43 -04:00
Andrew Kaster
3533d3e452 AK: Enable consteval workaround for Android NDK
Android isn't shipping clang-15 yet in any NDK, so use the existing
workaround on that platform.
2023-07-19 04:22:28 -06:00
Tim Ledbetter
73a6f2e9ed ps: Add the -o option to specify a user-defined column format
This option allows the user to change which colums are displayed
by giving comma or space separated list of column format specifiers.

A column format specifier is of the form: `COLUMN_NAME[=COLUMN_TITLE]`.
Where `COLUMN_NAME` is any of: uid, pid, ppid, pgid, sid, state, tty,
or cmd. Specifying a `COLUMN_TITLE` will change the name shown in the
column header.

`COLUMN_TITLE` may be blank. If all given column titles
are blank, the header is omitted.
2023-07-19 11:21:59 +01:00
Tim Ledbetter
cdb15a20ff ps: Select user-specified processes only when the -q option is used
This fixes a logic bug which allowed processes not specified by the
user to be selected when the `-q` option was used. This caused the
program to crash when sorting processes into the correct order.
2023-07-19 11:21:59 +01:00
Sam Atkins
dd1156fb17 LibWeb: Update spec comments for math function determined types
The spec was corrected here:
de4119a6e3
2023-07-19 11:12:53 +01:00
Tim Schumacher
f8bd607733 LibC: Make getopt available from getopt.h 2023-07-19 00:19:35 -06:00
Tim Schumacher
aae106e37b LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
Tim Schumacher
9410f0a96c Toolchain: Copy the same headers as GNU when building Clang
We were previously missing `Kernel/Arch`, which gets included by
`Kernel/API`.

While at it, remove `AK` from the list of copied headers for the
toolchain, as nothing in our LibC headers should ever publicly depend on
AK.
2023-07-19 00:19:35 -06:00
Timothy Flynn
4b0ef6b81d LibJS: Replace Set's GetKeysIterator AO with GetIteratorFromMethod
This is a normative change in the Set Methods proposal. See:
https://github.com/tc39/proposal-set-methods/commit/f3d5206

Note that this is normative due to an IsCallable check being deferred to
some time after its previous invocation in the GetKeysIterator.
2023-07-19 06:56:51 +02:00
Timothy Flynn
cd27c0d67e LibJS: Throw a TypeError early for undefined methods in GetIterator
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/784fc65

Note we were already doing this for a nicer error message. This is also
what lets GetIteratorFromMethod accept the method parameter as a nonnull
pointer.
2023-07-19 06:56:51 +02:00
Timothy Flynn
a7a109062a LibJS: Rename IterableToList to IteratorToList
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/ff60140

In doing so, as the new name implies, callsites are updated to pass in
an IteratorRecord themselves, rather than an iterable value.
2023-07-19 06:56:51 +02:00
Timothy Flynn
1760361304 LibJS: Make GetIterator's hint parameter required
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/2562811
2023-07-19 06:56:51 +02:00
Timothy Flynn
5703833116 LibJS+LibWeb: Refactor GetIterator to use GetIteratorFromMethod
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/956e5af

This splits the GetIterator AO into two AOs, to remove some recursion
and to (soon) remove optional parameters.
2023-07-19 06:56:51 +02:00
Lucas CHOLLET
b918dcd4db LibGfx/TGA: Compute the number of pixels with a wider type
Both width and height are stored in an u16 inside the TGA header,
computing the total number of pixel without using another type can
easily lead to overflows.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55309&q=serenity&can=2
2023-07-19 06:52:45 +02:00
MacDue
b5658d75f5 Fuzzers: Add a DDS fuzzer 2023-07-19 06:52:06 +02:00
MacDue
581236b24a Fuzzers: Add a TinyVG fuzzer 2023-07-19 06:52:06 +02:00
Aliaksandr Kalenik
0bdc93bca8 LibGfx: Fix double x_scale multiply when glyph kerning is cached
This resolves a problem where the kerning value multiplied by the scale
is stored in the cache, even though the code retrieving the value from
the cache does not anticipate it to be scaled. As a result, it leads to
a buggy double multiplication by the scale.
2023-07-19 06:43:04 +02:00
MacDue
2ecafddd1c Documentation: Add a rough guide on setting up SPICE on Ubuntu
Only covers Ubuntu for now (since that's what I use), thought it might
be good to put this somewhere, since I had to search around for the
setup.
2023-07-18 21:59:14 +01:00
Sam Atkins
f25adbd5ae SoundPlayer: Correct formatting of PlaylistModel duration text
The previous code would format 5400 seconds as "1:90:00", when it should
be "1:30:00".
2023-07-18 21:17:58 +01:00
Lucas CHOLLET
7b4630932b Tests/LibGfx: Call ImageDecoder::size() before frame()
Reordering these calls allow us to ensure that all encoders are able to
return the size of the image before they are requested to decode the
whole bitmap.
2023-07-18 21:17:10 +01:00
Nico Weber
7a48d59727 LibPDF: Simplify AESV2 code a bit
- `encrypt()` will always fill a multiple of block size,
  `decrypt()` might produce less data. But other than that,
  the middle span isn't modified even though it's a reference.
  So pass the ByteBuffer to assign() (kind of like before 5998072f15,
  but pass-by-move())

- In the encryption code path, assign a single buffer for IV and data
  instead of awkwardly copying the data around later.

Thanks to CxByte for suggesting most of this!

No intentional behavior change.
2023-07-18 18:48:57 +02:00
Timothy Flynn
e5bcd6c731 LibWeb: Implement the HostGetImportMetaProperties hook 2023-07-18 17:03:21 +01:00
Timothy Flynn
66a8664518 LibJS: Provide a mutable SourceTextModule to HostGetImportMetaProperties
The Web host, for example, will need mutable references to objects owned
by the SourceTextModule.
2023-07-18 17:03:21 +01:00
zhiyuang
97130a4e66 LibWeb: More correctly paint joins between borders
The refactor of the border painting mainly to handle:
1. Single border with minor border radius.
2. Different border widths and border colors joined situations.
This refactor only apply to solid border.

The main differece is to use Path.fill to paint each border,
not fill_rect anymore. There's a special case need to consider.
The Path.fill will leave shared edge blank between two borders.
To handle this, we decide to combine the borders with same color
to paint together.
2023-07-18 14:51:13 +01:00
Shannon Booth
06a44ac2ff LibCore: Error on a fail to write in Command::write_lines 2023-07-18 14:48:45 +01:00
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