Commit Graph

60595 Commits

Author SHA1 Message Date
Sönke Holz
8f0ebce404 LibELF: Reorganize TLS-related variables in DynamicLinker.cpp 2024-04-19 16:46:47 -06:00
Sönke Holz
cb48f31d79 LibELF: Add helpers for setting the thread pointer register 2024-04-19 16:46:47 -06:00
Sönke Holz
216089c7a1 Kernel: Add a Thread member for arch-specific data
This will be used to store the fs_base value on x86-64, which is needed
for thread-local storage.
2024-04-19 16:46:47 -06:00
Sönke Holz
57f4f8caf8 Kernel+LibC: Introduce new archctl syscall
This syscall will be used for architecture-specific operations.
2024-04-19 16:46:47 -06:00
Andrew Kaster
5e1d678bae Ladybird+Userland: Remove use of unnecessary fd passing socket concept
Now that LibIPC is using SCM_RIGHTS properly, we can go back to only
having one socket laying around when needing to transfer fds to peers.
2024-04-19 16:38:55 -04:00
Andrew Kaster
cb87725ec8 LibIPC+LibWeb: Transfer IPC::Files using sendmsg/recvmsg directly
This refactor eliminates the need for a second "fd passing socket" on
Lagom, as it uses SCM_RIGHTS in the expected fashion, to send fds along
with the data of our Unix socket message.
2024-04-19 16:38:55 -04:00
Andrew Kaster
a18c7c4405 LibCore: Let LocalSocket send and receive messages with SCM_RIGHTS
These new methods combine send/receive with send_fd/receive_fd.

This is the 'correct' way to use SCM_RIGHTS, rather than trying to
emulate the Serenity behavior on other Unixes.
2024-04-19 16:38:55 -04:00
Andrew Kaster
0e699743c4 LibCore: Move PosixSocketHelper's read EOF handling to a helper
We'll call this from upcoming LocalSocket methods directly
2024-04-19 16:38:55 -04:00
Andrew Kaster
1e749d023a AK: Add fallible dequeue method to Queue 2024-04-19 16:38:55 -04:00
Andrew Kaster
a65c385057 Kernel: Don't try to copy empty Vector in sys$recvmsg
If there's no fds to copy in a message with proper space for an
SCM_RIGHTS set of cmsg headers, then don't try to copy them.

This avoids a Kernel panic when recvmsg-ing, as copy_to_user(p, 0, 0)
hits a VERIFY.
2024-04-19 16:38:55 -04:00
Nico Weber
3568215790 Tests/JPEG2000: Add spec example as test case
This tests reading JPEG2000 codestreams that aren't embedded in
the ISOBMFF wrapper. It's also useful for debugging bitstream
internals, since the spec lists expected output for many internal
intermediate results.
2024-04-19 12:42:34 -04:00
Nico Weber
0c935f8f42 LibGfx/JPEG2000: Support reading raw jpeg2000 codestreams
Most JPEG2000 files put the codestream in an ISOBMFF box structure
(which is useful for including metadata that's bigger than the
~65k marker segment data limit, such as large ICC profiles), but
some files just store the codestream directly, for example
https://sembiance.com/fileFormatSamples/image/jpeg2000/balloon.j2c

See https://www.iana.org/assignments/media-types/image/j2c for the
mime type.

The main motivation is to be able to use the test data in J.10 in
the spec as a test case.
2024-04-19 12:42:34 -04:00
Nico Weber
5695acf328 LibGfx/JPEG2000: Add comment mentioning J.10 2024-04-19 12:42:34 -04:00
Nico Weber
1a232ba2a6 LibGfx/JPEG2000: Check SIZ marker (w, h) against JP2 header (w, h) 2024-04-19 12:42:34 -04:00
Nico Weber
f2e381ae19 LibCore: Add ".jpf" as a JPEG2000 extension
This is what Photoshop uses for JPEG2000 outputs.
2024-04-19 12:42:34 -04:00
Nico Weber
2467374ea9 LibCore: Add comment with link to mime registry to MimeData.cpp 2024-04-19 12:42:34 -04:00
Andrew Kaster
6d4ba21832 LibIPC+Userland: Make IPC::File always own its file descriptor
Add factory functions to distinguish between when the owner of the File
wants to transfer ownership to the new IPC object (adopt) or to send a
copy of the same fd to the IPC peer (clone).

