Commit graph

58447 commits

Author SHA1 Message Date
Lucas CHOLLET c80b2cf782 LibGfx/ExifOrientedBitmap: Use scanline instead of set_pixel()
The former has the advantage to be available in CMYKBitmap too.

No behavior change.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 8229a19081 LibGfx/ExifOrientedBitmap: Reorganize create parameters
No behavior change.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 09b2b3539b LibGfx/JPEG+CMYKBitmap: Extract the CMYK to RGB conversion code
Right now, the JPEG decoder is the only one supporting CMYK, but that
won't last for long. So, let's move the conversion to CMYKBitmap.
2024-01-24 22:16:22 -07:00
Lucas CHOLLET 0462858247 LibGfx/JPEG: Keep the original CMYK data in memory
When decoding a CMYK image and asked for a normal `frame()`, the decoder
would convert the CMYK bitmap into an RGB bitmap. Calling `cmyk_frame()`
after that point will provoke a null-dereference.
2024-01-24 22:16:22 -07:00
Aliaksandr Kalenik 980b61470c LibAccelGfx+LibWeb+WebContent: Handle OpenGL Context init errors
Now, if OpenGL context fails, an error will be returned and a message
printed, instead of crashing.
2024-01-24 19:43:51 +01:00
Sam Atkins 315c95a1ce HackStudio: Replace custom recent-project management with the LibGUI one
The only downside is we are limited to 4 recent projects now. LibGUI
currently relies on the number of recent files being constexpr, so that
will take some more work to make it variable.
2024-01-24 11:07:03 +00:00
Sam Atkins 343de324db LibGUI: Don't update the recent files if we haven't created them yet
We previously assumed that `set_most_recently_open_file()` would only be
called after `Menu::add_recent_files_list()` had been called, and would
crash if we hadn't called it yet. This stops the crash. We're fine to
do this, because we always call `update_recent_file_actions()` in
`register_recent_file_actions()` so it's guaranteed to be up to date
when we do need it.
2024-01-24 11:07:03 +00:00
Sam Atkins f8fe6d11b2 LibGUI: Allow creating a recent-files list without a trailing separator
This is useful in situations where we want this list in a submenu.
2024-01-24 11:07:03 +00:00
Sam Atkins 9657f4cabb LibGUI+Userland: Take ByteString in set_most_recently_open_file() 2024-01-24 11:07:03 +00:00
Sam Atkins d30f13a88d HackStudio: Jump to file location when choosing a Locator suggestion
A couple of tweaks here to make it work better:
- Call `set_cursor_and_focus_line()` to make the Editor scroll to the
  symbol's location.
- Remove focus from the Locator's text box so your cursor jumps to the
  Editor instead of staying in the Locator.
2024-01-24 11:05:54 +00:00
Sam Atkins 9322f0d110 HackStudio: Use Autocomplete window type for Locator pop-up
This being a Popup window meant it behaved in a couple of janky ways:
- It would steal the focus each time it was shown, so after every key
  press in the TextBox.
- It would disappear when you focused that TextBox again.

Using the Autocomplete window type fixes both of these. While the
Locator is not technically an autocomplete, it shares the general "type
and get suggestions based on the input, which you can select" behavior,
so this is close enough.
2024-01-24 11:05:54 +00:00
Andreas Kling b84056c05b LibWeb: Add missing visits in MessageEvent
Also change a Vector<Handle> to a Vector<NonnullGCPtr> while we're
here, since there's no need to use handles for members of a cell.

