Commit graph

45728 commits

Author SHA1 Message Date
Timothy Flynn 0a1874c203 AK: Export the OptionalNone helper structure 2023-01-16 10:12:37 +00:00
Brian Gianforcaro bffc29ae34 LibJS: Fix uninitialized member variable in DurationFormat
Reported-by: PVS Studio
2023-01-16 09:45:46 +01:00
Brian Gianforcaro bfa890251c Kernel: Fix uninitialized member variable in FATFS Filesystem
Reported-by: PVS Studio
2023-01-16 09:45:46 +01:00
Brian Gianforcaro 19a87fce36 Meta: Disable PVS Studio v1052 static analysis rule in github actions
This rule conflicts with the projects style guide, and ends up being
just a bunch of unnecessary noise. So lets just suppress it.
2023-01-16 09:45:46 +01:00
Aliaksandr Kalenik 7dc0edcb86 LibWeb: Prevent floats from being placed higher than preceding blocks
CSS 2.2 section 9.5.1:
The outer top of a floating box may not be higher than the
outer top of any _block_ or floated box generated by an
element earlier in the source document.

Where block is `BlockContainer` in LibWeb type system.
Which means `current_boxes` need to be cleared before
leaving block container.

```html
<style>
.wrapper {
  width: 100px;
  height: 300px;
  background-color: lightgray;
}

.box {
  margin: 10px;
  width: 50px;
  height: 50px;
  float: left;
}

.a { background-color: salmon; }
.b { background-color: slateblue; }
.c { background-color: green; }
</style>
<div class="wrapper">
	<div class="box a"></div>
	<div class="box b"></div>
</div>
<div class="box c">
</div>
```
2023-01-16 09:45:16 +01:00
Brian Gianforcaro 745883e29b Meta: Add myself to CODEOWNERS 2023-01-16 08:28:38 +01:00
Lucas CHOLLET 07f0873531 Presenter: Disable "Next" and "Previous" actions when non-applicable 2023-01-16 08:28:11 +01:00
Lucas CHOLLET 2372b3b8f9 Presenter: Add Presentation::has_a_[next,previous]_frame() 2023-01-16 08:28:11 +01:00
Tim Schumacher 3ed9627f4e LibIPC: Decode messages using Core::Stream internally 2023-01-15 23:06:31 -05:00
Tim Schumacher d1711f1cef AK: Define our own concept of "trivially serializable"
While at it, rename the `read_trivial_value` and `write_trivial_value`
functions to `read_value` and `write_value` respectively, since we'll
add compatibility for non-trivial types down the line.
2023-01-15 23:06:31 -05:00
Tim Schumacher 6777cb0975 LibCore: Fix up type mistakes in Stream::read_trivial_value 2023-01-15 23:06:31 -05:00
Lucas CHOLLET 3b824ec8c9 AK+Test: Fix a logic error in CircularBuffer::offset_of()
This error was introduced by 9a7accdd and had a significant impact on
`BufferedFile` behavior. Hence, we started seeing crash in test262.

By itself, the issue was a wrong calculation of the internal reading
spans when using the `read` and `until` parameters. Which can lead to
at worse crash in VERIFY and at least weird behaviors as missed needles
or detections out of bounds.

It was also accompanied by an erroneous test.