This behavior is more intuitive than the previous behavior. Previously,
an IPC::File would default to a shallow clone of the file descriptor,
only *actually* calling dup(2) for the fd when encoding or it into an
IPC MessageBuffer. Now the dup(2) for the fd is explicit in the clone_fd
factory function.
2024-04-19 06:34:07 -04:00
Andrew Kaster
26ce8ad40f LibWeb: Stop leaking socket fds when sending them over IPC
The implicit constructor for IPC::File does not take ownership of the
file, which is surprising.
2024-04-19 06:34:07 -04:00
Alex
13abb1b2c7 LibWeb: Add name validation and document check to setAttribute
Co-authored-by: Rayyan Hamid <rayyanbwp@gmail.com>
Co-authored-by: Christian Ewing <u1273549@utah.edu>
Co-authored-by: Austin Fashimpaur <austin.fashimpaur@gmail.com>
2024-04-19 06:32:41 -04:00
Dan Klishch
5ed7cd6e32 Everywhere: Use east const in more places
These changes are compatible with clang-format 16 and will be mandatory
when we eventually bump clang-format version. So, since there are no
real downsides, let's commit them now.
2024-04-19 06:31:19 -04:00
Andreas Kling
5ef6df79ed LibWeb: Generate a simple error page when XML decode/parse fails
This fixes a regression on Acid3, since we are not expected to "best
effort" parse XML. The test specifically checks that you don't create an
incomplete, incorrect DOM.
2024-04-19 11:44:32 +02:00
Timothy Flynn
5a3efb8842 LibLocale: Update to CLDR version 45.0.0
https://cldr.unicode.org/index/downloads/cldr-45
2024-04-19 11:00:31 +02:00
Timothy Flynn
7e51d6e07d Meta: Port recent changes to the GN build
e487f70bbf
f4f4f7781d
2024-04-19 11:00:31 +02:00
Nico Weber
ca3a62a6bb LibGfx: Add a comment to QMArithmeticDecoder.h 2024-04-19 10:59:11 +02:00
Nico Weber
ea441fea95 LibGfx: Move QMArithmeticDecoder to its own file
It will be used by the JPEG2000 decoder as well.

Pure code move, no behavior change.
2024-04-19 10:59:11 +02:00
Nico Weber
5ff75ce5fb LibGfx/JBIG2: Rename JBIG2::ArithmeticDecoder to QMArithmeticDecoder
In preparation of moving it to its own file.

No behavior change.
2024-04-19 10:59:11 +02:00
PGHales
75626c6cd2 LibWeb/DOM: Implement the Document object's partial attributes 2024-04-19 10:58:45 +02:00
PGHales
ded344aa2c LibWeb/DOM: Rename link_color to normal_link_color 2024-04-19 10:58:45 +02:00
Aliaksandr Kalenik
7b75d0c1f0 LibWeb: Fix height distribution in "vertical-align: baseline" in TFC
This line changes padding top to align cell content to baseline:
`cell.padding_top += m_rows[cell.row_index].baseline - cell.baseline`

Which means available for distribution height `height_diff` could have
changed so it needs to be refreshed before assigning the rest of it to
padding bottom:
`cell_state.padding_bottom += height_diff;`

Fixes https://github.com/SerenityOS/serenity/issues/22032
2024-04-19 10:55:28 +02:00
Andreas Kling
eb2c05e906 Tests/LibWeb: Fix rebaseline-libweb-test after RequestServer changes 2024-04-19 10:53:20 +02:00
Andrew Kaster
2a48eff2d6 CI: Enable KVM on Github Actions runners
https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
2024-04-18 18:26:36 -06:00
Cubic Love
d5aab4204a Base: Add manpage for Screenshot 2024-04-18 13:44:53 -06:00
Andreas Kling
4a795bef48 Tests/LibWeb: Fix iframe-load-event-for-bad-xml.html test
This was supposed to be an async test (and work correctly, too!)

This fixes up fa43321938
2024-04-18 21:17:01 +02:00
Dan Klishch
fa1eef8bbe Toolchain: Update LLVM to 18.1.3
Apart from bumping the toolchain Clang's and port's version, this commit
completely overhauls the way LLVM toolchain is built.

First, it gets rid of a complicated two-stage process of first compiling
clang and compiler-rt builtins and then building libunwind, libc++abi,
and libc++ -- it is possible to create a complete cross-compilation
toolchain in a single CMake invocation with a modern LLVM. Moreover, the
old method was inherently unsupported and subtly broken.

