Commit graph

29072 commits

Author SHA1 Message Date
Andreas Kling c21978ead6 LibJS/JIT: Remove unused functions from Assembler 2023-10-27 19:07:22 +02:00
Andreas Kling 1e8c6d3b06 LibJS/JIT: Use mov() helper in Assembler::native_call() 2023-10-27 19:07:22 +02:00
Andreas Kling e7ce3d271a LibJS/JIT: Add Assembler::add() and sub() helpers 2023-10-27 19:07:22 +02:00
Andreas Kling 10dcb4d53a LibJS/JIT: Add Assembler::push() and pop() helpers 2023-10-27 19:07:22 +02:00
Andreas Kling acece9057e LibJS/JIT: Make Assembler::Reg represent X86 registers
And move the generic register aliases to JIT::Compiler.
2023-10-27 19:07:22 +02:00
Andreas Kling f9041c7b31 LibJS/JIT: Fast path for boolean JS::Value in compile_to_boolean() 2023-10-27 19:07:22 +02:00
Andreas Kling babdc0a25b LibJS: Work-in-progress JIT compiler :^) 2023-10-27 19:07:22 +02:00
Nico Weber 6d47fca3bf LibPDF: Don't assert on outline destinations that use null as page
Nothing in PDF 1.7 spec 8.2.1 Destinations mentions the page being
`null`, but it happens in 0000372.pdf (for the root outline element)
and in 0000776.pdf (for every outline element, which looks like a
bug in the generator maybe) of 0000.zip from the pdfa dataset.
2023-10-27 06:38:25 -04:00
Andreas Kling 2e23f00a2f LibJS/Bytecode: Move environment coordinate caches to Executable
Moving them out of the respective instructions allows the bytecode
stream to be immutable.
2023-10-27 07:26:37 +02:00
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
Martin Janiczek 32909d02b3 LibTest: Add a README documenting the high-level randomized approach 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
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
Ali Mohammad Pur cc43a7ecda Shell: Add a 'in_parallel' builtin for easy concurrency 2023-10-26 11:15:57 +02:00
Ali Mohammad Pur 22d411345d LibWasm: Implement the multi-memory proposal 2023-10-26 11:15:11 +02:00
Gabriel Nava Marino f4515aae80 Userland: Draw tooltip over glyph to show UTF-8 code point
Currently finding a particular glyph with a given code point is
a bit tedious as it requires clicking on the glyph to update the
status bar and display the glyph's name and codepoint. A more
convenient way to know where we are in the Glyph Map is by seeing
a tooltip over the glyph where the mouse is currently hovering over.
This patch adds that support by setting the Widget tooltip with the
glyph found at the current position in GlyphMapWidget::mousemove_event.
2023-10-26 11:12:49 +02:00
lanmonster e5c9d7ce26 Calendar: Add inputs to change event end date/time 2023-10-26 11:10:23 +02:00
lanmonster a7c3d39bab Calendar: Add end date/time to events 2023-10-26 11:10:23 +02:00
lanmonster 4984faa108 Calendar: Rename m_date_time to m_start_date_time
This is in preparation to add m_end_date_time
2023-10-26 11:10:23 +02:00
lanmonster a4fcec6815 Calendar: Rename input variables
These were named foo_combo, when in reality there more spinboxes than
comboboxes. Change to foo_input to accomodate whatever type of input
they may be.
2023-10-26 11:10:23 +02:00