Commit graph

3691 commits

Author SHA1 Message Date
Tim Ledbetter
70fdf7affb IDLGenerators: Add register to the list of C++ keywords
This ensures that a generated C++ method called `register` will have an
underscore appended to it, avoiding a compile error.
2024-08-25 09:48:30 +02:00
Andrew Kaster
4ba274691e CMake: Add script to FetchContent the swift-collections library
It requires a few patches on top of the latest release to play nice
with our CMake setup.
2024-08-24 19:14:09 -06:00
Andrew Kaster
c1c7e5ff3e AK+Meta: Add SwiftAK module to add helpers to construct swift Strings
This allows constructing Foundation.Data and Swift.String without
unnecessary copies from AK.StringView and AK.String respectively.
2024-08-24 19:14:09 -06:00
Jamie Mansfield
169163b002 LibWeb/EntriesAPI: Implement FileSystemEntry 2024-08-24 14:53:11 +02:00
Timothy Flynn
8865d18a67 LibWeb: Allow callback parameters to be nullable
This is needed for DataTransferItem's getAsString(callback?) prototype.
2024-08-23 10:10:34 +01:00
Timothy Flynn
74d9cfbf2a LibWeb: Implement DataTransferItemList.prototype.add() 2024-08-22 14:21:13 +02:00
Timothy Flynn
0b0d44da27 LibWeb: Implement the ClipboardEvent IDL interface
We don't actually generate any such events ourselves. But Google Lens
will create one with the DataTransfer attribute set to that of any drop
event we send it.
2024-08-22 14:21:13 +02:00
Timothy Flynn
268d6dda2f LibWeb: Sort list of imported namespaces 2024-08-22 14:21:13 +02:00
Sam Atkins
3af6a69f1e LibWeb: Introduce color-function-specific style values
Instead of CSSColorValue holding a Gfx::Color, make it an abstract class
with subclasses for each different color function, to match the Typed-OM
spec. This means moving the color calculations from the parsing code to
the `to_color()` method on the style value.

This lets us have calc() inside a color function, instead of having to
fully resolve the color at parse time. The canvas fillStyle tests have
been updated to reflect this.

The other test change is Screenshot/css-color-functions.html: previously
we produced slightly different colors for an alpha of 0.5 and one of
50%, and this incorrect behavior was baked into the test. So now it's
more correct. :^)
2024-08-21 10:51:48 +01:00
Sam Atkins
581d00293c LibWeb: Rename ColorStyleValue -> CSSColorValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#csscolorvalue

This is not (yet) the same as the CSSColorValue, but one step at a time.
2024-08-21 10:51:48 +01:00
Andreas Kling
aabad3b94e LibGfx: Remove a bunch of no-longer-used OpenType font code
We're not quite ready to remove the old OpenType implementation yet,
but let's carve off some unused stuff.
2024-08-20 09:30:05 +02:00
Andreas Kling
c8f09312f7 LibGfx: Rename Path => DeprecatedPath 2024-08-20 09:30:05 +02:00
Andreas Kling
0c7670b226 LibGfx: Rename Painter => DeprecatedPainter 2024-08-20 09:30:05 +02:00
Andrew Kaster
d105b1d4f8 LibWeb: Generate a clang module map file, including generated headers 2024-08-19 12:56:55 +02:00
Andrew Kaster
804729fe37 Libraries+Ladybird: Rename LibProtocol -> LibRequests
The identifier "Protocol" is claimed by Objective-C and Swift for use
by the language's built-in protocol conformance feature, which is
similar to Rust traits or Java interfaces.

Rename LibProtocol -> LibRequests, and its namespace from Protocol to
Requests to accomodate this.
2024-08-19 12:56:55 +02:00
Braydn
a94bf9bd09 LibThreading: ThreadPool deadlock test
Enable `LibThreading` tests and add a test to check for deadlocks in
`ThreadPool`s
2024-08-19 03:08:04 +02:00
Andrew Kaster
7f0044a721 CMake: Add helper to swiftify imported properties from dependencies
Works around https://gitlab.kitware.com/cmake/cmake/-/issues/26195
2024-08-17 17:44:37 -06:00
Tim Ledbetter
335d51d678 IDLGenerators: Make USVString attribute reflection spec compliant
USVString attributes Now replace any surrogates with the replacement
character U+FFFD and resolve any relative URLs to an absolute URL. This
brings our implementation in line with the specification.
2024-08-17 07:45:00 +02:00
Tim Ledbetter
a859b3610d Meta: Use QT_QPA_PLATFORM offscreen in WPT.sh
This has better compatibility with MacOS.
2024-08-17 07:43:29 +02:00
Tim Ledbetter
961ad3c8e9 Meta: Use correct binary paths for MacOS in WPT.sh 2024-08-17 07:43:29 +02:00
Tim Ledbetter
29886b804d Meta: Use cross-platform method to get number of CPUs in WPT.sh 2024-08-17 07:43:29 +02:00
Tim Ledbetter
819f966419 Meta: Ensure required hosts are present before running tests in WPT.sh
The Web Platform Tests runner requires that some hostnames point to
localhost when running the tests locally. We now append these hostnames
to `/etc/hosts` if they aren't already present.
2024-08-17 07:43:29 +02:00
Jamie Mansfield
ea61e189eb LibWeb/SVG: Add missing SVGGElement IDL file 2024-08-17 07:41:04 +02:00
Jamie Mansfield
e2f599ebee LibWeb/SVG: Implement <metadata> element 2024-08-17 07:40:45 +02:00
Jamie Mansfield
e3b3041a0c LibWeb: Implement NavigatorStorage mixin interface
Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
2024-08-16 11:22:09 -04:00
Jamie Mansfield
1b84062c74 LibWeb: Stub StorageManager idl interface 2024-08-16 11:22:09 -04:00
Sam Atkins
6a74b01644 LibWeb: Rename "identifier" and "ValueID" to "Keyword" where correct
For a long time, we've used two terms, inconsistently:
- "Identifier" is a spec term, but refers to a sequence of alphanumeric
  characters, which may or may not be a keyword. (Keywords are a
  subset of all identifiers.)
