Commit graph

58167 commits

Author SHA1 Message Date
Kevin Meyer
284f14d046 LibVideo: Replace DeprecatedFlyString with FlyString 2024-01-14 15:00:13 -07:00
Jelle Raaijmakers
8b2144c8e6 Ports: Update ScummVM to 2.8.0 2024-01-14 14:59:57 -07:00
Sergey Bugaev
1205f29a40 LibSQL: Don't try to fchmod() socket on GNU/Hurd
Because of the way sockets are implemented, a local socket object inside
pflocal has little to do with the filesystem node that has an ifsock
translator sitting on it; and the latter doesn't even exist until you
bind() the socket.

So it's not possible to set the socket's mode using Unix-level APIs
(other than by temporarily changing umask). It's still possible to do
this with Mach-level APIs, essentially doing the same thing as glibc's
bind() implementation does, but supplying the desired mode instead of
0666, but let's not go there.
2024-01-14 14:56:33 -07:00
Sergey Bugaev
c64c199ab7 LibJS: Don't use MADV_FREE / MADV_DONTNEED on GNU/Hurd
Much like on Serenity itself, these aren't implemented.
2024-01-14 14:56:33 -07:00
Sergey Bugaev
8c1f87a869 LibJIT: Fix 32-bit build
Cast through the integer of an appropriate size. This still generates
a 64-bit ELF image.
2024-01-14 14:56:33 -07:00
Lucas CHOLLET
66f52d6db9 LibGUI: Use BoxSampling to draw thumbnails 2024-01-14 21:26:36 +01:00
Lucas CHOLLET
a3d48319fe LibCompress/Deflate: Remove three useless FIXMEs 2024-01-14 21:22:35 +01:00
Lucas CHOLLET
830e6472e6 LibCompress/Deflate: Simplify DeflateDecompressor::decompress_all() 2024-01-14 21:22:35 +01:00
Lucas CHOLLET
cc6ca7d873 LibGfx/TIFF: Parse the ExifIFD tag
And add a spec link :^)
2024-01-14 21:17:50 +01:00
Lucas CHOLLET
1d0a762cdb LibGfx/TIFF: Add support for the IFD type
As described in the first edition of the TIFF technical notes, the IFD
type is identical to Long (UnsignedLong) except that it only contains
offset of valid IFDs.

https://www.awaresystems.be/imaging/tiff/specification/TIFFPM6.pdf
2024-01-14 21:17:50 +01:00
Lucas CHOLLET
1de90bf55e LibGfx/TIFF: Generate the function that returns the size of a TIFF::Type 2024-01-14 21:17:50 +01:00
Lucas CHOLLET
3124c1616c LibGfx/TIFF: Generate code for the u16 to TIFF::Type conversion 2024-01-14 21:17:50 +01:00
Nicolas Ramz
a1255cb6c9 LibGfx/ILBMLoader: Don't decode bits once full row has been decoded
We were potentially decoding more bits than needed: this could
trash the next lines if decoder didn't zero the extra bits.
2024-01-14 20:41:25 +01:00
Tim Ledbetter
d545fb2b60 LibCrypto: Parse negative input correctly in BigFraction::from_string()
Previously, when calling `BigFraction::from_string()`, the fractional
part of the number was always treated as positive. This led to an
incorrect result if the input string was negative.
2024-01-14 20:15:15 +01:00
Sam Atkins
e0fd5beb36 LibGUI+Applications: Default the SpinBox min/max to the full int range
By default, a SpinBox's value should be unlimited, (or as close as we
can get to that,) and then the GML or code can impose a limit if
needed. This saves the developer from entering an arbitrary "big" max
value when they want the value to have no maximum.

I've audited the use of SpinBox and added `min: 0`, and removed a `max`,
where appropriate. All existing SpinBoxes constructed in code have a
range set explicitly as far as I can tell.
2024-01-14 13:46:14 +00:00
Sam Atkins
cbd28c9110 HexEditor: Add annotations system
Allow the user to highlight sections of the edited document, giving them
arbitrary background colors. These annotations can be created from a
selection, or by manually specifying the start and end offsets.
Annotations can be edited or deleted by right-clicking them.

Any color can be used for the background. Dark colors automatically make
the text white for easier readability. When creating a new annotation,
we use whatever color the user last picked as this is slightly more
likely to be the one they want.

Icons contributed by Cubic Love.

