Commit graph

53380 commits

Author SHA1 Message Date
Daniel Bertalan
a2d352c4c9 LibSanitizer: Abort on unrecoverable UBSan errors
There is no sensible recovery possible from non-void functions that
fail to return a value, or from `__builtin_unreachable()` being reached,
all bets are off once they happened. This is why LLVM's libsanitizer
treats these as always fatal, even if all other UBSan checks are made
recoverable with `-fsanitize-recover`. The codegen already assumes that
these handlers will not return.
2023-08-13 05:14:07 +02:00
auipc
1653c5ea41 LibWeb: Use current platform for navigator.platform
Before, navigator.platform would always report the platform as "Serenity
OS", regardless of whether or not that was true. It also did not include
the architecture, which Firefox and Chrome both do. Now, it can report
either "Linux x86_64" or "SerenityOS AArch64".
2023-08-13 05:13:18 +02:00
thankyouverycool
1ea24c38b4 LibGUI: Fix typo in Splitter's resizee Getter/Setter 2023-08-13 05:12:00 +02:00
Andrew Kaster
a0a1411ec9 CMake: Set CMAKE_RUNTIME_OUTPUT_DIRECTORY based on CMAKE_INSTALL_BINDIR
Instead of hardcoding bin/, we should use the INSTALL_BINDIR directly
to reflect the intent of the way we're doing the settings.

This should have the benefit of fixing the build when a distro sets the
GNUInstallDirs variables to exciting values, like on NixOS.
2023-08-12 18:21:38 -06:00
kleines Filmröllchen
aa741a1544 GMLCompiler: Allow using GML in any kind of Userland program
This is accomplished by detecting the Userland subdirectory from the GML
file's own path. Thereby, any Userland program, e.g. applet,
application, or even service, can use GML and the include paths of the
generated files will be correct.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
285119bc1a GMLCompiler: Force main class name to be resolved from global namespace
Calculator would otherwise trip over this, since there's a class with
the same name within the namespace.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
842a5adfdc GMLCompiler: Add a variety of special cases
Headers, enum properties, and associated default includes.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
a24d9f5e22 GMLCompiler: Handle bitmap properties 2023-08-12 12:29:19 -06:00
kleines Filmröllchen
04a4f6a2e8 GMLCompiler: Allow generating enum constants from strings
As with other special cases, this depends on the property name.