- "ValueID" is entirely non-spec, and is directly called a "keyword" in
  the CSS specs.

So to avoid confusion as much as possible, let's align with the spec
terminology. I've attempted to change variable names as well, but
obviously we use Keywords in a lot of places in LibWeb and so I may
have missed some.

One exception is that I've not renamed "valid-identifiers" in
Properties.json... I'd like to combine that and the "valid-types" array
together eventually, so there's no benefit to doing an extra rename
now.
2024-08-15 13:58:38 +01:00
Sam Atkins
9559f0f123 LibWeb: Rename IdentifierStyleValue -> CSSKeywordValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue
2024-08-15 13:58:38 +01:00
Sam Atkins
0e3487b9ab LibWeb: Rename StyleValue -> CSSStyleValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#cssstylevalue

No behaviour changes.
2024-08-15 13:58:38 +01:00
Tim Ledbetter
c9caa4262e Meta: Add a script to run the Web Platform tests locally
This change adds a script that can run the Web Platform Tests and
compare different test runs.
2024-08-13 14:10:56 +02:00
Francesco Gazzetta
d6303c9da9 CMake: Fix invalid target when using system skia
Commit 35392d4d28 moved the
target_*_directories() calls (or rather their include()) before the
target declaration, so they fail because of the undefined target.
We can fix the problem by using global *_directories() instead.
2024-08-12 18:20:34 +02:00
BenJilks
0ca5675d59 LibTextCodec: Implement iso-2022-jp encoder
Implements the `iso-2022-jp` encoder, as specified by
https://encoding.spec.whatwg.org/#iso-2022-jp-encoder
2024-08-08 17:49:58 +01:00
BenJilks
d80575a410 LibTextCodec: Implement gb18030 and gbk encoders
Implements the `gb18030` and `gbk` encoders, as specified by
https://encoding.spec.whatwg.org/#gb18030-encoder
https://encoding.spec.whatwg.org/#gbk-encoder
2024-08-08 17:49:58 +01:00
BenJilks
826292536c LibTextCodec: Implement euc-kr encoder
Implements the `euc-kr` encoder, as specified by
https://encoding.spec.whatwg.org/#euc-kr-encoder
2024-08-08 17:49:58 +01:00
BenJilks
72d0e3284b LibTextCodec+LibURL: Implement utf-8 and euc-jp encoders
Implements the corresponding encoders, selects the appropriate one when
encoding URL search params. If an encoder for the given encoding could
not be found, fallback to utf-8.
2024-08-08 17:49:58 +01:00
Shannon Booth
aa32bfa448 LibWeb: Implement USVString scalar value handling
USVString is defined in the IDL spec as:

> The USVString type corresponds to scalar value strings. Depending on
> the context, these can be treated as sequences of either 16-bit
> unsigned integer code units or scalar values.

This means we need to account for surrogate code points by using the
replacement character.

This fixes the last test in https://wpt.live/url/url-constructor.any.html
2024-08-08 10:50:06 +01:00
Andrew Kaster
cb55f65328 Meta: Add a script and CMake function to generate a clang module map
In theory the clang module map should not have absolute paths for the
headers. Other Swift projects seem to use the -ivfsoverlay feature of
clang to work around this, but it seems difficult to get to work.
2024-08-06 18:28:10 -06:00
Andrew Kaster
e7a9126f81 CMake: Silence the loudest warnings for generating Swift interop headers
And modernize the cmake_parse_arguments() call at the top.

Ideally, we would pull these flags from the target we're generating
for, but the current CMake setup makes that prohibitively infeasible.
2024-08-06 18:28:10 -06:00
Andrew Kaster
1dff3ca0c4 CMake: Apply C++ compile options to Swift compilations
This ensures that we can get all the proper warnings on/off to get the
same diagnostics and other options when loading C++ headers into the
Swift frontend.
2024-08-06 18:28:10 -06:00
Andrew Kaster
15f25d56b8 AK: Disable -Wunqualified-std-cast-call explicitly in CMake
When importing libraries with swiftc, the pragma to ignore this
warning isn't respected. So apply it on the command line.
2024-08-06 18:28:10 -06:00
Will Hawkins
4f4fdce62a Meta: Script to configure clangd according to build type
Add a simple shell script to update the local clangd configuration
according to the type of build selected by the user. Include
documentation on where the script might be useful when building
under different configurations.
2024-08-05 23:44:03 -06:00
Shannon Booth
a342370dfb LibWeb: Rename SharedImageRequest to SharedResourceRequest
For the SVG <use> element, we want to support loading HTML documents
that have a SVG element inside of it pointed to by the URL fragment.

In this situation we would need to fetch and parse the entire document
in SharedImageRequest (so that we can still cache the SVGs). Rename
SharedImageRequest to SharedResourceRequest to make the class a little
more generic for future usecases.
2024-08-05 11:26:41 +02:00
Colin Reeder
14267b5d63 LibWeb: Add stub implementation of performance.navigation 2024-08-04 10:38:42 +02:00
Timothy Flynn
96bb8fe944 UI/Qt: Add a debug menu item to dump RequestServer connection info 2024-08-03 15:53:07 -04:00
Shannon Booth
ad32227c83 BindingsGenerator: Support nullable integral attributes
Previously we were assuming that the attribute return value was never
nullable and going to be returned in an Optional<IntegralType>, causing
complile errors for something such as: `attribute unsigned long?`.
2024-08-01 11:42:39 +02:00
Shannon Booth
d6243abec3 BindingsGenerator: Factor out code to generate JS::Value from an integer
Mirroring the pre-existing `generate_from_integral` function. This will
allow us to fix a bug that all of these if statements have in common -
no handling of nullable types.