Co-authored-by: Cubic Love <7754483+cubiclove@users.noreply.github.com>
2024-01-14 13:45:02 +00:00
Sam Atkins
1168e46c1d HexEditor: Extract pixel-position-to-byte-offset code 2024-01-14 13:45:02 +00:00
Sam Atkins
84dd0ce1ae HexEditor: Wrap selection and behavior in a struct 2024-01-14 13:45:02 +00:00
Nico Weber
96e8debf0b test-jpeg-roundtrip: Add a few more colors 2024-01-14 11:35:40 +00:00
Nico Weber
25efe65a83 test-jpeg-roundtrip: Print summary statistics at the end 2024-01-14 11:35:40 +00:00
Nico Weber
8ef3310525 test-jpeg-roundtrip: Print perceived delta of fixpoint to start color 2024-01-14 11:35:40 +00:00
Nico Weber
5a47e71604 Utilities: Add test-jpeg-roundtrip
This creates a bitmap filled with a fixed color, then (in memory)
saves it as jpeg and loads it again, and repeats that until the
color of the bitmap no longer changes. It then reports how many
iterations that took, and what the final color was.

It does this for a couple of colors.

This is for quality assessment of the jpeg codec. Ideally, it should
converge quickly (in one iteration), and on a color not very far from
the original input color.
2024-01-14 11:35:40 +00:00
Shannon Booth
9d4278ad9a LibWeb: Wait until new document is active before running SVG scripts
This is the same fix as 07928129dd
also applied to the SVG script element case. Fixes a crash for the
following HTML:

```html
<svg>
<script>
location.reload();
</script>
</svg>
```

