Commit Graph

53389 Commits

Author SHA1 Message Date
Andreas Kling
72c9f56c66 LibJS: Make Heap::allocate<T>() infallible
Stop worrying about tiny OOMs. Work towards #20449.

While going through these, I also changed the function signature in many
places where returning ThrowCompletionOr<T> is no longer necessary.
2023-08-13 15:38:42 +02:00
0x6D70
980e7164fe Ladybird: Add initial page to history
This fixes a bug where the reload button does not work on the page that
was initially opened
2023-08-13 09:24:19 -04:00
Andi Gallo
b6f9f4c28c LibWeb: Fix handling of max-content containing block for floating box
Fixes layout of page toolbar on Wikipedia.
2023-08-13 14:43:41 +02:00
Andi Gallo
97ba1ff1f7 LibWeb: Remove unused variable from compute_height method 2023-08-13 14:43:41 +02:00
sin-ack
7192cf7487 LibWeb: Add hack for computing the request referer during load
This is a temporary hack until navigables are used to load pages, which
uses fetch infrastructure that does this according to spec.
2023-08-13 14:29:53 +02:00
Liav A
029160fd27 Utilities: Add zcat
This utility is actually a symlink to the gunzip utility.
The gunzip utility is modified to enable writing to stdout when running
through the zcat symlink, to emulate the same behavior on other OSes.

In addition to that, the gunzip utility is now required on a default
installation as it could be a vital utility under some conditions (for
example, downloading source code in a tar.gz file).
2023-08-13 10:16:03 +01:00
Daniel Bertalan
1e737e763e CI: Force UBSan errors to be fatal for Serenity tests
The test runner script sets the `halt_on_error=1` `UBSAN_OPTIONS` flag
already, this just makes it a compile-time decision. This should
alleviate some of the slowness of running on-target tests without
hardware acceleration.
2023-08-13 05:14:07 +02:00
Daniel Bertalan
44365074fe CMake: Add UNDEFINED_BEHAVIOR_IS_FATAL configure option
This is mainly intended for use on CI, as UBSan instrumentation results
in a serious load and execution time penalty there. See the previous
commit for more details.

With this enabled, the size of LibWeb, built for x86-64 with Clang 17 as
of 0b91d36a is reduced as follows:

      FILE SIZE        VM SIZE
   --------------  --------------
     +18% +2.99Mi  [ = ]       0    .debug_info
     +14%  +758Ki  [ = ]       0    .debug_addr
    +2.6% +7.92Ki  [ = ]       0    .debug_abbrev
    +129% +2.66Ki  [ = ]       0    [Unmapped]
    -0.2%    -208  -0.2%    -208    .plt
    -0.2%    -312  -0.2%    -312    .rela.plt
    -0.1%    -336  -0.1%    -336    .dynsym
    -0.0%    -647  -0.0%    -513    [8 Others]
    -0.1% -1.14Ki  -0.1% -1.14Ki    .dynstr
   -20.1% -53.5Ki -20.1% -53.5Ki    .eh_frame_hdr
    -7.2% -56.8Ki  [ = ]       0    .debug_str_offsets
    -7.1%  -156Ki  [ = ]       0    .debug_str
   -15.0%  -160Ki  [ = ]       0    .symtab
   -63.6%  -245Ki -63.6%  -245Ki    .relr.dyn
   -25.4%  -357Ki -25.4%  -357Ki    .eh_frame
   -27.7% -1.09Mi  [ = ]       0    .strtab
   -59.3% -10.0Mi  [ = ]       0    .debug_rnglists
   -41.3% -11.0Mi  [ = ]       0    .debug_line
   -70.0% -12.0Mi -70.0% -12.0Mi    .rodata
   -65.2% -15.1Mi -65.2% -15.1Mi    .data
   -53.0% -15.7Mi -53.0% -15.7Mi    .text
   -41.7% -62.1Mi -57.7% -43.4Mi    TOTAL
2023-08-13 05:14:07 +02:00
Daniel Bertalan
f0973db6dd LibSanitizer: Add _abort variants of UBSan handlers
These variants make the choice to terminate the process a compile-time
decision rather than a runtime-configurable setting through
`UBSAN_OPTIONS`. As the compiler can treat any code following these
UBSan handler calls as dead code, it allows for significant
optimizations, such as removing redundant UBSan checks and not needing
to worry about saving volatile registers before calling these.

Generation of this kind of instrumentation can be enabled with
`-fsanitize=undefined -fno-sanitize-recover=undefined`. Build system
support will come in a separate PR.
2023-08-13 05:14:07 +02:00
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