This also adjusts the type casted for each integral to fully match that
stated by the spec.
2024-08-01 11:42:39 +02:00
Andrew Kaster
743c71faa7 Meta: Let Wasm test pass without INCLUDE_WASM_SPEC_TESTS 2024-07-30 18:38:02 -06:00
Andrew Kaster
2fa6c445cb CMake: Work around two upstream CMake issues for Swift files
https://gitlab.kitware.com/cmake/cmake/-/issues/26174
https://gitlab.kitware.com/cmake/cmake/-/issues/26175
2024-07-30 18:38:02 -06:00
Andrew Kaster
7afe183172 CMake: Add proper sanitizer options for Swift files
Apparently UBSAN + Swift doesn't work on Linux :<
2024-07-30 18:38:02 -06:00
Andrew Kaster
07d387af96 Meta: Create a common Swift settings flow 2024-07-30 18:38:02 -06:00
Andrew Kaster
7f8103da7a CMake: Move GenerateSwiftHeader.cmake to Meta/CMake 2024-07-30 18:38:02 -06:00
Andrew Kaster
45301e8169 Everywhere: Remove AK_DONT_REPLACE_STD macro
Let's just always include `<utility>`. Placing our own incompatible with
the STL declaration of these functions in AK was always fishy to begin
with.
2024-07-30 18:38:02 -06:00
Aliaksandr Kalenik
0bfcf73524 LibWeb: Inline apply_backdrop_filter function into paint_backdrop_filter
No need to have a separate file for this small function.
2024-07-29 17:48:56 +02:00
Jamie Mansfield
75216182c9 LibWeb: Implement DOMStringList 2024-07-29 11:19:00 +02:00
bbb651
779e3072f9 WebAudio: Stub AudioDestinationContext
And expose it through `BaseAudioContext::destination`
2024-07-28 21:41:15 +02:00
Diego Frias
48f1861ce9 Meta: No longer ignore test-wasm results during testing
Since the Wasm runtime should be fully spec-compliant, we want to make
sure that the spec-tests always pass.
2024-07-27 15:02:37 +02:00
Aliaksandr Kalenik
1bd0871ed8 LibWeb+LibGfx: Use Skia for text rasterization
The main incentive is much better performance. We could have gone a bit
further in optimizing the Skia painter to blit glyphs produced by LibGfx
more efficiently from the glyph atlas, but eventually, we also want Skia
to improve correctness.

This change does not completely replace LibGfx in text handling. It's
still used at all stages, including layout, up until display list
replaying.
2024-07-27 08:18:54 +02:00
Andreas Kling
2daaa22a15 LibWeb: Stop trying to guess include paths in IDL codegen
It turns out we were already generating all the necessary include
statements, and we can simply remove all this goofy code soup that
uses the C preprocessor to speculatively look for include files.
2024-07-26 17:33:29 +02:00
Shannon Booth
9b59dc5e8b Bindings: Remove exception handling for named_item_value 2024-07-26 14:26:16 +02:00
Sam Atkins
576a431408 LibWeb: Implement CounterStyleValue
This is `counter(name, style?)` or `counters(name, link, style?)`. The
difference being, `counter()` matches only the nearest level (eg, "1"),
and `counters()` combines all the levels in the tree (eg, "3.4.1").
2024-07-26 11:04:30 +01:00
Andrew Kaster
24ff698914 ClangPlugins: Don't build plugins with sanitizers 2024-07-25 18:35:57 -06:00
Andrew Kaster
f314f58fca LibJS+ClangPlugins: Add escape hatch for GCPtr checks 2024-07-25 18:35:57 -06:00
Andrew Kaster
7f953a8519 ClangPlugins: Enable building in release mode with current warnings 2024-07-25 18:35:57 -06:00
Tim Schumacher
cf6929fef3 Meta: Guard everything that installs headers with an option 2024-07-25 13:25:09 -06:00
bbb651
64663d53fa WebAudio: Stub BiquadFilterNode 2024-07-23 09:02:43 +02:00
bbb651
6672fb4b47 WebAudio: Stub AudioBufferSourceNode 2024-07-23 09:02:43 +02:00
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
Caitlin Potter
80cd3712c2 LibWeb: Implement WebIDL constructor flow for derived classes
Following the rules in the algorithm from
https://webidl.spec.whatwg.org/#js-platform-objects, "To Internally
create a new object implementing the interface interface", this change
incorporates the steps to load a prototype from new.target, and write
it to the created instance returned from constructor_impl(). This
mirrors the code for generate_html_constructor(), which incorporates
additional steps needed by Custom Elements.

Bug #334
2024-07-05 21:04:27 +02:00
⭐caitp⭐
7dc28a20d0 Meta: Permit specifying a build preset in ./Meta/ladybird.sh
Retrieve the build preset with environment variable BUILD_PRESET,
which if unset is initialized to "default".
2024-07-05 10:33:11 -06:00
Jamie Mansfield
67e3ac8916 LibWeb/HTML: Stub TextTrack IDL interface 2024-07-05 07:15:04 +02:00
Aliaksandr Kalenik
e713de115c LibWeb+LibCore: Use Vulkan backend for Skia on Linux
Skia now uses GPU-accelerated painting on Linux if Vulkan is available.
Most of the performance gain is currently negated by reading the GPU
backend back into RAM to pass it to the Browser process. In the future,
this could be improved by sharing GPU-allocated memory across the
Browser and WebContent processes.
2024-07-05 07:13:13 +02:00
Aliaksandr Kalenik
830b287c46 Everywhere: Remove GPU painter and AccelGfx
GPU painter that uses AccelGfx is slower and way less complete compared
to both default Gfx::Painter and Skia painter. It does not make much
sense to keep it, considering Skia painter already uses Metal backend on
macOS by default and there is an option to enable GPU-accelerated
backend on linux.
2024-07-04 14:47:02 +02:00
Andrew Kaster
d220cf3abd CMake: Add a command for codesigning with the get-task-allow entitlement
This allows developers on macOS to open Ladybird.app in Instruments.

