Commit Graph

53374 Commits

Author SHA1 Message Date
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
ronak69
0787241cdc Utilities: Fix title formatting in man
`String::repeated()` returns a `ErrorOr<String>`, so wrap it in `TRY()`.

This fixes a glitch in the title formatting (`{}` not removed if
`ErrorOr<String>` is directly passed to `outln()`).
2023-08-12 01:50:49 +02:00
Tim Ledbetter
720d9dd683 Ports/poppler: Explicitly exclude optional dependencies
Previously, the optional `gpgme` and `nss3` dependencies could be
unintentionally included if they were present on the host machine.
2023-08-12 01:35:16 +02:00
Daniel Bertalan
286984750e Kernel+LibC: Pass 64-bit integers in syscalls by value
Now that support for 32-bit x86 has been removed, we don't have to worry
about the top half of `off_t`/`u64` values being chopped off when we try
to pass them in registers. Therefore, we no longer need the workaround
of pointers to stack-allocated values to syscalls.

Note that this changes the system call ABI, so statically linked
programs will have to be re-linked.
2023-08-12 01:14:26 +02:00
Tim Ledbetter
87f4b0f1c2 Ports/mgba: Explicitly exclude optional dependencies
Previously, some optional dependencies could be unintentionally
included if they were present on the host machine.
2023-08-12 00:18:03 +02:00
Tim Ledbetter
c2afd3de23 Ports/mgba: Update formatting to be consistent with other ports 2023-08-12 00:18:03 +02:00
Lucas CHOLLET
729e35ef21 LibGfx/JPEGXL: Remove unused variables in JPEGXLLoadingContext
These two variables are already fields of `Frame`, they make no sense at
the context scope.
2023-08-12 00:15:58 +02:00
Gurkirat Singh
294a778492 Ports: Improve and refactor build_all.sh script
All the shellcheck errors are fixed, and output will how have coloured
logs with status symbol.

	1. # -> operation completed successfully
	2. ~ -> currently processing port
	3. * -> information
	4. ! -> warning
	5. x -> error in processing port

Now, you can use the failfast option to instantly exit the loop
whenever it reports an error while processing any port. Using realpath
of the ports directory to use `cd` operation only once and get rid of
pushd-popd pattern here.
2023-08-11 21:51:59 +02:00
kleines Filmröllchen
54eab251f6 Base: Document new GML usage method
This is now preferred over the old one.
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
8ec9b26bba Help: Use new GML code generator 2023-08-11 21:33:48 +02:00
kleines Filmröllchen
d1645efde9 Meta+Userland: Allow generating C++ initializer code from GML
This does the exact same thing as the runtime initializer,
except it is faster and can catch some errors much earlier.

The code generator includes these important features:
- Automatic include generation where necessary
- Special-casing for TabWidget and ScrollableContainerWidget
- No use of DeprecatedString where possible
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
1e67435ff5 Meta: Rename compile_gml to stringify_gml
This is what this function really does, it doesn't compile anything.
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
e2dbce8fd7 LibGUI: Allow generating C++ "constructor" code for UIDimension
This will be used in the proper GML generator to initialize UI dimension
properties.
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
d385adf6bd LibGUI: Don't silently create a 0 UIDimension when the JSON is invalid
The function already can report an invalid JSON value for the dimension,
so let's actually use that for when the number is too large or some
other invalid JSON type, like an object or a boolean, was passed.
2023-08-11 21:33:48 +02:00
kleines Filmröllchen
ea0ab87b88 LibGUI: Allow creating margins from arrays
This is necessary for upcoming GML -> C++ compilation.
2023-08-11 21:33:48 +02:00
Aliaksandr Kalenik
9101c8d079 LibWeb: Use available space to resolve table container width
Using avilable space directly while resolving table container width
allows to avoid assigning it to table wrapper box content width which
sometimes involves infinite (saturated) values.

Also this allows to get rid of set_max_content_width() which is a hack
that allows to bypass set_content_width() to assign infinite
(saturated) width to a box.

Closes https://github.com/SerenityOS/serenity/issues/19521
2023-08-11 19:36:19 +02:00