The UIDimension code is kept separate since it can handle both integers
and strings, and the string names for special dimensions don't match
with the enum names.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
cc6b9d5873 GMLCompiler: Escape compiled strings
We don't want a newline to cause havoc.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
33bd078052 GMLCompiler: Handle spacer pseudo-objects 2023-08-12 12:29:19 -06:00
kleines Filmröllchen
2e46e33a9b LibGUI: Add direct property for fixed-width font
There's the "font_type" property which currently only handles
fixed-width yes/no, so until we get a proper font type enum and
associated enum property, this is better to use from GML instead of a
special case in the GML compiler.
2023-08-12 12:29:19 -06:00
kleines Filmröllchen
bb471451e0 aconv: Time transcode duration
This is a good indicator for encode speed.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
70f31c89a3 aconv: Support FLAC encoding
The main write loop is refactored so that adding further formats via the
new Encoder interface should be much simpler.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
625aac2367 LibAudio: Add a FLAC encoder
This encoder can handle all integer formats and sample rates, though
only two channels well. It uses fixed LPC and performs a
close-to-optimal parameter search on the LPC order and residual Rice
parameter, leading to decent compression already.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
252b1328ea LibAudio: Expand FLAC loader debug messages
These are now indented to aid readability.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
60f1472902 LibAudio: Store all available data in the FLAC frame header
This will make it possible to write the header back out.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
7bb128e1ed LibAudio: Add integer sample format-specific support
This allows us to better handle specifically integer sample formats.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
e45a666419 LibAudio: Calculate and verify frame checksum
This is the second of three checksums that FLAC provides, verifying all
of a frame's data.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
fb37587efe LibCrypto: Implement a generic 16-bit CRC
This is mostly a 16-bit version of the 8-bit CRC, using the same general
byte-LUT algorithm.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
ae039977d1 LibAudio: Use Encoder interface for WavWriter
The only real change here is the fallibility of the finalization
function, which makes WavWriter's code quite a bit nicer.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
513e000e86 LibAudio: Generalize an encoder interface
This interface is very simple for the time being and can be used to
provide encoding functionality in a generalized way. Initialization and
parameter setting are intentionally not abstracted for now, since this
is usually very format-specific. We just need a general interface for
writing samples and errorable finalization.
2023-08-12 12:25:26 -06:00
kleines Filmröllchen
001ea22917 AK+LibCore: Make output buffered stream seekable
Just like with input buffered streams, we don't currently have a use
case for output buffered streams which aren't seekable, since the main
application are files.
2023-08-12 12:25:26 -06:00
Liav A
c2d9d0277f Ports: Add groff
This port is exceptionally useful in the ports ecosystem, as it will
allow us to read ROFF manual pages within the system.
2023-08-12 20:24:18 +02:00
kleines Filmröllchen
d905498fb6 AudioServer: Clean up ClientAudioStream APIs
- Use Optional references instead of pointers
- Clean up some const and nullability weirdness
- Use proper error return value for get_next_sample
2023-08-12 12:22:16 -06:00
kleines Filmröllchen
aacb4fc590 AudioServer: Move ClientAudioStream to own files
This class will only grow, and it should really have its own files.
2023-08-12 12:22:16 -06:00
Andreas Kling
3406d500a4 LibWeb: Hook up WOFF2 decompression in the StyleComputer
With this, we now support WOFF2 fonts on the web :^)
2023-08-12 20:12:13 +02:00
Andreas Kling
6076580a47 LibWeb: Accept "woff2" as a @font-face source format 2023-08-12 20:12:13 +02:00
Andreas Kling
9ba4c33940 LibGfx: Add support for WOFF2 compressed web fonts
Co-authored-by: Luke Wilde <lukew@serenityos.org>
2023-08-12 20:12:13 +02:00
Andreas Kling
43c9c2ef02 LibGfx/OpenType: Refuse to rasterize glyphs with invalid bounding box 2023-08-12 20:12:13 +02:00
Andreas Kling
8ac30aa318 LibGfx/OpenType: Move Glyf composite flag enum to header file
This will allow us to use it for WOFF2 decompression.
2023-08-12 20:12:13 +02:00
Aliaksandr Kalenik
bb52d76be3 LibWeb: Delete unused AvailableSize::to_px() 2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
fce4801460 LibWeb: Replace to_px() with to_px_or_zero() in InlineFormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
4646867a9f LibWeb: Replace to_px() with to_px_or_zero() in FormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
c102bcda9b LibWeb: Replace to_px() with to_px_or_zero() in TableFormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
af38f1cba4 LibWeb: Replace to_px() with to_px_or_zero() in GridFormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
8b99366b9d LibWeb: Replace to_px() with to_px_or_zero() in FlexFormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
041d02cbb1 LibWeb: Replace to_px() with to_px_or_zero() in BlockFormattingContext
to_px() usage should be avoided because it might leak saturated
(infinite) values into layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
57c1fe97fb LibWeb: Define comparison operators with CSSPixels for AvailableSize
This allows to compare CSSPixels with AvailableSize without converting
it to CSSPixels, which might leak saturated (infinite) values into
layout calculations.
2023-08-12 20:06:01 +02:00
Aliaksandr Kalenik
d34007782d LibWeb: Define operator< for AvailableSize 2023-08-12 20:06:01 +02:00
Liav A
3f63be949a Kernel/Net: Don't allocate memory for adapters' names
Instead, use a FixedStringBuffer to store a string with up to 16 chars.
2023-08-12 11:48:48 -06:00
Liav A
b2fd51f561 AK: Implement string formatting for FixedStringBuffers
To ensure this happens without duplicating code, we allow forcing a
StringBuilder object to only use the inline buffer, so the code in the
AK/Format.cpp file doesn't need to deal with different underlying
storage types (expandable or inline-fixed) at all.
2023-08-12 11:48:48 -06:00
Liav A
b096f39e92 Documentation: Update the kernel development guide on FixedStringBuffer
The following changes take effect:
1. Annotate FixedStringBuffer => `FixedStringBuffer` in many places.
2. Remove non-existing helpers for FixedStringBuffers. I added them
previously but even then they were removed in a following fixup so these
references were never valid. Therefore let's just put a vague reference
to the fact that we have some helpers for this class in the Kernel, and
let people to figure out quickly by themselves for this topic.
3. Put a sentence to explain that FixedStringBuffer objects are not only
being used in syscall handling code, but also for storing actual data in
both the Thread and Process classes as well.
2023-08-12 11:46:38 -06:00
Valtteri Koskivuori
2b23f3f216 LibIMAP: Fix Parser::parse_disposition()
It didn't consume the initial opening "(" before.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
35f1cec7ca LibIMAP: Propagate errors from Parser::parse_number()
More error propagation is still needed, we really want the parser to
just crash early when it encounters unexpected input, instead of trying
to carry on like nothing happened.
I think ErrorOr<unsigned> is *much* better than returning (unsigned)-1
to indicate an error ;)
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
077a8058c3 LibIMAP+Mail: Implement RFC2047 message header encoding
This enables us to display email subject fields with non-ASCII
characters in Mail :^)
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
34adf9eeae LibIMAP: Wait for a full IMAP response before parsing
We're now sniffing the incoming data to verify the server has sent a
full response, instead of passing partial data to our IMAP parser.
Our parser really can't handle partial input very well, so for the time
being, this heuristic does a much better job of verifying we have full
response before parsing.
It doesn't yet handle unprompted untagged reponses, nor the
"continuation request" responses that start with a `+`, but we don't
fully support those yet.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
0b7e18177b LibIMAP: Rename position -> m_position in IMAP::Parser
No functional changes, just renaming this member variable to bring that
in line with current coding style.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
8451c4d91c LibIMAP: Add useful dbgln_if() printouts to IMAP::Parser
I couldn't run the parser in a debugger like I normally would, so I
added printouts to understand where the parser is failing.
More could be added, but these are enough to get a good idea of what
the parser is doing. It's very spammy, though, so enable it by flicking
the IMAP_PARSER_DEBUG switch :^)
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
c2ed1547ba LibIMAP: Remove needless conversion to DeprecatedString
We're comparing the return value to StringViews right after, so there is
no need to do the conversion twice.
2023-08-12 11:45:52 -06:00