Add some documentation for how to use the command as well. It is enabled
automatically when CMAKE_BUILD_TYPE is not Release or RelWithDebInfo.
2024-07-02 16:57:51 -06:00
Andrew Kaster
3cdd4fb769 Meta+CMake: Use lldb on macOS for debugging 2024-07-02 16:57:51 -06:00
Andrew Kaster
002bef8635 AK+CMake: Use the find module to find the correct backtrace(3) header
As recommended by the CMake docs, let's tolerate systems or setups that
don't have backtrace(3) in the `<execinfo.h>` header file, such as those
using libbacktrace directly.
2024-07-01 10:15:24 -06:00
Andrew Kaster
4cc3d598f9 LibWebView+LibCore: Manage process lifecycle using a SIGCHLD handler
This large commit also refactors LibWebView's process handling to use
a top-level Application class that uses a new WebView::Process class to
encapsulate the IPC-centric nature of each helper process.
2024-07-01 18:10:56 +02:00
Aliaksandr Kalenik
d5926a3231 LibGfx+LibWeb: Rename Gfx::VectorFont to Gfx::Typeface
Typeface is a more widely used name for the data represented by
class previously named VectorFont.

Now:
- Typeface represents decoded font that is not ready for rendering
- ScaledFont represents the combination of typeface and size for
  rendering
2024-06-30 13:09:23 +02:00
luozhiya
8c09b9a2e9 Meta: Handle LAGOM_EXECUTABLE in gdb command properly 2024-06-28 22:21:54 -06:00
Timothy Flynn
d9470d6a93 Meta: Add a debug build CMake preset
Since the default mode now only builds release vcpkg libraries, having
an easy-to-create debug build will be convenient.
2024-06-28 12:10:59 -04:00
Timothy Flynn
1c2aef9255 Meta: Only build vcpkg dependencies in release mode by default
We currently build debug and release versions of vcpkg dependencies. We
will most commonly only need the release version, so let's default to
that to approximately halve our dependency build time.
2024-06-28 12:10:59 -04:00
Timothy Flynn
bd73dd316d LibTimeZone: Remove LibTimeZone and TZDB data
All users have been ported to the ICU implementation.
2024-06-26 10:14:02 +02:00
Timothy Flynn
672a555f98 LibCore+LibJS+LibUnicode: Port retrieving time zone offsets to ICU
The changes to tests are due to LibTimeZone incorrectly interpreting
time stamps in the TZDB. The TZDB will list zone transitions in either
UTC or the zone's local time (which is then subject to DST offsets).
LibTimeZone did not handle the latter at all.

For example:

The following rule is in effect until November 18, 6PM UTC.

    America/Chicago -5:50:36 - LMT 1883 Nov 18 18:00u

The following rule is in effect until March 1, 2AM in Chicago time. But
at that time, a DST transition occurs, so the local time is actually
3AM.

    America/Chicago -6:00 Chicago C%sT 1936 Mar 1 2:00
2024-06-26 10:14:02 +02:00
Luke Warlow
a65f1ecc37 LibWeb: Implement stub for ElementInternals
This implements a stub ElementInternals object which implements the
shadowRoot getter only.

Also implement attachInternals function.
2024-06-26 06:30:40 +02:00
Luke Warlow
9171c35183 LibWeb: Refactor DOM parsing APIs
Multiple APIs have moved from the DOM Parsing and Serialization spec to
HTML.

Updates spec URLs and comments.

Delete InnerHTML file:
- Make parse_fragment a member of Element, matching serialize_fragment
on Node.
- Move inner_html_setter inline into Element and ShadowRoot as per the
spec.

Add FIXME to Range.idl for Trusted Types createContextualFragment
2024-06-26 05:41:00 +02:00
Andrew Kaster
29665f51aa CI: Rename JS repl artifacts so they can actually be bundled 2024-06-25 17:27:08 -06:00
Andrew Kaster
a587eafbf4 CMake: Consistently use imported targets for third party dependencies 2024-06-25 17:15:42 -04:00
Andreas Kling
fb9f3f10f3 LibWeb: Add Element.getHTML() and ShadowRoot.getHTML() 2024-06-25 19:22:35 +02:00
Zaggy1024
c4c91f02b3 LibMedia: Remove the home-grown VP9 decoder 2024-06-24 12:41:32 -06:00
Zaggy1024
f6a4973578 LibMedia: Give frame timestamps to FFmpeg decoders
H.264 in Matroska can have blocks with unordered timestamps. Without
passing these as the presentation timestamp into the FFmpeg decoder,
the frames will not be returned in chronological order.

VideoFrame will now include a timestamp that is used by the
PlaybackManager, rather than assuming that it is the same timestamp
returned by the demuxer.
2024-06-24 12:41:32 -06:00
Zaggy1024
81001b37ce LibMedia: Use FFmpeg to decode more video formats
VP9 continues to function, but this also allows AV1 to be decoded. With
this commit, H.264 is still non-functional, as the decoder requires
some extra initial data from the track definition in the Matroska file.
2024-06-24 12:41:32 -06:00
circl
9f7f6aa80c LibTLS: Remove key-logging debug feature
This attempted to save data into /home/anon even on Linux
2024-06-24 09:45:41 -06:00
circl
f03e6fddf1 Meta: Remove SerenityOS-specific WASM test installer 2024-06-24 09:45:41 -06:00
circl
37dcb165eb Meta: Remove CommonMark spec test downloader
We no longer have a Markdown implementation to test
2024-06-24 09:45:41 -06:00
Timothy Flynn
3c23ce9007 LibTimeZone: Remove entirely unused time zone methods
Evaluating third-party alternatives to LibTimeZone will be simpler with
unused functionality removed.
2024-06-24 15:04:58 +02:00
Timothy Flynn
be0dca8da3 LibTimeZone: Exclude from the tools build and switch to a shared library
It is not needed by code generators anymore, so it is not needed in the
Lagom tools build. And it is not needed as an object library anymore; it
was created this way so it could be included in Serenity's LibC.
2024-06-24 15:04:58 +02:00
Aliaksandr Kalenik
760dfdcc1a LibWeb: Rename CommandExecutor to DisplayListPlayer
Use more widely recognized name among browser engine developers.
2024-06-24 13:22:59 +02:00
Aliaksandr Kalenik
854b269338 LibWeb: Rename RecordingPainter to DisplayListRecorder
Use more widely recognized name among browser engine developers.
2024-06-24 13:22:59 +02:00
Aliaksandr Kalenik
5570e6b648 LibWeb: Rename CommandList to DisplayList
Use more widely recognized name among browser engine developers.
2024-06-24 13:22:59 +02:00
Timothy Flynn
ebdb92eef6 LibUnicode+Everywhere: Merge LibLocale back into LibUnicode
LibLocale was split off from LibUnicode a couple years ago to reduce the
number of applications on SerenityOS that depend on CLDR data. Now that
we use ICU, both LibUnicode and LibLocale are actually linking in this
data. And since vcpkg gives us static libraries, both libraries are over
30MB in size.

