Commit Graph

3425 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
2ead999f2b LibGfx+LibWeb: Remove typeface classes for WOFF fonts
This change removes wrappers inherited from Gfx::Typeface for WOFF and
WOFF2 fonts. The only purpose they served is owning of ttf ByteBuffer
produced by decoding a WOFF/WOFF2 font. Now new FontData class is
responsible for holding ByteBuffer when a font is constructed from
non-externally owned memory.
2024-07-22 15:05:04 +02:00
Andrew Kaster
922c6bde87 CMake: Enable policy 0157 for more control over Swift compile mode 2024-07-21 15:55:47 -06:00
Andrew Kaster
68ce5f8290 Ladybird/AppKit: Port TaskManager window to Swift
This is just a direct port of the Objective-C++ code to Swift 6.
A future patch should probably update it to actually use SwiftUI.
2024-07-21 15:55:47 -06:00
Andrew Kaster
4066ce2c7e CMake: Ensure C/C++ compile options only applied when compiling C/C++ 2024-07-21 15:55:47 -06:00
Aliaksandr Kalenik
f3b3b3f5b9 LibWeb: Delete DisplayListPlayerCPU
No longer used after switching to Skia as a default.
2024-07-21 10:36:17 +02:00
Andrew Kaster
8e5d28de3c CMake: Force vcpkg to use CMAKE_CXX_COMPILER as specified to CMake
Override the vcpkg/scripts/detect_compiler behavior of always pulling
$CC and $CXX at the time that vcpkg install is determined to need called
by forcing $ENV{CXX} and $ENV{CC} to our CMake-determined compiler.

This prevents strange behavior such as running the following:

./Meta/ladybird.sh run
    make changes...
ninja -C Build/ladybird

Where the second build step would be run without CC or CXX set in the
environment, causing a total cache miss from vcpkg and a full rebuild.

It also helps prevent full rebuilds when an IDE passes a slightly
different compiler to the build step than ladybird.sh.
2024-07-18 14:48:20 +02:00
Timothy Flynn
7c813d3992 Meta+CI: Hook up the Lagom tools build with vcpkg
AK will depend on some vcpkg dependencies, so the Lagom tools build will
need to know how to use vcpkg. We can do this by sym-linking vcpkg.json
to Meta/Lagom (as vcpkg.json has to be in the CMake source directory).
We also need a CMakePresets.json in the source directory, which can just
include the root file. The root CMakePresets then needs to define paths
relative to ${fileDir} rather than ${sourceDir}.
2024-07-18 14:46:25 +02:00
Daniel Bertalan
a4645060e6 CMake: Add hardening flags
- `-fstack-protection-strong` enables stack canaries for functions where
  addresses of local variables are taken or arrays/structures
  containing arrays are allocated on the stack.
- `-fstrict-flex-arrays=2` causes the compiler to only treat arrays with
  unknown bounds (`[]`) or zero-length-arrays (`[0]`) as *flexible array
  members*, allowing the sanitizers to emit bounds checks for structs
  with proper arrays as their last member.

More rigorous options (such as AArch64 pointer authentication, Control
Flow Integrity, _FORTIFY_SOURCE) should be investigated in the future,
however this is a good baseline.
2024-07-17 21:51:29 +02:00
Daniel Bertalan
c62240aa80 Everywhere: Warn on function definitions without prototypes
If no header includes the prototype of a function, then it cannot be
used from outside the translation unit it was defined in. In that case,
it should be marked as `static`, in order to avoid possible ODR
problems, unnecessary exported symbols, and allow the compiler to better
optimize those.

If this warning triggers in a function defined in a header, `inline`
needs to be added, otherwise if the header is included in more than one
TU, it will fail to link with a duplicate definition error.

The reason this diff got so big is that Lagom-only code wasn't built
with this flag even in Serenity times.
2024-07-17 21:51:29 +02:00
Daniel Bertalan
7fe82a1cda CMake: Add back stricter warnings used in Serenity builds
These used to be enabled in `serenity_compile_options.cmake` for
Serenity builds and were removed in 9b05fb98. This is a slightly more
conservative subset of those, with ones that are enabled by default
omitted.

This should prevent our code quality regressing in the long run.
2024-07-17 21:51:29 +02:00
Jamie Mansfield
e8fe7c0ee3 LibWeb: Prevent infinite loop in create_an_inheritance_stack
This would continually loop on the same interface.

Co-authored-by: Matthew Olsson <matthewcolsson@gmail.com>
2024-07-17 18:19:09 +01:00
circl
a443f50807 Base: Move config files out of home/anon and into default-config 2024-07-17 09:57:46 -06:00
sideshowbarker
15d67f0da2 Meta: Make check-debug-flags.sh runnable in Bash 3.2
This change updates the Meta/check-debug-flags.sh script to avoid an
apparent Bach 3.2 parser bug. Specifically, it takes a comment and some
code of a process substitution and moves it into a separate function.

