Commit graph

53397 commits

Author SHA1 Message Date
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
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
Daniel Bertalan
055d2b6c8a CMake: Enable RELR relocations for Clang OR x86-64
While LLD and mold support RELR "packed" relocations on all
architectures, the BFD linker currently only implements them on x86-64
and POWER.

This fixes two issues:
- The Kernel had it enabled even for AArch64 + GCC, which led to the
  following being printed: `warning: -z pack-relative-relocs ignored`.
- The userland always had it disabled, even in the supported AArch64 +
  Clang/mold scenarios.
2023-08-12 19:39:00 +02:00
Daniel Bertalan
11896868d6 CMake: Clean up AArch64 compiler flags
Two non-functional changes:
- Remove pointless `-latomic` flag. It was specified via
  `add_compile_options`, which only affects compilation and not linking,
  so the library was never actually linked into the kernel. In fact, we
  do not even build `libatomic` for our toolchain.
- Do not disable `-Wnonnull`. The warning-causing code was fixed at some
  point.

This commit also removes `-mstrict-align` from the userland. Our target
AArch64 hardware natively supports unaligned accesses without a
significant performance penalty. Allowing the compiler to insert
unaligned accesses into aligned-as-written code allows for some
performance optimizations in fact. We keep this option turned on in the
kernel to preserve correctness for MMIO, as that might be sensitive to
alignment.
2023-08-12 19:39:00 +02:00
kleines Filmröllchen
e304ba492f Meta: Fix ENABLE_LAGOM_LIBWEB CMake configuration 2023-08-12 11:29:43 -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
Liav A
9b61339261 Ports/tar: Update to version 1.35
This version requires the gettext port as a dependency.

In addition to that, this release has a bug in which it doesn't include
libintl and libiconv properly when building the program.
Therefore, we add a patch that was originally made by Sergey Poznyakoff
after the report of this bug (savannah bug #64441).
2023-08-12 15:24:19 +02:00
Justin Brown
ec0bf937a2 Ports: Add Julius 2023-08-12 14:50:52 +02:00
Tim Ledbetter
51ee37ed76 Ports/wayland: Add libffi dependency
This allows `wayland` to build from a clean state.
2023-08-12 14:23:56 +02:00
Andi Gallo
89305f1481 LibWeb: Copy button style properties for generated table and cell 2023-08-12 13:36:37 +02:00
Edwin Rijkee
637c74ac93 Kernel: Add PCISerialDevice WCH CH351 IDs
Add the device ID for PCI serial port cards that use the WCH CH351
chip. This device has been tested with real hardware where the serial
debug output could succesfully be received.
2023-08-12 13:08:07 +02:00
Andi Gallo
a24deff21b LibWeb: Remove unused computed values for removed button flow-root 2023-08-12 11:48:45 +02:00
Jonah
0b2da4f8c6 LibWeb: Add the default user agent MathML stylesheet
We now apply MathML's default user agent style sheet along with other
default styles. This sheet is not mixed in with the other styles in
CSS/Default.css because it is a namespaced stylesheet and so has to
be its own sheet.
2023-08-12 07:59:23 +01:00
Jonah
fd0ee8ae7b LibWeb: Escape quotes in style sheet sources
Some rules in style sheets contain quotes, escaping them allows us to
generate code that actually compiles for them.
2023-08-12 07:59:23 +01:00
Jonah
442602bec8 LibWeb: Generate MathML Elements
We will now generate MathML elements when parsing HTML.
2023-08-12 07:59:23 +01:00
Jonah
52d6df5ee5 LibWeb: Add the MathML Element
This patch introduces the MathML element, which provides the interface
all MathML elements are built from.
2023-08-12 07:59:23 +01:00
Jonah
cce50b1841 LibWeb: Add MathML Namespace to IDL Generator
This will make the codegen produce code for MathML IDL that doesn't
fail to compile in confusing ways.
2023-08-12 07:59:23 +01:00
Aliaksandr Kalenik
d978c762bc LibJS: Remove usage of bytecode_interpreter_if_exists()
There is no need to check if bytecode interpreter exists after we
switched away from AST interpreter.
2023-08-12 08:46:35 +02:00
Aliaksandr Kalenik
0abe2a5023 Meta: Remove usage of bytecode_interpreter_if_exists() in js_repl
There is no need to check if bytecode interpreter exists after we
switched away from AST interpreter.
2023-08-12 08:46:35 +02:00
Lucas CHOLLET
ea85c99a01 LibGfx/JPEGXL: Add support for cropped images
Due to the way JPEG XL encodes its lossless images, it is sometimes
interesting to embed a large image and crop the result at the end. This
patch adds the functionality to crop a frame.

Note that JPEG XL supports image composition (almost like layers in
image editing software programs) and I tried to make these changes be
a step toward image composing. It's a small step as we are still unable
to read multiple frames, and we only support the `kReplace` blending
mode.
2023-08-12 08:46:10 +02:00
Lucas CHOLLET
49c55447d9 LibGfx/JPEGXL: Put frame's image inside the Frame struct
The image was previously managed as an output parameter of the
`read_frame` function. This reorganisation also brings us closer to the
spec. As it is specified that each frame have its own image that will
later on compose a greater bitmap.
2023-08-12 08:46:10 +02:00
Lucas CHOLLET
70e4d3a9b6 LibGfx/JPEGXL: Support images with the have_crop option in FrameHeader
This commit only allows us to read these values. The decoder will still
output the image as if no cropping was requested.
2023-08-12 08:46:10 +02:00
Sam Atkins
a9620d8784 LibWeb: Implement the :target selector pseudo-class
We don't yet set the Document's target element in most cases, so this
does not function very well. But that will improve once we *do* set it,
which involves a more complete Navigables implementation.
2023-08-12 08:39:04 +02:00
Sam Atkins
8bd3b74e3a LibWeb: Implement and use "scroll to the fragment" algorithm
This will eventually be used by Navigable but for now, it's just when
traversing the history.
2023-08-12 08:39:04 +02:00