This patch reverts the separation and merges LibLocale into LibUnicode
again. We now have just one library that includes the ICU data.

Further, this will let LibUnicode share the locale cache that previously
would only exist in LibLocale.
2024-06-23 19:52:45 +02:00
Timothy Flynn
c9d9e1bb1f Meta: Exclude LibCore, LibUnicode, and LibURL from the lagom-tools build
We only need LibCoreMinimal for the lagom-tools build. In particular, by
removing LibUnicode, we remove the lagom-tools dependence on the system
ICU package, as we do not have vcpkg hooked into this build. (We could
probably add vcpkg here, but since this libraries aren't even needed, we
don't need to bother).
2024-06-23 19:52:45 +02:00
Timothy Flynn
666979fb90 LibUnicode: Remove unused headers from GenerateEmojiData
Mostly just to make it clear we do not depend on LibUnicode in this
generator.
2024-06-23 19:52:45 +02:00
Timothy Flynn
946a09d355 Meta: Re-bootstrap vcpkg when we update its version
Fetching package versions that were shipped after vcpkg was last
bootstrapped requires re-bootstrapping vcpkg.
2024-06-23 10:30:23 +02:00
Luke Warlow
b216046234 LibWeb: Implement CloseWatcher API
This implements most of the CloseWatcher API from the html spec.

AbortSignal support is unimplemented.

Integration with dialogs and popovers is also unimplemented.
2024-06-22 17:39:53 +02:00
Andrew Kaster
79db3b32c2 CI+Meta: Delete wasm workflow and js_repl module 2024-06-22 11:10:15 -04:00
Timothy Flynn
9220a89d2f CI+LibUnicode: Remove the UCD from the system 2024-06-22 14:56:39 +02:00
Timothy Flynn
2ba7b4c529 LibUnicode: Remove now-unused code generator facilities 2024-06-22 14:56:39 +02:00
Timothy Flynn
069bed5d47 LibUnicode+LibGfx: Remove superfluous emoji metadata
For SerenityOS, we parse emoji metadata from the UCD to learn emoji
groups, subgroups, names, etc. We used this information only in the
emoji picker dialog. It is entirely unused within Ladybird.

This removes our dependence on the UCD emoji file, as we no longer
need any of its information. All we need to know is the file path to
our custom emoji, which we get from Meta/emoji-file-list.txt.
2024-06-22 14:56:39 +02:00
Timothy Flynn
aa3a30870b LibUnicode: Replace code point bidirectional classes with ICU 2024-06-22 14:56:39 +02:00
Timothy Flynn
e77dafc987 LibUnicode: Replace code point scripts and script extensions with ICU 2024-06-22 14:56:39 +02:00
Timothy Flynn
986ff984cc LibUnicode: Replace code point general categories with ICU 2024-06-22 14:56:39 +02:00
Timothy Flynn
c804bda5fd LibUnicode: Replace code point properties with ICU 2024-06-22 14:56:39 +02:00
luozhiya
b9fa3c6523 Meta: Remove VideoPlayerSDL 2024-06-21 19:49:54 +01:00
Timothy Flynn
ab56b8c8dc LibUnicode: Remove the locale-unaware text segmentation implementation 2024-06-20 13:46:54 +02:00
Timothy Flynn
5cf818e305 LibUnicode: Replace case transformations and comparison with ICUs
There are a couple of differences here due to using ICU:

1. Titlecasing behaves slightly differently. We previously transformed
   "123dollars" to "123Dollars", as we would use word segmentation to
   split a string into words, then transform the first cased character
   to titlecase. ICU doesn't go quite that far, and leaves the string
   as "123dollars". While this is a behavior change, the only user of
   this API is the `text-transform: capitalize;` CSS rule, and we now
   match the behavior of other browsers.

2. There isn't an API to compare strings with case insensitivity without
   allocating case-folded strings for both the left- and right-hand-side
   strings. Our implementation was previously allocation-free; however,
   in a benchmark, ICU is still ~1.4x faster.
2024-06-20 10:59:55 +02:00
Aliaksandr Kalenik
0b48c1ea3f Everywhere: Remove AffineCommandExecutorCPU
No need to have it after introduction of Skia painter that supports
transforms.
2024-06-19 17:22:30 +03:00
Zaggy1024
7c10e1a08d LibMedia: Rename LibVideo to LibMedia
This change is in preparation for implementing audio codecs into the
library and using audio as timing for video playback.
2024-06-19 07:51:55 +02:00
Timothy Flynn
8d7216f4e0 LibUnicode: Replace IDNA ASCII conversion with ICU 2024-06-18 21:07:56 +02:00
Timothy Flynn
83475c5380 LibUnicode: Replace Unicode string normalization with ICU
In a benchmark, ICU's implementation was over 3x faster than ours.
2024-06-18 21:07:56 +02:00
Timothy Flynn
1feef17bf7 LibUnicode: Remove completely unused code point name & block name data
These were used for e.g. the Character Map on Serenity, but are not used
at all for Ladybird.
2024-06-18 21:07:56 +02:00
Luke Warlow
099b77d60f LibWeb: Add motion preference
This adds a motion preference to the browser UI similar to the existing
ones for color scheme and contrast.
Both AppKit UI and Qt UI has this new preference.
The auto value is currently the same as NoPreference, follow-ups can
address wiring that up to the actual preference for the OS.
2024-06-18 10:31:54 -04:00
Diego Iastrubni
0b22aae518 Meta: Fix compilation flags for clang-cl
As part of https://github.com/LadybirdWebBrowser/ladybird/issues/38 -
the first baby step, is to make sure that we do not use compile flags
not supported by clang-cl.
2024-06-18 05:52:44 -06:00
Andrew Kaster
bf3c11229f CMake: Create a set of vcpkg overlay triplets for sanitizers
This changes the Sanitizer configs to build all the vcpkg dependencies
with our specified CFLAGS and CXXFLAGS for ASAN and UBSAN.

Unfortunately, we can't yet enable actually compiling them with
sanitizers enabled, because this causes test failures that need to be
investigated.
2024-06-18 04:47:57 -06:00
Andreas Kling
b88e0eb50a AK: Remove unused Complex.h 2024-06-18 12:00:14 +02:00
Andreas Kling
949508db89 Meta/Lagom: Remove unused ConfigureComponents tool 2024-06-18 12:00:14 +02:00
Andreas Kling
fe1aec124e AK: Remove unused ArbitrarySizedEnum class 2024-06-18 12:00:14 +02:00
Andreas Kling
d8f2a885f9 AK: Remove unused JsonPath class 2024-06-18 12:00:14 +02:00
Andreas Kling
7f5e960b72 AK: Remove unused UUID class 2024-06-18 12:00:14 +02:00
Andreas Kling
47287d2cf1 AK: Remove kstdio.h and dbgputstr()
We can just write directly to stderr in the one place this was used.
2024-06-18 12:00:14 +02:00
Andreas Kling
6df5785fc4 AK: Remove unused PrintfImplementation.h 2024-06-18 12:00:14 +02:00
Andreas Kling
fa56b6cca0 Meta/Lagom: Remove unused StateMachineGenerator 2024-06-18 12:00:14 +02:00
Andreas Kling
1039acca8c LibGfx: Remove JPEG2000 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
a34a5af939 LibGfx: Remove ILBM image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b6daddb088 LibGfx: Remove JBIG2 image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
b7f8d7aec5 LibGfx: Remove TGA image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
681a2ac14e LibGfx: Remove support for the various "portable" image formats
These formats are not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
7141319a7c LibGfx: Remove DDS image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
4b4254c3d0 LibGfx: Remove QOI image format support
This format is not supported by other browsers.
2024-06-17 21:57:35 +02:00
Andreas Kling
2a888ca626 LibGfx: Remove home-grown JPEG codec in favor of libjpeg-turbo 2024-06-17 17:59:54 +02:00
Timothy Flynn
56e9eb6f68 Meta: Restore a couple debug flags in all_the_debug_macros.cmake
These were errantly removed in 666f7338a0.
2024-06-16 15:30:28 -04:00
Matthew Olsson
7950992fc2 LibWeb: Remove TimingFunction in favor of EasingStyleValue::Function
Now that EasingStyleValue is a lot nicer to use, there isn't much reason
to keep TimingFunction around.
2024-06-16 07:12:46 +02:00
Matthew Olsson
ac35f76e67 Meta: Remove GenerateCSSEasingFunctions 2024-06-16 07:12:46 +02:00
Timothy Flynn
6675ef3f24 CI+LibLocale: Remove the CLDR from the system 2024-06-16 06:57:08 +02:00
Timothy Flynn
4de8adabac LibLocale: Replace available locale lookups with ICU 2024-06-16 06:57:08 +02:00
Timothy Flynn
1bcc29d0d1 LibJS+LibLocale: Replace Unicode keyword lookups with ICU
Note: All of the changes to the test files in this patch are now aligned
with both Chrome and Firefox.
2024-06-16 06:57:08 +02:00
Timothy Flynn
5e2ee4447e LibJS+LibLocale: Replace plural rules selection with ICU
This uses ICU for all of the Intl.PluralRules prototypes, which lets us
remove all data from our plural rules generator.

Plural rules depend directly on internal data from the number formatter,
so rather than creating a separate Locale::PluralRules class (which will
make accessing that data awkward), this adds plural rules APIs to the
existing Locale::NumberFormat.
2024-06-15 06:57:16 +02:00
Timothy Flynn
7f9ccd39f5 LibJS+LibLocale: Replace relative time formatting with ICU
This uses ICU for all of the Intl.RelativeTimeFormat prototypes, which
lets us remove all data from our relative-time format generator.
2024-06-15 06:57:16 +02:00
Timothy Flynn
f9a7fc6263 LibLocale: Remove the number formatting data generator
The last user of the remaining data (Intl.DurationFormat) no longer
consumes these APIs.
2024-06-14 07:59:42 +02:00
Aliaksandr Kalenik
8feaecd5c8 LibWeb: Create BlockContainer layout node for <input type="button">
...and shadow tree with TextNode for "value" attribute is created.
This means InlineFormattingContext is used, and button's text now
respects CSS text-decoration properties and unicode-ranges.
2024-06-14 07:58:55 +02:00
Diego
991759f453 LibWasm: Enable the loop.wast test file 2024-06-13 12:15:20 +02:00
Luke Warlow
ee64684565 LibWeb: Add Contrast preference 2024-06-13 11:18:38 +02:00
Timothy Flynn
4b3e26c583 LibJS+LibLocale: Replace calendar weekday information with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
9cb1857dc6 LibJS+LibLocale: Replace preferred hour cycle lookups with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
e2bffe5612 LibJS+LibLocale: Replace time zone display names with ICU 2024-06-13 07:42:09 +02:00
Timothy Flynn
273694d8de LibJS+LibLocale: Replace date-time formatting with ICU
This uses ICU for the Intl.DateTimeFormat `format` `formatToParts`,
`formatRange`, and `formatRangeToParts`.

This lets us remove most data from our date-time format generator. All
that remains are time zone data and locale week info, which are relied
upon still for other interfaces. So they will be removed in a future
patch.

Note: All of the changes to the test files in this patch are now aligned
with other browsers. This includes:

* Some very incorrect formatting of Japanese symbols. (Looking at the
  old results now, it's very obvious they were wrong.)
* Old FIXMEs regarding range formatting not including the start/end date
  when only time fields were requested, but the dates differ.
* Day period inconsistencies.
2024-06-13 07:42:09 +02:00
Tim Ledbetter
2f5cf8ac20 LibIDL+LibWeb: Mark [FIXME] interfaces as [[Unimplemented]]
Methods and attributes marked with [FIXME] are now implemented as
direct properties with the value `undefined` and are marked with the
[[Unimplemented]] attribute. This allows accesses to these properties
to be reported, while having no other side-effects.

This fixes an issue where [FIXME] methods broke feature detection on
some sites.
2024-06-11 16:33:30 +02:00
Diego
40fcb00c14 LibWasm: Add missing spec-test imports 2024-06-11 02:43:55 +02:00
Tim Ledbetter
fd98076aca Meta: Ensure LibURL tests are built 2024-06-10 20:34:57 -04:00
circl
5d2095279d Meta: Remove references to SerenityOS in the gn build README 2024-06-10 13:53:01 +02:00
circl
4509d08dde Meta: Add BINDINGS_GENERATOR_DEBUG macro back to gn build 2024-06-10 13:53:01 +02:00
Timothy Flynn
67f3de2320 LibJS+LibLocale: Begin replacing number formatting with ICU
This uses ICU for the Intl.NumberFormat `format` and `formatToParts`
prototypes. It does not yet port the range formatter prototypes.

Most of the new code in LibLocale/NumberFormat is simply mapping from
ECMA-402 types to ICU types. Beyond that, the only algorithmic change is
that we have to mutate the output from ICU for `formatToParts` to match
what is expected by ECMA-402. This is explained in NumberFormat.cpp in
`flatten_partitions`.

This lets us remove most data from our number format generator. All that
remains are numbering system digits and symbols, which are relied upon
still for other interfaces (e.g. Intl.DateTimeFormat). So they will be
removed in a future patch.

Note: All of the changes to the test files in this patch are now aligned
with both Chrome and Safari.
2024-06-10 13:51:51 +02:00
Andreas Kling
c096608dd9 Meta: Update for GitHub org rename to LadybirdBrowser 2024-06-09 13:02:56 +02:00
Diego
9235c3268f LibWasm: Generate all spec-tests properly 2024-06-09 12:16:17 +02:00
circl
666f7338a0 Meta+AK: Clear out unused debug macro definitions 2024-06-09 10:48:19 +02:00
Timothy Flynn
5f7251fd91 LibJS+LibLocale: Replace list formatting with ICU
This also largely eliminates the need for some ECMA-402 AOs, as is it
all handled internally by ICU (which the spec is basically based on).
2024-06-09 10:47:28 +02:00
Timothy Flynn
d17d131224 LibJS+LibLocale: Replace locale character ordering with ICU 2024-06-09 10:47:28 +02:00
Timothy Flynn
e487f91388 LibJS+LibLocale: Replace locale maximization and minimization with ICU 2024-06-09 10:47:28 +02:00
Timothy Flynn
9724a25daf LibJS+LibLocale: Replace canonical locales and display names with ICU
Note: We keep locale parsing and syntactic validation as-is. ECMA-402
places additional restrictions on locales above what is required by the
Unicode spec. ICU doesn't provide methods that let us easily check those
restrictions, whereas LibLocale does. Other browsers also implement
their own validators here.

This introduces a locale cache to re-use parsed locale data and various
related structures (not doing so has a non-negligible performance impact
on Intl tests).

The existing APIs for canonicalization and display names are pretty
intertwined, so they must both be adapted at once here. The results of
canonicalization are slightly different on some edge cases. But the
changed results are actually now aligned with Chrome and Safari.
2024-06-09 10:47:28 +02:00
Andreas Kling
2f68e36137 Ladybird: Use fontconfig to choose generic fonts on non-Apple systems
If we get a suggestion from fontconfig, we try those fonts first, before
falling back on the hard coded list of known suitable fonts for each
generic family.
2024-06-08 10:23:36 +02:00
Andrew Kaster
9f25dc6b09 CMake+CI: Remove BUILD_LAGOM=OFF option in favor of LAGOM_TOOLS_ONLY=ON
The far more common configuration for Ladybird is to always build the
Lagom libraries.
2024-06-08 07:58:11 +02:00
Andrew Kaster
1af9e44130 CMake: Use CMAKE_LINKER_TYPE on CMake >= 3.29 2024-06-08 07:58:11 +02:00
Andreas Kling
28d4e326f8 LibGfx: Use the woff2 library to decode WOFF2 font files
This saves us the trouble of maintaining our own implementation,
and instantly brings us to full WOFF2 feature parity with others.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-06-07 18:42:12 +02:00
Andrew Kaster
1e3e36af11 Meta+CMake: Move vcpkg directives to ladybird.sh and CMakePresets
Also add a vcpkg command to ladybird.sh to ensure that vcpkg is setup,
and use a local binary cache for vcpkg build and install media to
avoid cluttering $XDG_CACHE_HOME.
2024-06-07 11:15:48 -04:00
Jamie Mansfield
8f0d035145 LibWeb: Implement should block mixed content request 2024-06-07 09:50:30 +02:00
Andrew Kaster
d90a9ab70c LibWeb: Add Web::UIEvents::KeyCode and KeyModifier enums, drop Kernel
This was the last Kernel header we had. Move the definitions we need
into a UIEvents header similar to MouseButton.
2024-06-07 09:44:41 +02:00
Andrew Kaster
82b73b2eee CMake: Move ca_certificate_download include up with other downloads 2024-06-06 12:51:14 -06:00
Andrew Kaster
6f387577c5 CMake+Base: Remove LiberationMono and rules copying it to build
This was only used by the pdf and MacPDF applications.
2024-06-06 12:51:14 -06:00
Andrew Kaster
41176a4f4e CMake: Remove Superbuild-specific install rule guard 2024-06-06 12:51:14 -06:00
Andrew Kaster
f55f64755d CMake: Remove ENABLE_LAGOM_LIBWEB and ENABLE_LAGOM_LADYBIRD options 2024-06-06 12:51:14 -06:00
Andrew Kaster
b5a60c0f9f Meta: Link librt to LibCoreMinimal on NetBSD
We were already linking librt to LibCore for shm_open and friends.
Now that we build the code that uses POSIX shm into LibCoreMinimal, we
need to link librt into that as well.
2024-06-06 12:48:58 -06:00
Timothy Flynn
8362c073f3 Everywhere: Remove LibSQL, SQLServer, and the sql REPL :^)
It is now entirely unused and replaced by sqlite3.
2024-06-06 11:27:03 -04:00
Timothy Flynn
b36ab480bf Meta+Toolchain+CI: Add a script to bootstrap vcpkg
And hook it into ladybird.sh for convenience. The script will set up
PATH and other environment variables automatically.

On CI, vcpkg is theoretically already installed on Linux machines, but
not with the right environment variables, and not on macOS. So this also
makes CI use this script to bootstrap vcpkg.
2024-06-06 11:27:03 -04:00
Davide Cavalca
9af91eb622 Meta: ENABLE_NETWORK_DOWNLOADS for ca_certificates and public_suffix 2024-06-05 13:03:31 -04:00
Andrew Kaster
90af26e309 Meta+CMake: Remove unused CMake functions and features
Goodbye, serenity_components and Jakt.
2024-06-05 12:23:54 -04:00
Andrew Kaster
ec6072e7cd Meta: Uncouple ladybird.sh run from a specific CMake configuration 2024-06-05 12:21:59 -04:00
Nathan E. Egge
e62f0a8da3 Meta: Remove dependency on sudo, doas or pls 2024-06-05 12:04:11 -04:00
Andreas Kling
d0afc3e643 CI: Remove "label pull requests" action 2024-06-05 10:49:45 +02:00
Jamie Mansfield
8e062a52a3 LibWeb: Move NetworkPartitionKey into a header
This is used elsewhere, such as the HTMLLinkElement.
2024-06-05 05:42:47 +01:00
Andrew Kaster
c6e9f0e7b5 Meta+Documentation: Switch default build dir to Build/Ladybird
Also prefer using the new top-level CMakeLists.txt
2024-06-04 13:44:22 -06:00
Andreas Kling
cd84d23afa Base+Tests+Ladybird: Remove bitmap fonts 2024-06-04 18:45:30 +02:00
Andreas Kling
04a6e2f83d LibWeb: Remove Gfx::BitmapFont
This class supported the binary bitmap font file format in SerenityOS,
and isn't something we need in Ladybird.
2024-06-04 18:45:30 +02:00
Andreas Kling
966d442152 LibWeb+Ladybird: Remove FontPluginSerenity (+ use Ladybird::FontPlugin) 2024-06-04 18:45:30 +02:00
Andreas Kling
1b2d08ee7e LibGfx: Remove a bunch of unused classes 2024-06-04 18:45:30 +02:00
Simon Wanner
0ab4722cee LibTextCodec: Use generated lookup tables for all single byte decoders 2024-06-04 10:21:07 +02:00
Simon Wanner
6b2c459901 LibTextCodec: Fix ISO-8859-1 vs. windows-1252 handling in web contexts
The Encoding specification maps ISO-8859-1 to windows-1252 and expects
the windows-1252 translation table to be used, which differs from
ISO-8859-1 for 0x80-0x9F.

Other contexts expect to get the actual ISO-8859-1 encoding, with 1-to-1
mapping to U+0000-U+00FF, when requesting it.

`decoder_for_exact_name` is introduced, which skips the mapping from
aliases to the encoding name done by `get_standardized_encoding`.
2024-06-04 10:21:07 +02:00
Andreas Kling
6321e97b09 AK: Remove various unused things 2024-06-04 09:19:39 +02:00
Andreas Kling
f2fd8fc928 Everywhere: Remove LibGemini
This hasn't been maintained (or worked at all) for a long time,
and it's not a widely supported protocol, so let's drop it.
2024-06-04 09:19:39 +02:00
Andreas Kling
e4cd91761d Everywhere: Remove LibMarkdown
This was used to convert markdown into HTML for display in the browser,
but no other browser behaves this way, so let's simplify things by
removing it.

(Yes, we could implement all kinds of "convert to HTML and display" for
every file format out there, but that's far outside the scope of a
browser engine.)
2024-06-04 09:19:39 +02:00
Timothy Flynn
126cbce632 Meta: Remove empty LibSystem library and references 2024-06-04 07:45:42 +02:00
Timothy Flynn
f5ed7d5d9c Meta: Remove base64 utility from the GN build 2024-06-04 07:45:42 +02:00
Timothy Flynn
a089c00e02 Meta: Remove unused SerenityOS references from the GN build 2024-06-04 07:45:42 +02:00
Timothy Flynn
d28412ed34 Meta: Remove unused (and non-existent) linkages from the GN build 2024-06-04 07:45:42 +02:00