As with the linked commit:
> With this change WebContent does not crash when `location.reload()` is
> invoked but `Navigable::reload()` still not working because of spec
> issue (whatwg/html#9869) so we can't add a
> test yet.
2024-01-14 11:27:58 +00:00
Shannon Booth
4135c3885c LibWeb: Only wait for document to be ready for scripts if executing one
HTML fragments are parsed with a temporary HTML document that never has
its flag set to say that it is ready to have scripts executed. For these
fragments, in the HTMLParser, these scripts are prepared, but
execute_script is never called on them.

This results in the HTMLParser waiting forever on the document to be
ready to have scripts executed.

To fix this, only wait for the document to be ready if we are definitely
going to execute a script.

This fixes a hang processing the HTML in the attached test, as seen on:
https://github.com/SerenityOS/serenity

Fixes: #22735
2024-01-14 11:27:58 +00:00
Tim Ledbetter
48a3a02238 LibCrypto: Make constructing a BigInteger from string fallible
Previously, constructing a `UnsignedBigInteger::from_base()` could
produce an incorrect result if the input string contained a valid
Base36 digit that was out of range of the given base. The same method
would also crash if the input string contained an invalid Base36 digit.
An error is now returned in both these cases.

Constructing a BigFraction from string is now also fallible, so that we
can handle the case where we are given an input string with invalid
digits.
2024-01-13 19:01:35 -07:00
Tim Ledbetter
0b0c7693e2 LibCrypto: Prefer operator when converting string literal to BigInteger 2024-01-13 19:01:35 -07:00
Tim Ledbetter
65827826fe AK: Add CharacterTypes::is_ascii_base36_digit()
This can be used to validate the string passed to
`parse_ascii_base36_digit()`.
2024-01-13 19:01:35 -07:00
Tim Ledbetter
bbdbd71439 Tests/AK: Add unit test for Base36 digit parsing 2024-01-13 19:01:35 -07:00
Liav A
fc0dbd2334 Utilities: Add the listdir utility
This utility uses the Core::DirIterator facility which in turn uses the
get_dir_entries syscall. Therefore, this utility lets us to view the
actual values for inode numbers, and entry type value for directory
entries.
2024-01-13 19:01:07 -07:00
Liav A
603516e8c0 LibCore: Add new flag for DirIterator to not use fstatat
This will be useful in the upcoming listdir utility (in the next commit)
to get the file type which is obtained in the get_dir_entries syscall,
so it's not changed later by the fstatat syscall.

This will ensure that we get the raw file type value as it's represented
by directory entries from the get_dir_entries syscall.
2024-01-13 19:01:07 -07:00
Liav A
d568b09632 LibCore: Add methods to convert DirectoryEntry types to names
We can either convert DirectoryEntry::type to its representative name or
to the POSIX DT_* name.
2024-01-13 19:01:07 -07:00
Liav A
90152dc859 Tests/Kernel: Add test cases for proper types in dirent for various FSes 2024-01-13 19:01:07 -07:00
Liav A
a10e63f08e Kernel/FileSystem: Send proper filetypes when traversing RAM-backed FSes
SysFS, ProcFS and DevPtsFS were all sending filetype 0 when traversing
their directories, but it is actually very easy to send proper filetypes
in these filesystems.
This patch binds all RAM backed filesystems to use only one enum for
their internal filetype, to simplify the implementation and allow
sharing of code.
Please note that the Plan9FS case is currently not solved as I am not
familiar with this filesystem and its constructs.

The ProcFS mostly keeps track of the filetype, and a fix was needed for
the /proc root directory - all processes exhibit a directory inside it
which makes it very easy to hardcode the directory filetype for them.
There's also the `self` symlink inode which is now exposed as DT_LNK.

As for SysFS, we could leverage the fact everything inherits from the
SysFSComponent class, so we could have a virtual const method to return
the proper filetype.
Most of the files in SysFS are "regular" files though, so the base class
has a non-pure virtual method.

Lastly, the DevPtsFS simply hardcodes '.' and '..' as directory file
type, and everything else is hardcoded to send the character device file
type, as this filesystem is only exposing character pts device files.
2024-01-13 19:01:07 -07:00
Lucas CHOLLET
75bd1308c5 Tests/LibCompress: Add a reproducer of oss-fuzz issue 58046
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58046
2024-01-13 15:17:08 -07:00
Sam Atkins
336b8ed80b HackStudio: Use Core::System APIs where possible 2024-01-13 15:13:36 -07:00
Sam Atkins
16543a1918 HackStudio: Convert ProjectTemplate::create_project to ErrorOr
This lets us also use the Core::System APIs, which reduces the amount of
error checking code.
2024-01-13 15:13:36 -07:00
Bastiaan van der Plaat
63c6eae918 LibWebView: Fix sanitizing about scheme URLs 2024-01-13 13:41:09 -05:00
Bastiaan van der Plaat
cde14901bc Ladybird+LibWeb: Add initial about:version internal page 2024-01-13 13:41:09 -05:00
Bastiaan van der Plaat
05c0640474 Ladybird+LibWeb: Add about scheme support for internal pages 2024-01-13 13:41:09 -05:00
Bastiaan van der Plaat
c0acb2918b Ladybird: Rename new-tab.html file to newtab.html 2024-01-13 13:41:09 -05:00
Bastiaan van der Plaat
e3ad75d073 Ladybird: Move and format directory and error template files 2024-01-13 13:41:09 -05:00
Aliaksandr Kalenik
2960bf4ec8 LibWeb: Make inline paintables own their fragments
The paintable tree structure more closely matches the painting order
when fragments are owned by corresponding inline paintables. This
change does not affect the layout tree, as it is more convenient for
layout purposes to have all fragments owned by a block container in
one place.

Additionally, this improves performance significantly on pages with
many fragments, as we no longer have to walk the ancestor chain up
to the closest block container to determine if a fragment belongs
to an inline paintable.
2024-01-13 18:46:41 +01:00
Aliaksandr Kalenik
5ed936289a LibWeb: Set box-shadow for inline paintables in LayoutState::commit()
This is part of the efforts towards making the paintable tree
independent of the layout tree.
2024-01-13 17:31:01 +01:00
Andreas Kling
bfa4143e70 LibWeb: Avoid an unnecessary LayoutState lookup in FlexFormattingContext
The containing block of a flex item is always formed by the flex
container, duh. :^)
2024-01-13 14:34:39 +01:00
Andreas Kling
ba286781b4 LibWeb: Detach all paintables when building/committing layout tree
Instead of trying to be clever and detaching the paint tree lazily,
just detach all paintables from both DOM and layout tree when building
and committing respectively.
2024-01-13 12:34:53 +01:00
Andreas Kling
b0afe8463a LibWeb: Make Node::paintable_box() go directly to the paintable
No need to go via the layout tree here, that's a vestige of an earlier
architecture limitation.
2024-01-13 12:33:53 +01:00
Shannon Booth
e6861cb5ef LibWeb: Port Element::insert_adjacent from ByteString 2024-01-13 12:05:36 +01:00
Shannon Booth
bd2fe3dcaa LibWeb: Use FlyString in Document::get_elements_by_name 2024-01-13 12:05:36 +01:00
Shannon Booth
2a94cddb02 LibWeb: Remove duplicated HTMLInputElement::name
This is already implemented by Element with a cache. Remove it - and
make use of this function where applicable.
2024-01-13 12:05:36 +01:00
Shannon Booth
0695236408 LibWeb: Use cached element name and id where possible
Instead of looking up in the named node map, we can simply use the
cached name and ID on the element.
2024-01-13 12:05:36 +01:00