This patch fixes the bug, the test and also provides more tests.
2023-01-15 23:23:24 +00:00
BodilessSleeper c5daa6d997 LibJS: Remove redundant ToString from ToTemporalZonedDateTime
Assert that the type of offsetString is either undefined or
string in order to avoid unnecessary ToString
Temporal commit: tc39/proposal-temporal@24ebcbd
2023-01-15 21:35:25 +00:00
BodilessSleeper 219db02b2f LibJS: Assert TemporalDateTimeToString if showCalendar is "never"
The only part of TemporalDateTimeToString that can fail is
MaybeFormatAnnotateCalendar which cannot fail if showCalendar is
"never" as it simply makes an empty string.
Temporal commit: tc39/proposal-temporal@a1faee6
2023-01-15 21:35:25 +00:00
Jelle Raaijmakers 5ed53b3474 LibGfx: Prevent reading OOB in TGA header decode 2023-01-15 19:59:33 +01:00
Tim Ledbetter 68fa8525bf ClipboardHistory: Add a Clear history action
This clears the history from the table view and clears the clipboard.
2023-01-15 19:19:06 +01:00
Tim Ledbetter 944c43a8b4 ClipboardHistory: Ensure model is populated on startup
This ensures that, if the applet restarts, it will remain in sync with
the clipboard.
2023-01-15 19:19:06 +01:00
Tim Ledbetter 174135f909 ClipboardHistory: Update clipboard when the topmost item is deleted 2023-01-15 19:19:06 +01:00
Tim Ledbetter 0f831dbcc7 ClipboardHistory: Don't attempt to delete an item if nothing is selected
This prevents a crash if the delete action is invoked using the delete
key while nothing is selected.
2023-01-15 19:19:06 +01:00
Tim Ledbetter 810c23b422 ClipboardHistory: Invalidate model on item removal
Not doing this caused the window to not update until the mouse was
clicked again.
2023-01-15 19:19:06 +01:00
Arda Cinar c1ee919add ls: Add an option to print the human readable sizes in powers of 10 2023-01-15 19:12:19 +01:00
Arda Cinar b1c7575769 du: Add an option to print the human readable sizes in powers of 10 2023-01-15 19:12:19 +01:00
Arda Cinar ae36a80a6c df: Add an option to print the human readable sizes in powers of 10 2023-01-15 19:12:19 +01:00
Tim Ledbetter dd582e4ae3 PixelPaint: Hold shift to increase move tool speed with the arrow keys
Holding shift while using the move tool with the arrow keys now moves
the selected layer in 10 pixel increments.
2023-01-15 19:11:25 +01:00
Sam Atkins 431c4165b5 Spider: Confirm ending the current game in more situations
As for Solitaire, we previously had a warning when trying to exit Spider
while a game was in progress. This adds the same functionality to other
actions that would end the current game: Starting a new one, or
changing the number of suits. When changing the number of suits, we do
apply the setting, so it will take effect for the next game that is
started.
2023-01-15 11:59:59 -05:00
Sam Atkins 8b59517ff2 Solitaire: Confirm ending the current game in more situations
We previously had a warning when trying to exit Solitaire while a game
was in progress. This adds the same functionality to other actions that
would end the current game: Starting a new one, or changing the number
of cards drawn. When changing the number of cards drawn, we do apply
the setting, so it will take effect for the next game that is started.
2023-01-15 11:59:59 -05:00
Lucas CHOLLET c0ada49a24 WidgetGallery: Use the non-deprecated API of LibFileSystemAccessClient
The patch is tiny as WidgetGallery is only using `LibFSAC` for its file
picker.
2023-01-15 16:39:12 +00:00
Liav A 01db302a33 Utilities: Add new utility for converting images to raw bitmap binaries
I used this utility to check if the possible TGA images' cases for
different origins (explictly the Y origin) are generating the same
bitmap, as I felt that my eyes are not a good-enough measurement tool
for this kind of task.
This might be useful in the future for testing other implementations so
I rather have this nice utility in our codebase.
2023-01-15 12:43:03 +01:00
Liav A b2626d3bc1 Lagom/Fuzzers: Add fuzzer for the TGALoader code 2023-01-15 12:43:03 +01:00
Liav A 71f275b5ad Tests/LibGfx: Add tests for compressed TGA images 2023-01-15 12:43:03 +01:00
Liav A 2f2d808869 LibGfx: Add support for RLE compressed TGA images
RLE is an old technique being used for decades, as is known as
Run-Length-Encoding, which means that for repeating sequence of bytes,
we keep an indicator for the length of the sequence and only one sample
of it, to save storage space.

GIMP can generate lossless-compressed TGA images, with RLE compression
being used. It means that for a compressed image, the data is no longer
arranged in sequence of pixels, but a sequence of pixel packets.
There are two possible pixel packets:
- RLE packets, which are encoded with one byte for indicating the
  run-length and another one pixel (3 bytes for TrueColor pixel), so
  essentially in runtime, the TGA decoder will use the length to plot
  the same pixel in multiple pixels of the output pixel bitmap.