Otherwise, without this change, trying to run the check-debug-flags.sh
script with Bash 3.2 fails with the following error:

line 39: bad substitution: no closing `)' in <(

...apparently because Bash 3.2 chokes on the comment (and doesn’t choke
if the comment is completely removed).

Relates to https://github.com/LadybirdBrowser/ladybird/issues/283
2024-07-16 09:13:14 -06:00
sideshowbarker
570814a31e Meta: Make all pre-commit CI scripts work with Bash 3.2
This change makes all the pre-commit CI scripts runnable under Bash 3.2,
by replacing “mapfile” invocations in them code that first explicitly
creates an array, and then uses a while loop to populate the array.

Otherwise, without this change, the scripts all fail to run under Bash
3.2 — due to lack of support for “mapfile”.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/283

This also drops bash from the list of homebrew dependencies in the build
instructions — because with this change, homebrew bash (v4) is no longer
needed; things will now work with the Apple-provided bash (v3.2)
2024-07-16 08:56:22 -06:00
Timothy Flynn
58dfe5424f AK: Make the AK library's CMake a bit more standard
We no longer have multiple locations including AK (e.g. LibC). So let's
avoid awkwardly defining the AK library across multiple CMake files.

This is to allow more easily adding third-party dependencies to AK in
the future.
2024-07-16 10:27:39 +02:00
Diego Frias
f63a945ba0 LibWeb: Implement the :has() pseudo-class
See https://drafts.csswg.org/selectors-4/#relational.
2024-07-15 11:52:03 +01:00
Andrew Kaster
31eec0a145 Documentation+Toolchain: Don't try to build CMake from source
This build step is a bit excessive. Let's require people to have an
up-to-date CMake from their system package manager instead.
2024-07-15 10:15:40 +02:00
Kotaro Ichihara
0307095f52 Meta: Make ladybird.sh old bash compatible 2024-07-14 19:55:50 -06:00
Diego
3a0f80bbae LibWasm: Ignore tests that check that we don't support 2+ memories
Since we support the multi-memory proposal, we should skip tests that
validate that we have only one memory. Once multi-memory gets included
in the main WebAssembly specification (and the testsuite is updated), we
can revert this commit.
2024-07-14 11:26:52 +02:00
Jamie Mansfield
d4a7cfb68f LibWeb: Stub BroadcastChannel interface
This is enough to get the 1Password login page to load :^)
2024-07-13 19:53:02 +02:00
Aliaksandr Kalenik
c09b5b8df0 LibGfx+LibWeb: Rename Gfx::WOFF2::Font to Gfx::WOFF2::Typeface
It's a leftover from VectorFont -> Typeface renaming
2024-07-13 09:31:02 +02:00
Aliaksandr Kalenik
1d2e559e13 LibGfx+LibWeb: Rename Gfx::WOFF::Font to Gfx::WOFF::Typeface
It's a leftover from VectorFont -> Typeface renaming
2024-07-13 09:31:02 +02:00
Aliaksandr Kalenik
2f515827c0 Everywhere: Rename Gfx::OpenType::Font to Gfx::OpenType::Typeface
It's a leftover from VectorFont -> Typeface renaming
2024-07-13 09:31:02 +02:00
Diego
906fa04822 LibWasm: Properly check for indeterminate NaNs in SIMD tests
Because `nan:arithmetic` and `nan:canonical` aren't bound to a single
bit pattern, we cannot check against a float-containing SIMD vector
against a single value in the tests. Now, we represent `v128`s as
`TypedArray`s in `testjs` (as opposed to using `BigInt`s), allowing us
to properly check `NaN` bit patterns.
2024-07-12 18:27:47 +02:00
Diego
524e09dda1 LibWasm: Check for correct NaN bit patterns in tests
Some spec-tests check the bit pattern of a returned `NaN` (i.e.
`nan:canonical`, `nan:arithmetic`, or something like `nan:0x200000`).
Previously, we just accepted any `NaN`.
2024-07-12 18:27:47 +02:00
Diego
da8633b2d0 LibWasm: Fix spec-test gen for inline commands and special characters
`linking.wast` has an unusual pattern for invoke commands, which is now
accounted-for. Also, special unicode characters are now properly
serialized in JavaScript as string literals (this is only relevant for
`names.wast`).
2024-07-11 21:29:18 +02:00
Andrew Kaster
731431c870 Meta: Set proper BUILD_DIR for different build presets in ladybird.sh
Also set ASAN/UBSAN_OPTIONS environment variables when running with
the Sanitizer build preset.
2024-07-11 11:05:57 -06:00
Dennis Camera
033057683c Everywhere: Don't install code generators and test binaries 2024-07-10 10:13:21 -06:00
Andrew Kaster
40a2bb32c3 LibWeb: Create separate DedicatedWorkerGlobalScope class
This is how it's supposed to have been from the beginning, we were just
lazy :).
2024-07-10 07:04:53 +02:00
Andrew Kaster
5d8784318d LibWeb: Initialize HTML::EventLoop with its type 2024-07-10 07:04:53 +02:00
Jamie Mansfield
190a419715 LibWeb: Implement EmbedderPolicy struct 2024-07-10 07:03:37 +02:00
Maciej
65d8d205ee LibWeb: Implement HTML DragEvent class
This just defines the class, drag events aren't actually fired yet.
2024-07-09 11:28:32 +01:00
Jamie Mansfield
21c5373456 Base: Support dark mode in version page 2024-07-09 11:21:07 +02:00
Jamie Mansfield
fe551d3eff Base: Update to new project logo
This removes the existing 16x16 and 32x32 app icons with 48x48 and
128x128 versions, as the new logo is not well suited to such small
resolutions.
2024-07-09 11:21:07 +02:00
Diego
c103001f16 LibWasm: Fix lossy NaN bit pattern conversions in spec-test gen 2024-07-08 15:12:16 +02:00
Diego
6493acf2f4 LibWasm: Preserve sign bit across JS boundary in test-wasm
A `Uint8Array` can now be passed in the Wasm testjs files to be
transmuted into a Wasm value.
2024-07-08 15:12:16 +02:00
Andrew Kaster
62268cca9e CMake: Add ENABLE_GUI_TARGETS option to enable disabling GUI components
This is useful when, e.g. building the test262 runner on its own.
2024-07-07 09:51:29 -06:00
Andrew Kaster
22d7aa53fa Meta: Tell vcpkg we don't need to build vulkan-loader
Trying to build VulkanLoader from source is a giant headache of
unnecessary packages. Every modern distro has vulkan packages, let's
depend on those instead of trying to build something for both wayland
and X11.
2024-07-07 09:51:29 -06:00
Andrew Kaster
233320ef17 Meta: Set proper PKG_CONFIG_EXECUTABLE and GN paths for aarch64 Linux
We need to avoid using vcpkg's pkg-config on non-x86_64 platforms,
because they do very strange things to the default paths.

On Asahi Linux and other 16 KiB page distros, the user must also provide
a properly compiled version of GN.
2024-07-07 15:56:59 +02:00
Andrew Kaster
a3e24163aa Meta: Add overlay port for vulkan-loader
In order to pass the proper pkg-config on aarch64 linux, we need
to patch this port to use vcpkg's own find_tool infrastructure.
2024-07-07 15:56:59 +02:00
Andrew Kaster
0a16a09993 CMake: Add triplets for arm64-linux 2024-07-07 15:56:59 +02:00
Andrew Kaster
34892cf3c4 Meta: Add provision for user-specified port variables to vcpkg
If a CMake file set()'s some variables that VCPKG understands here,
it will be used in the build of all ports
2024-07-07 15:56:59 +02:00
Andreas Kling
bbc17c3523 Meta: Update Lagom ReadMe links to the Ladybird LibJS website
Also remove references to the web REPL as we no longer build that.
2024-07-07 11:37:11 +02:00
mbal
4b924e6782 Meta: Use the binary to run the app instead of open on macos
This should fix the control-c issue mentioned in
https://github.com/LadybirdBrowser/ladybird/issues/68
2024-07-07 08:06:00 +02:00
Ali Mohammad Pur
e0465b8939 Revert "LibTLS+Everywhere: Switch to using WolfSSL"
This reverts commit 8bb610b97a.
Linking wolfSSL seems to cause more legal trouble than it's worth due to
it being GPLv2, so let's undo this for now.
2024-07-06 15:15:34 -06:00
Ali Mohammad Pur
8bb610b97a LibTLS+Everywhere: Switch to using WolfSSL
This commit replaces all TLS connection code with wolfssl.
The certificate parsing code has to remain for now, as wolfssl does not
seem to have any exposed API for that.
2024-07-06 22:15:19 +02:00
Jamie Mansfield
ecad28657a LibWeb/HTML: Implement TextTrackList IDL interface 2024-07-06 11:41:13 +02:00
Andrew Kaster
bd97442771 Meta: Add vulkan and vulkan-headers to vcpkg dependencies
Also require a specific ICU version to not run into unexpected problems.
2024-07-06 01:44:58 +02:00
Alex Studer
cdd91f4b48 Ladybird+LibCore+Meta: Update font paths and names for Android
We also disable fontconfig, because it doesn't have support for Android.
2024-07-05 14:27:25 -06:00
Alex Studer
feababea74 Meta/CMake: Use default linker for Android 2024-07-05 14:27:25 -06:00