Commit Graph

55665 Commits

Author SHA1 Message Date
Lucas CHOLLET
5c7e5cc738 Ladybird: Decode images out of process
This patch brings a service to handle image decompression. With it comes
security enhancement due to the process boundary. Indeed, consequences
of a potential attack is reduced as only the decoder will crash without
perturbing the WebContent process.
It also allows us to display pages containing images that we claim to
support but still make us crash, like for not-finished-yet decoders.

As an example, we can now load https://jpegxl.info/jxl-art.html without
crashing the WebContent process.
2023-10-27 07:26:32 +02:00
Lucas CHOLLET
8659a6d3a7 Lagom: Port LibImageDecoderClient to Lagom
This library offers tools to communicate with an ImageDecoder server
through IPC. There is currently no such executable for Lagom but that
shouldn't take long :^)
2023-10-27 07:26:32 +02:00
Lucas CHOLLET
fbc25ad302 Lagom: Don't include Serenity's ImageDecoder service
This service assumes paths from the serenity environment, bringing it to
Lagom in its current form is useless.
2023-10-27 07:26:32 +02:00
Aliaksandr Kalenik
d1a01c4c65 LibWeb: Fix box alignment when it has min-width or max-width in GFC
Changing `try_compute_width()` to return width and margins, instead of
mutating them in the box's state makes it works in cases when box has
min-width or max-width and this function needs to be called multiple
times.

Fixes https://github.com/SerenityOS/serenity/issues/21598
2023-10-27 07:14:34 +02:00
Aliaksandr Kalenik
895ec6ad09 LibWeb: Remove unused append_child and remove_child in BrowsingContext
A part of post navigables cleanup.
2023-10-27 07:14:04 +02:00
Tim Ledbetter
4b5b8fc564 LibGfx: Use safe version of count_leading_zeroes() in WOFF parsers
This guards against undefined behavior when zero is given as an
argument.
2023-10-27 07:13:51 +02:00
Nico Weber
88bd7d83ad LibGfx: Fix off-by-one in opentype cmap format 6 parsing
Fixes asserts when rendering 0000037.pdf, 0000116.pdf, 0000463.pdf,
0000483.pdf, 0000506.pdf, and 0000938.pdf in 0000.zip from the
pdfa dataset.
2023-10-27 07:13:19 +02:00
Nico Weber
2ef24e883c LibGfx: Add spec links for cmap table formats 2023-10-27 07:13:19 +02:00
Nico Weber
864172084b LibGfx: Call dbgln() on unimplemented cmap format 2023-10-27 07:13:19 +02:00
Andrew Kaster
0f0c9f910a WebDriver: Print out the entire error when failing to start a session 2023-10-27 07:11:35 +02:00
Andrew Kaster
4dbb73b360 Meta+Documentation+Ladybird: Update places that use ladybird filename
Fallout from 01feae24b2

These places referred to the filename "ladybird" directly, but we
changed the OUTPUT_NAME of ladybird to "Ladybird".
2023-10-27 07:11:35 +02:00
Dan Klishch
8b49bdb724 Meta+Documentation: Restore links to LibJS website
This partially reverts dacf7265 and 67ca5d65.
2023-10-27 07:08:57 +02:00
Ali Mohammad Pur
1f67bbcca5 Meta: Restore the Wasm build CI for LibJS
The new workflow simply publishes the generated objects as artifacts.
2023-10-27 05:57:18 +03:30
Ali Mohammad Pur
aa4360b9a3 Meta: Port LibJS Wasm repl to the new LibJS architecture
This was left behind when removing the AST interpreter, and the CI not
being around made it bitrot.

Co-Authored-By: Dan Klishch <danilklishch@gmail.com>
2023-10-27 05:57:18 +03:30
Ali Mohammad Pur
072c4eeb50 AK: Make SipHash not depend on size_t bit length
That breaks on 32-bit systems, this commit makes it so they're always
stored in a u64 as the code requires.
2023-10-27 05:57:18 +03:30
David Lindbom
01feae24b2 Ladybird: Fix capitalization in AppKit menu bar 2023-10-26 18:02:21 -06:00
Martin Janiczek
32909d02b3 LibTest: Add a README documenting the high-level randomized approach 2023-10-26 17:26:52 -06:00
Martin Janiczek
7c2a569fca LibTest: Add a suite of tests for the generators 2023-10-26 17:26:52 -06:00
Martin Janiczek
2782334152 LibTest: Add the RANDOMIZED_TEST_CASE macro and its main loop
Tests defined like

RANDOMIZED_TEST_CASE(test_name)
{
    GEN(dice, Gen::unsigned_int(1,6));
    EXPECT(dice >= 1 && dice <= 6);
}

will be run many times (100x by default, can be overriden with
MAX_GENERATED_VALUES_PER_TEST), each time generating different random
values, and if any of the test runs fails, we'll shrink the generated
values and report the final minimal ones to the user.
2023-10-26 17:26:52 -06:00
Martin Janiczek
30f73221fd LibTest: Add functions for shrinking a given RandomRun 2023-10-26 17:26:52 -06:00
Martin Janiczek
d534005c8d LibTest: Add the ShrinkCommand abstraction
ShrinkCommands are recipes for how a RandomRun should be shrunk. They
are not related to a specific RandomRun, although we'll take the length
of a specific RandomRun into account when generating the ShrinkCommands.

ShrinkCommands will later be interpreted by the shrink_with_command()
function.
2023-10-26 17:26:52 -06:00
Martin Janiczek
ba20ddb834 LibTest: Add the GEN macro
Generators are callable as-is:

u32 my_int = Gen::unsigned_int(); // -> 1, 5, 8, 3, 2

But there is little visibility in the test fail message into what went
wrong. Showing what values were generated helps a lot, and that's what
this macro does:

