Commit Graph

53389 Commits

Author SHA1 Message Date
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
Sam Atkins
be9c975b2e LibWeb: Implement algorithms for determining an indicated element 2023-08-12 08:39:04 +02:00
Sam Atkins
13b4bf48a8 LibWeb: Give Document a "target element"
The target element is the one matching the URL fragment. We don't yet
set it to anything.
2023-08-12 08:39:04 +02:00
Sam Atkins
28aa4ca767 AK: Add URL::raw_fragment()
This is a little hackish. Part of the algorithm to get the indicated
part of a DOM::Document
https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document
wants to first get the URL's fragment, use it, and then later
percent-decode it and use that. So, we need a way to get that
un-decoded fragment.
2023-08-12 08:39:04 +02:00
Daniel Bertalan
c0cf6e3744 CMake: Set -fvisibility-inlines-hidden on ELF platforms
The C++ semantics of `inline` dictate that such functions might be
defined in multiple translation units. As with all other functions, they
must have the same address in all TUs. Because of this, the compiler
emits `inline` functions as weak symbols, which the dynamic linker can
then resolve to the same address everywhere.

This rule is responsible for a significant overhead at startup, as such
lookups happen by name. Namely, 86'000 of the 114'000 by-name symbol
lookups when loading LibWeb can be attributed to this. Most of these
are only ever defined in a single object, making this even more
pointless.

As nothing in our code relies on either ELF symbol interposition rules
or function address equality, we can use the -fvisibility-inlines-hidden
escape hatch, which causes this rule to be disregarded. As the symbols
are now hidden, no load-time symbol lookup is needed. This flag is used
without issues in other large C++ codebases like Chromium and LLVM.

Some relevant light reading, suggested by Nico:
- https://ridiculousfish.com/blog/posts/i-didnt-order-that-so-why-is-it-on-my-bill-episode-1.html
- https://www.cs.dartmouth.edu/~sergey/cs258/ABI/UlrichDrepper-How-To-Write-Shared-Libraries.pdf
- https://blog.llvm.org/2018/11/30-faster-windows-builds-with-clang-cl_14.html
- https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fvisibility-inlines-hidden
2023-08-12 05:14:20 +02:00
Andrew Kaster
2299fe1481 Ladybird: Install headers for WebContent when used externally 2023-08-11 20:09:20 -06:00
Andrew Kaster
e28d883f8d Ladybird: Link libraries to WebContent impl lib to add dependencies 2023-08-11 19:26:21 -06:00
Andrew Kaster
88082bfada Ladybird: Install an impl library for WebContent when ENABLE_QT=OFF
This should allow out of tree chromes to prototype other LibWeb platform
plugins easier when using Lagom as a find_package dependency.
2023-08-11 19:07:45 -06:00
Liav A
184056cf6a Ports/cpio: Update to version 2.14
We can also remove a patch that is no longer needed.
2023-08-12 02:07:54 +02:00