Commit Graph

27512 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
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
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
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
Valtteri Koskivuori
6128e859ac LibIMAP+Mail: Propagate errors from LibIMAP and MailWidget
This lets us bubble up errors from `LibIMAP::Client::send_command()`,
which can happen if the connection hangs or is taking a long time, and
the user closes Mail.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
fc54bd03f9 Mail: Fetch and display date in e-mail list
Added a third column to show date of e-mail, as sent from the IMAP
server.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
f74380eecf Mail: Keep user in the loop by updating status bar
The status bar now shows what the IMAP client is doing to keep the user
feeling like things are happening.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
bdecb0a999 Mail: Don't crash on invalid/missing From Email header
During testing, I found that some Email clients/providers format the
From header field content with a lower case f, so `from:` instead of
`From:`. Our client previously gave up if it couldn't find one that
starts with a capital F. Now, we try both, and provide a fallback if
neither were found.
2023-08-12 11:45:52 -06:00
Valtteri Koskivuori
08fb98caac Mail: Fix crash when closing window before IMAP::Client connects
`MailWidget::m_imap_client` is only assigned after a connection is
established, so the user might close the main window before that
happens, especially if the connection hangs for whatever reason.
Now we check the `OwnPtr` before working with it.
2023-08-12 11:45:52 -06:00
Andreas Kling
3a4d386f05 LibWeb: Fetch CSS @font-face fonts in @import'ed style sheets
This makes importing Google Fonts via @import rule actually work. :^)
2023-08-12 19:03:59 +02:00
Sam Atkins
337754ae64 LibWeb: Add hack for :host in pseudo-class serialization
The spec for this algorithm is quite outdated, we already have some
other pseudo-classes in here which the spec doesn't cover.
2023-08-12 16:26:32 +02:00
Sam Atkins
a31a0934b8 LibWeb: Use PseudoClassMetadata to simplify serialization 2023-08-12 16:26:32 +02:00
Sam Atkins
b684bab5f1 LibWeb: Make :host() take a <compound-selector>
This matches the spec:
https://drafts.csswg.org/css-scoping-1/#selectordef-host
2023-08-12 16:26:32 +02:00
Sam Atkins
b314a115ca LibWeb: Use generated PseudoClass data
Everything should behave the same as before.
2023-08-12 16:26:32 +02:00
Sam Atkins
f76c614a84 LibWeb: Generate PseudoClass metadata
The usual to/from-string functions, and metadata about whether the
pseudo-class is a a function or not, and what type of parameter it
takes.
2023-08-12 16:26:32 +02:00
Aliaksandr Kalenik
e25b1f76e1 LibWeb: Forbid usage of indefinite width in calculate_min{max}_height
Changing `calculate_min_content_heigh()` and
`calculate_min_content_heigh()` to accept width as `CSSPixels`, instead
of `AvailableSize` that might be indefinite, makes it more explicit
that width is supposed to be known by the time height is measured.

This change has a bit of collateral damage which is rows height
calculation regression in `table/inline-table-width` that worked before
by accident.
2023-08-12 16:26:08 +02:00