GEN(my_int, Gen::unsigned_int());

expands into the above declaration and (crucially) a conditional
warnln() call looking like "my_int = {}". It will only run if error
reporting is enabled (see Test::can_report()), so it will only give the
final shrunk value instead of spamming the output with each generated
value.
2023-10-26 17:26:52 -06:00
Martin Janiczek
00934bc344 LibTest: Add the REJECT and ASSUME macros
REJECT and ASSUME are useful for filtering out unwanted generated
values. While this is not ideal, it is ocassionally useful and so we
include it for convenience.

The main loop of RANDOMIZED_TEST_CASE runs the test case 100 times, each
time trying to generate a different set of values. Inside that loop, if
it sees a REJECT (ASSUME is implemented in terms of REJECT), it retries
up to 15 times before giving up (perhaps it's impossible or just very
improbable to generate a value that will survive REJECT or ASSUME).

REJECT("Reason for rejecting") will just outright fail, while
ASSUME(bool) is more of an equivalent of a .filter() method from
functional languages.
2023-10-26 17:26:52 -06:00
Martin Janiczek
1bcfead020 LibTest: Add ability to turn test failure reporting on/off
This will be very useful as we add the randomized test cases and their
two loops ("generate+test many times" and "shrink once failure is
found"), because without this failure reporting we'd get many FAIL error
messages while still searching for the minimal one.

So, inside randomized test cases we want to only turn the error
reporting on for one last time after all the generating and shrinking.
2023-10-26 17:26:52 -06:00
Martin Janiczek
99e2d42a53 LibTest: Add a library of Generators
These functions all plug into RandomnessSource and produce random values
of various types. They are to be used either inside other generator
definitions or inside the GEN(...) macro when used in tests.
2023-10-26 17:26:52 -06:00
Martin Janiczek
7e5a3650fe LibTest: Add the RandomnessSource abstraction
This will be a foundational part of bootstrapping generators: this is
the way they'll get prerecorded values from / record random values into
RandomRuns. (Generators don't get in contact with RandomRuns
themselves, they just interact with the RandomnessSource.)
2023-10-26 17:26:52 -06:00
Martin Janiczek
d4e4189a34 LibTest: Add the RandomRun abstraction
To be used later by generators and during shrinking.

The generators used in randomized tests will record the drawn random
bits into a RandomRun. This is a layer of indirection that will help us
automatically shrink any generated value without any user input. (Having
to provide manually defined shrinkers is a downside to many randomized /
property-based testing libraries like QuickCheck for Haskell.)
2023-10-26 17:26:52 -06:00
Martin Janiczek
5dbcc396da LibTest: Add the Chunk abstraction
A prerequisite for shrinking the failing RandomRuns in randomized tests.
2023-10-26 17:26:52 -06:00
Martin Janiczek
a60e3b17b1 LibTest: Expand test result bool to a TestResult
This will be used in the randomized tests a lot more than it is in the
unit tests / benchmarks; randomized tests will run the test function
multiple times, check the result and optionally start shrinking the
failing input. Generators will also be able to fail, resulting in some
of the new TestResult variants.
2023-10-26 17:26:52 -06:00
Bastiaan van der Plaat
5a7f43ad38 Maps: Add favorites panel with favorite places management 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
3acbffabf9 LibGUI: Add double type to Variant 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
f35791343e Maps: Use name + coordinates in search marker tooltip 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
54ec744398 Maps: Add custom context menu actions option to MapWidget 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat
f18c6eb0ea Maps: Make Maps a recommended CMake component instead of required 2023-10-26 17:23:54 -06:00
Anders Jenbo
e14189de0f Ports/devilutionX: Remove SDL2_mixer dependency 2023-10-26 15:53:33 -06:00
Emanuele Torre
f92f571019 Documentation: SerenityOS' => SerenityOS's in Patterns.md
This is the only instance of `*OS's` in the repo that does not use `s`
after the apostrophe.
Generally, the saxon genitive for singular nouns is always written as
`'s` even if they end in `s`.
2023-10-26 15:45:50 -06:00
Dan Klishch
6ed069ea8d JSSpecCompiler: Provide an adequate command line interface 2023-10-26 15:45:31 -06:00
Dan Klishch
867ce0df52 JSSpecCompiler: Move passes to Passes subdirectory of Compiler/ 2023-10-26 15:45:31 -06:00
Dan Klishch
61fa00d46c JSSpecCompiler: Refactor CompilerPass to accept TranslationUnitRef 2023-10-26 15:45:31 -06:00
Dan Klishch
24682f5dcf Meta: Fix typos in shell script comments 2023-10-26 15:45:31 -06:00
Adam Harald Jørgensen
5fb748b333 Base: Document new Shell prompt formatting options 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
491d61a2fd Shell: Add support for escaping backslash in prompt sequence 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
050c73d301 Shell: Add support for showing custom format time in prompt with "\D{}" 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
e40955e9c6 Shell: Add support for showing current time in prompt with "\{t|T|@}" 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
3d42e68265 Shell: Add support for showing number of jobs in prompt with "\j" 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
f81bc8b045 Shell: Add support for showing the history number in prompt with "\!" 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
f597d7c730 Shell: Add command to history before running, instead of after 2023-10-26 22:33:38 +03:30
Adam Harald Jørgensen
78b3703586 Shell: Refactor Shell::prompt to use GenericLexer to read the PROMPT var 2023-10-26 22:33:38 +03:30
Timothy Flynn
1d26550370 CI: Remove git LFS tracking of test262 data
See:
75f5027d5e
2023-10-26 07:02:18 -04:00
Ali Mohammad Pur
cc43a7ecda Shell: Add a 'in_parallel' builtin for easy concurrency 2023-10-26 11:15:57 +02:00