Commit graph

29044 commits

Author SHA1 Message Date
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
lanmonster
edee914093 Calendar: Update day range when the month changes
Previously it was possible to create an event on Feb 31(!)
2023-10-26 11:10:23 +02:00
lanmonster
97cc5b2da4 Calendar: Use GML for AddEventDialog 2023-10-26 11:10:23 +02:00
Adam Harald Jørgensen
1a6affc64b LibGUI: Reify new child when handling child creation in FileSystemMode
This ensures that new files added after the setup of the
FileSystemModel are also are watched.
2023-10-26 11:09:24 +02:00
Adam Harald Jørgensen
d1da5b1f0d LibGUI: Reify children of root when invalidating in FileSystemModel
This ensures that the children of root also get watched
2023-10-26 11:09:24 +02:00
Adam Harald Jørgensen
1ab318b391 LibGUI: Add ability to watch file Nodes when traversing them
This makes it possible to also capture changes to files, not just
directories. We only need to watch for metadata changes on files
because child created/deleted is not possible with nodes other than
directories, and deletion will be captured by the file's parent
2023-10-26 11:09:24 +02:00
Adam Harald Jørgensen
4d3c06ffe3 LibGUI: Fetch data on a Node before traversing it, instead of after
Before this it wouldn't be possible to make decisions in
Node::traverse_if_needed based on the Node data because it would be
invalid.
2023-10-26 11:09:24 +02:00
Adam Harald Jørgensen
60f9aa5cb8 LibGUI: Handle metadata changes in FileSystemModel 2023-10-26 11:09:24 +02:00
Adam Harald Jørgensen
cbfa363b2b LibGUI: Preserve correct child order in FileSystemModel
When handling child creation in FileSystemModel, the new child should
be inserted such that the children still follow the correct order of
being grouped by directory-and-file and then sorted alphabetically,
instead of just being appended at the end.
2023-10-26 11:09:24 +02:00
Nico Weber
c25538b2e3 LibGfx/ICC: Implement conversion to PCS for AToB*Tags using mAB
...as long as the mAB tag doesn't have A curves and a CLUT.

With this, we can convert images that use AToB* tags to the profile
connection space (and then from there to, say, sRGB), if the AToB* tag
uses the mAB format.

We can't yet do this if the mAB tag has A curves or a CLUT.

We can't convert back from PCS to this space yet.

We don't yet handle AToB* tags that use mft1 or mft2 instead of mAB.
2023-10-26 11:07:43 +02:00
Nico Weber
15bddf5de3 LibGfx/ICC: Gently rewrite CurveTagData::evaluate()
One less redundant expression. No behavior change.
2023-10-26 11:07:43 +02:00
Timothy Flynn
a39eebeb74 LibWebView: Reject cookies whose domain is on the Public Suffix List 2023-10-26 11:06:49 +02:00
Timothy Flynn
9f9e5c0f55 LibWebView: Add an API to query if a host is on the Public Suffix List 2023-10-26 11:06:49 +02:00
Timothy Flynn
ae3e0d97b5 LibWebView: Wrap retrieving public suffix data in a helper
This lets outside callers use this API but primarily is to fix the build
when the ENABLE_PUBLIC_SUFFIX_DOWNLOAD CMake option is disabled.
2023-10-26 11:06:49 +02:00
Tim Ledbetter
b4296e1c9b LibPDF: Don't use unsanitized values in error messages
Previously, constructing error messages with unsanitized input could
fail because error message strings must be UTF-8.
2023-10-26 11:05:32 +02:00
Nico Weber
f8bf9c6506 LibPDF: Sketch out DeviceN color spaces a bit
Documents using them now show render-time diagnostics instead
of asserting that number of parameters passed to a color don't
match whatever number of channels the previously-set color space
had.

Fixes two asserts on the `-n 500` 0000.zip test set.
2023-10-26 11:05:00 +02:00
Aliaksandr Kalenik
f915aa70cd LibWeb/Painting: Introduce PaintingCommandExecutor
Decoupling painting command executor from RecordingPainter allows to
introduce painters other than CPU Gfx::Painter :)
2023-10-26 11:02:04 +02:00
Nico Weber
4549d6cf1b LibPDF: Add a FIXME comment to the inline image data skipping path 2023-10-26 10:59:45 +02:00
Nico Weber
2878af5968 LibPDF: Sketch out Lab color space
Same as other recent color spaces: Enough to make us not assert,
but not enough to actually produce color.

Fixes 2 asserts on the `-n 500` 0000.zip pdfa dataset.
2023-10-26 10:59:45 +02:00
Tim Ledbetter
1a4df4ffe7 LibGfx/ICC: Avoid overflow when constructing NamedColor2TagData 2023-10-26 10:59:22 +02:00
Nico Weber
a65d8ff2ea LibPDF: Tolerate page rotation being an indirect object
Needed e.g. for 0000196.pdf in 0000.zip in the pdfa dataset.
2023-10-26 10:58:45 +02:00
Nico Weber
8b806183f6 LibPDF: Tolerate indirect objects in various image dict values
0000101.pdf from 0000.zip from the pdfa dataset has /Height set to
an indirect object that contains an int.

Make that work, and make sure various other similar places getting
values of the image dict also resolve indirect references.
2023-10-26 10:58:45 +02:00
Nico Weber
5dd7639386 LibPDF: Tolerate indirect references in Type0 /W array
Makes e.g. 0000236.pdf in 0000.zip in the pdfa dataset work.
2023-10-26 10:58:45 +02:00
Nico Weber
b928fadba7 LibPDF: Swap int and array branches in outline item reading
No intended behavior change.

It does have the effect that indirect object references now go down
the array path instead of the number path. They still fall over there,
but now that's easy to fix.
2023-10-26 10:58:45 +02:00
Nico Weber
208a058eab LibPDF: Tolerate integer outline item colors
0000296.pdf from 0000.zip from the pdfa dataset contains
`/C [0 0 0]` (as opposed to `/C [0.0 0.0 0.0]`). Make that work.
(It's fine per spec.)
2023-10-26 10:58:45 +02:00
Tim Ledbetter
7096ea82f9 LibGfx: Use count_leading_zeroes to calculate nearest power of 2
This removes the possibility of an infinite loop.
2023-10-26 08:39:26 +02:00
Tim Ledbetter
6e4c97a328 LibGfx/WOFF: Return error if numTables is 0
This is consistent with WOFF2.
2023-10-26 08:39:26 +02:00
Tim Ledbetter
52f78d07b8 LibGfx/WOFF2: Ensure numTables is within expected range
An error is now returned if `numTables` is zero or greater than 4096.
While this isn't explicitly mentioned in the specification, subsequent
calculations will be incorrect if the value falls outside this range.
2023-10-26 08:39:26 +02:00
Aliaksandr Kalenik
437442719d LibWeb: Fix coordinate translation for PaintTextShadow command
Fixes regression introduced in 4318bcf447

`shadow_bounding_rect` is used on bitmap allocated for shadow and is
not supposed to be in coordinate system of stacking context. Same for
`text_rect`.

Fixes https://github.com/SerenityOS/serenity/issues/21587
2023-10-26 08:38:16 +02:00