- Raw packets, which are encoded with one byte as indicator for the
  length of the whole pixel sequence and N-length pixel sequence
  afterwards.
  This is not used for any sort of compression by the TGA format, but
  still needed to be supported for full compatibility with TGA images
  that uses the RLE compression.
2023-01-15 12:43:03 +01:00
Liav A 6bf2460231 Tests/LibGfx: Add tests for top-left and bottom-left TGA images 2023-01-15 12:43:03 +01:00
Liav A a46df41265 LibGfx: Handle tga images with top-left and bottom-left orientation
GIMP allows a user to export a TGA image with either of these possible
orientations, so we can easily support it by looking at the X origin and
Y origin values to determine where to put the pixels in the bitmap.
2023-01-15 12:43:03 +01:00
Tom Needham 761b89c28e Base: Add ImageViewer as the default app to open TGA files :^)
This patch allows .tga files to be opened by ImageViewer automatically
when selected in FileManager
2023-01-15 12:43:03 +01:00
Tom Needham 591bebe662 LibGfx: Add the TGA format into the list of bitmap formats :^) 2023-01-15 12:43:03 +01:00
Tom Needham 5bce58cd3e LibGfx: Plumb the TGALoader into ImageDecoder :^)
This patch plumbs the TGALoader into ImageDecoder
so TGA images can be decoded by the system
2023-01-15 12:43:03 +01:00
Tom Needham 21db070887 LibGfx: Add TGA Loader :^)
This patch adds a basic TGA Loader. Currently it can only handle
uncompressed files with a bit depth of 24 or 32 bits per pixel.
2023-01-15 12:43:03 +01:00
Arda Cinar 70da5f977b hexdump: Add an option to specify dump offset
This is very helpful when trying to make sense of large binary files :^)
2023-01-15 12:10:21 +01:00
Andreas Kling db27499865 LibWeb: Make sure that fetch() response cookies get saved
We have to provide the Web::Page* in order for cookies to get saved.
2023-01-15 10:53:58 +00:00
Lucas CHOLLET 667ac961b5 Presenter: Use the non-deprecated API of LibFileSystemAccessClient
The patch is tiny as Presenter is only using `LibFSAC` for its file
picker. Using only `LibFSAC` in Presenter would be nice.
2023-01-15 11:37:21 +01:00
nipos bfacbe1e0d LibCore: Enable file descriptor passing on OpenBSD 2023-01-15 01:11:46 +00:00
Agustin Gianni 4a816ed891 LibC: Fix incorrect limit for SSIZE_MAX and remove 32 bit definitions
The file `limits.h` had definitions for x86. This PR removes these
definitions and fixes the upper limit for the type ssize_t which was
defined to be 0x7fffffff.
2023-01-15 01:07:05 +00:00
Timothy Flynn bb4c7b6a35 LibJS: Remove now-unused ThrowableFormat header
The one place this was used now uses the fallible String::formatted.
2023-01-15 01:00:20 +00:00
Timothy Flynn 9f78e8728a LibJS: Port (most of) String.prototype to String
The locations that haven't been ported have a much wider footprint than
just the String.prototype files, so they've been left alone for now.
2023-01-15 01:00:20 +00:00
Timothy Flynn ceaec41726 LibJS: Port Value to-string methods to String 2023-01-15 01:00:20 +00:00
Timothy Flynn 46dd8c1c0b LibJS: Resolve all UTF-8 rope strings as a String 2023-01-15 01:00:20 +00:00
Timothy Flynn 58bc831750 LibUnicode: Return a String from Unicode normalization 2023-01-15 01:00:20 +00:00
Timothy Flynn c9056b824e LibJS: Define Value::to_string to convert a Value to a String 2023-01-15 01:00:20 +00:00
Timothy Flynn afeb7273cc LibJS+Everywhere: Rename Value::to_string to to_deprecated_string 2023-01-15 01:00:20 +00:00
Timothy Flynn 8f5bdce8e7 LibJS: Add initial support for creating PrimitiveStrings with AK::String
This will temporarily bloat the size of PrimitiveString as LibJS is
transitioned to use String throughout, but will make doing so piecemeal
much easier.
2023-01-15 01:00:20 +00:00