Commit Graph

26923 Commits

Author SHA1 Message Date
Matthew Olsson
fa1b1f8244 LibGfx: Forward-declare TagData in WellKnownProfiles 2023-07-20 06:56:41 +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
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
7de4fb2947 LibCore: Build LocalSocket on Android 2023-07-19 12:25:37 -06: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
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
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
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
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
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
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
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