Fixes an ASAN error on the HTML/Window-postMessage.html test.
2024-01-24 10:52:02 +01:00
Andreas Kling 413eb19579 LibWeb: Skip UTF-8 validation in Node::descendant_text_content()
Since we're just concatenating a bunch of strings that are already
UTF-8, we don't need to check that the result is also UTF-8.
2024-01-24 07:55:13 +01:00
Andreas Kling 7fedf806c2 LibWeb: Cache pointer to UsedValues for each FlexItem
This avoids expensive repeated LayoutState hash lookups.
2024-01-24 07:53:33 +01:00
Andreas Kling 4e6de47f93 LibWeb: Avoid LayoutState hash lookups in more parts of float layout 2024-01-24 07:53:16 +01:00
Timothy Flynn 11d2e6101f Meta: Add AK and LibRIFF to macOS bundles in GN build 2024-01-23 14:07:46 -07:00
Timothy Flynn e7773f0f0a Meta: Port recent changes to the GN build
29396415d5
1aed465efe
2024-01-23 14:07:46 -07:00
Andrew Kaster bf32a2027b LibWeb: Add happy path test for SubtleCrypto importKey and digest 2024-01-23 14:07:06 -07:00
stelar7 be8489fb04 LibWeb/IDL/Codegen: Handle BufferSource in union types 2024-01-23 14:07:06 -07:00
stelar7 423e77d5c3 LibWeb: Implement import_key for PBKDF2
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-01-23 14:07:06 -07:00
Andrew Kaster 7bc7e2a48f LibWeb: Convert SubtleCrypto::digest to use WebIDL Promises
We should be using WebIDL Promise in these methods, per the spec
references in other specifications. That is, the HTML spec always links
to WebIDL when it talks about `Promise<T>`. The Crypto seems to be
missing those cross-references.

While we're here, actually resolve the digest promise in parallel.
2024-01-23 14:07:06 -07:00
stelar7 3e0c0ce7ae LibWeb: Move dictionaries to separate file
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-01-23 14:07:06 -07:00
stelar7 1bf73482f5 LibWeb: Add using statement for simpler type names 2024-01-23 14:07:06 -07:00
stelar7 0afea792e2 LibWeb: Move dictionaries to the Bindings namespace 2024-01-23 14:07:06 -07:00
stelar7 02a85d8259 LibWeb/IDL/Codegen: Generate cpp_type for enums 2024-01-23 14:07:06 -07:00
stelar7 3f4ed782b4 LibWeb/IDL/Codegen: Fix indentation error due to else block 2024-01-23 14:07:06 -07:00
stelar7 a8ddf6c2a4 LibWeb: Add the CryptoKey interface 2024-01-23 14:07:06 -07:00
Mr.UNIX 69ffdd5738 Welcome: Port to GML Compiler 2024-01-23 21:14:12 +01:00
Sönke Holz 0a4ef6f3b7 Kernel/riscv64: Stub out InterruptManagement::find_controllers
We don't support any IRQControllers for RISC-V (like the PLIC) yet,
so just do nothing here for now.
2024-01-23 13:13:18 -07:00
Sönke Holz cec20908a5 Kernel/riscv64: Add assembly trap handler
This trap handler can't handle traps from userspace yet.
2024-01-23 13:13:18 -07:00
Sönke Holz df21d435eb Kernel/riscv64: Add C++ trap handler
This is a basic trap handler which can handle interrupts and some
exceptions. Syscalls aren't handled yet.
2024-01-23 13:13:18 -07:00
Sönke Holz 0111fe0d24 Kernel/riscv64: Implement Processor::exit_trap
This function is copy-pasted from aarch64's Processor.cpp
2024-01-23 13:13:18 -07:00
Sönke Holz 0e6659d1eb Kernel/riscv64: Implement dump_registers() 2024-01-23 13:13:18 -07:00
Sönke Holz 9bbf513c27 Kernel/riscv64: Implement initialize_interrupts() 2024-01-23 13:13:18 -07:00
Sönke Holz 7b7578bc1b Kernel/riscv64: Add AK::Formatter for scause CSR 2024-01-23 13:13:18 -07:00
Sönke Holz 6d8378735b Kernel/riscv64: Add AK::Formatter for sstatus CSR 2024-01-23 13:13:18 -07:00
Sönke Holz d061da4cf5 Kernel/riscv64: Clean up Timer class
I just copy-pasted microseconds_since_boot and
set_interrupt_interval_usec from aarch64.
However, on RISC-V, they are not in microseconds.
The TimerRegisters struct is also unused.