Next, it utilizes full potential of the Stubs "framework". Now we are
even able to compile Clang with -Wl,-z,defs which makes one of the
patches obsolete and the whole installation less error-prone. Note that
it comes at a cost of complicating the bootstrap process on a completely
novel architecture but this hopefully won't happen often.

Lastly, it fixes handling of the -no*lib* family of flags in the
Serenity LLVM driver and correctly uses -nostartfiles in conjunction
with stubs to make necessary CMake configure-time checks succeed.
2024-04-18 13:14:33 -06:00
Dan Klishch
3bd1305218 Ports/zig: Copy LLVM patches instead of symlinking them
LLVM toolchain is about to get updated to 18.1.3, which would desync
these patches.
2024-04-18 13:14:33 -06:00
Sönke Holz
bee7070da0 Kernel: Do not use -mcmodel=large for x86_64 kernel
Small position independent code model (which we end up using after this
change) is suitable for us since the kernel is not expected to grow more
than 2Gb in size. This might be a bit risky since this model is not
mentioned anywhere except for System V ABI document but experiments show
that the kernel compiled with this change works just fine.
2024-04-18 13:14:33 -06:00
Dan Klishch
b8c3e75573 Meta+Userland: Fix more instances of bad lambda-Variant interaction
These don't cause compilation to fail but they still crash crashd.
2024-04-18 13:14:33 -06:00
Daniel Bertalan
d282066ba4 LibGfx: Spell IPCEncode::encode definitions instead of abusing concepts
The original approach failed to link with LLVM 18 because of the changed
symbol mangling.
2024-04-18 13:14:33 -06:00
implicitfield
1159cd9390 AK+Kernel+LibSanitizer: Implement __ubsan_handle_function_type_mismatch 2024-04-18 13:14:33 -06:00
implicitfield
7a74805067 Tests: Avoid casting function types in LibC/TestSearch.cpp
Doing so causes a function type mismatch, which makes the test crash
when built with a new enough version of UBSan.
2024-04-18 13:14:33 -06:00
Daniel Bertalan
8366c9f55a LibGUI+PixelPaint: Move virtual destructors out-of-line for Clang 17 2024-04-18 13:14:33 -06:00
Andreas Kling
fa43321938 LibWeb: Fire iframe load event for frames with badly encoded XML
When loading an XML resource into an iframe and the resource fails to
decode (e.g due to invalid UTF-8), we must still fire a load event.

This fixes the regression in subtest 69 of Acid3.
2024-04-18 15:40:16 +00:00
Aliaksandr Kalenik
bad86ca6b4 LibWeb: Ignore mousewheel events in ViewportPaintable
That allow EventHandler process wheel event on corresponding navigable.
For top-level navigable that means IPC call to let chrome know about
scrollbar position update.

Fixes https://github.com/SerenityOS/serenity/issues/23599
Fixes https://github.com/SerenityOS/serenity/issues/23493
Fixes https://github.com/SerenityOS/serenity/issues/23966
2024-04-18 12:27:24 +02:00
Aliaksandr Kalenik
d53058421a LibWeb: Do not paint scrollbar of ViewportPaintable
Scrollbar of viewport is supposed to be painted by chrome.
2024-04-18 12:27:24 +02:00
Aliaksandr Kalenik
eb4f36e5a1 Tests/LibWeb: Add a test for iframe load event when src has xml type
Reduction from Acid3 that was fixed by changing
guess_mime_type_based_on_filename() to support xml extension.
2024-04-18 08:10:05 +00:00
Aliaksandr Kalenik
fea58a4160 LibCore: Support xml in guess_mime_type_based_on_filename() 2024-04-18 08:10:05 +00:00
Aliaksandr Kalenik
d876f32e5d LibWeb: Skip creating a navigable for <object> not connected to document
Navigation should not run for <object> element until it is inserted into
a document. Spec deoes not seem to explicitely say that, but that
matches other browsers behavior.

Fixes hanging after reloading in Acid3 test.
2024-04-18 08:09:51 +00:00
Aliaksandr Kalenik
68440ed02d LibWeb: Destroy associated navigable when <object> is removed from DOM 2024-04-18 08:09:51 +00:00
Fabian Dellwing
fc0d447adb Ports: Update jq to 1.7.1 2024-04-17 19:43:35 +02:00
Fabian Dellwing
1c381b34e9 Ports: Add oniguruma 2024-04-17 19:43:35 +02:00