current_time and set_compare can also be private and static.
2024-01-23 13:13:18 -07:00
Sönke Holz 8582f0720f Kernel/riscv64: Make RISC-V Timer inherit from GenericInterruptHandler
IRQHandler is not the correct class to inherit from, as the timer
is not connected to an IRQController.
Each hart has one of these Timers directly connected to it.
2024-01-23 13:13:18 -07:00
Sönke Holz 8c017c3078 Kernel/riscv64: Remove unnecessary InterruptController header
I originally added this header because I misunderstood how
IRQControllers are supposed to be used.
I thought that I would need a IRQController class for the hart-local
interrupt controller, but apparently, this class is supposed to be used
for non-local interrupt controllers like the IOAPIC or RISC-V PLIC.
x86 LAPICs don't use this class either.
2024-01-23 13:13:18 -07:00
Aliaksandr Kalenik 91ef4fed93 LibWeb: Resolve all layout-dependent properties in one loop
Instead of using separate loops for each property, all the work can
be completed in one loop.

Performance improvement on https://html.spec.whatwg.org/
2024-01-23 21:06:02 +01:00
Aliaksandr Kalenik b9bbe4c166 LibWeb: Remove unnecessary layout tree disconnection during teardown
This code appears to be leftover from times when layout and paintable
trees were not GC-allocated.
2024-01-23 18:48:51 +01:00
Fabian Dellwing e8b5055349 Ports: Update zlib to 1.3.1 2024-01-23 18:31:00 +01:00
Tim Ledbetter 7a3fc621bd LibWeb: Remove invalid assertion in table fixup
Previously, our code for the fixup of table rows assumed that missing
cells in a table row must be sequential. This may not be true if the
table contains cells have a rowspan greater than one.
2024-01-23 10:17:00 +01:00
kleines Filmröllchen 3f0a77e788 disasm: Allow disassembling just one symbol
This is done in a crude way for now in that we
disassemble all instructions up to the symbol without printing them.
2024-01-22 20:54:16 -07:00
kleines Filmröllchen 10a1b0de96 disasm: Overhaul symbol printing
We now split up symbols into zero-sized symbols that label single
instructions (no need to separate them by newlines; they are used for
jump labels and relocation targets within a larger block of code) and
ranged symbols that label functions. Empty symbols are discarded since
at least RISC-V ELF files contain quite a few of those. Zero-sized
symbols and ranged symbols are handled almost the same, but this way we
can make sure that zero-sized symbols don't interfere with ranged
symbol's newline separation logic. For zero-sized symbols, the "symbol
contains address" logic is updated so they actually contain the one
address they're pointing at, fixing the bug with many "dangling"
zero-sized symbols after a function that contained them. Zero-sized
labels are also no longer printed as a start-end range, since that is
unnecessary visual noise.
2024-01-22 20:54:16 -07:00
Lucas CHOLLET 5dfa660a94 LibGfx/TIFF: Add support for Float and Double types
We previously were considering Float and Doubles as non-supported types.
But this was done in a sneaky way, by letting them hit the default case
in the `read_type` method. So, when I ported this function to the
generator we started to make this types flow into the system without a
proper support there. Since 3124c161, we would have crashes on images
containing tags with a floating point value.
2024-01-22 20:50:06 -07:00
Tim Schumacher 5d9fa2b9a9 Meta: Use BXSHARE instead of a hardcoded Bochs directory
This allows using Bochs instances that are installed in non-standard
directories.
2024-01-22 20:18:38 -07:00
Lucas CHOLLET 6eb574a2b6 LibGfx/JPEG: Expose the Exif metadata
The Exif metadata is contained in the APP1 segment. We only need to
call the TIFF decoder to get the metadata back :^).
2024-01-22 20:16:32 -07:00
Lucas CHOLLET f6f647bf13 LibGfx/TIFF: Add an alternative entry point to only request metadata
A lot of images format use Exif to store there metadata. As Exif is
based on the TIFF structure, the TIFF decoder can, without modification
be able to decode the metadata. We only need a new API to explicitly
mention that we only need the metadata.
2024-01-22 20:16:32 -07:00
Lucas CHOLLET 12c38035db LibGfx/TIFF: Rename JPEG to OldJPEG and introduce a new JPEG tag
Support for JPEGs embedded in TIFF images was introduced with TIFF 6.0.
However, this implementation had major issues. It was so problematic
that they decided to reimplement it from scratch in 1995, three years
later. The two incarnations are obviously incompatible.

For more details see:
https://www.awaresystems.be/imaging/tiff/specification/TIFFTechNote2.txt
2024-01-22 20:13:53 -07:00