Commit Graph

3518 Commits

Author SHA1 Message Date
Jelle Raaijmakers
7728633906 LibMedia+Utilities: Remove encoders and aconv
We don't use these in Ladybird, so let's get rid of them.
2024-09-12 10:01:19 +02:00
Jelle Raaijmakers
85fd2e281b LibMedia: Absorb LibAudio
LibMedia will be responsible for both audio and video decoding.
2024-09-12 10:01:19 +02:00
Sam Atkins
2671820ace LibWeb: Move our "default sizing algorithm" function into a public place
Specifically, this is used by the updated algorithm for parsing a sizes
attribute, so we need access to it there.

No behaviour changes.
2024-09-12 07:39:11 +02:00
Annya
bea7eec518 LibWeb/CSS: Implement revert-layer
With the introduction of the cascade layer, the 5th CSS-wide keyword,
`revert-layer`, has been added.
2024-09-11 22:30:20 +01:00
sideshowbarker
a7578164d4 Meta: Add script for checking WebIDL files
This adds a new script for linting WebIDL files, and adds it to the set
of scripts Meta/lint-ci.sh runs. Initially, this script does just one
thing: normalizes IDL definition lines so they start with four spaces.
2024-09-10 21:16:53 +01:00
Andrew Kaster
dc18280f80 Meta: Remove HeaderCheck tool
No one has run this tool on the ladybird source tree post-fork, and we
have very similar functionality in clangd that can be enabled if needed.
2024-09-10 07:39:15 +02:00
Andrew Kaster
e66ad7c452 Meta: Remove stale zsh shell completions for serenity.sh
If someone wants to add these back for ladybird.sh, they'll need largely
rewritten anyway.
2024-09-10 07:39:15 +02:00
Andrew Kaster
0427646883 Meta: Remove check-ak-test-files script
This script only checks Tests/AK, and verifies that all source files
that match Tests/AK/*.cpp are listed in the CMakeLists.txt.

This is a bit excessive. We don't have this check for any other test
files. This sort of error will definitely ™️ be caught in review.
2024-09-10 07:39:15 +02:00
Andrew Kaster
9356c967d7 Meta: Remove unused functions from shell_include.sh 2024-09-10 07:39:15 +02:00
Andrew Kaster
b3a009f521 Meta: Check more file extensions for newlines at EOF 2024-09-09 22:34:52 -06:00
Laura Braun
26415d39f7 Meta: Check for CMake version in ladybird.sh
CMake reads CMakePresets.json, which is before it reads CMakeLists.txt.
This causes CMake Error: Unrecognized "version" field if the version of
CMake is older than support for presets, or the version field of
presets.

The fix is to check CMake version in ladybird.sh before trying to create
the build directory.

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
2024-09-09 13:10:19 -06:00
Andreas Kling
ddbfac38b0 LibWeb: Note what's causing a style invalidation to happen
You can now build with STYLE_INVALIDATION_DEBUG and get a debug stream
of reasons why style invalidations are happening and where.

I've rewritten this code many times, so instead of throwing it away once
again, I figured we should at least have it behind a flag.
2024-09-08 09:45:31 +02:00
Andreas Kling
1f5c49f40d LibWeb: Make CSS::is_inherited_property(PropertyID) go fast
Instead of switching on the PropertyID and doing a boatload of
comparisons, we reorder the PropertyID enum so that all inherited
properties are in two contiguous ranges (one for shorthands,
one for longhands).

This replaces the switch statement with two simple range checks.

Note that the property order change is observable via
window.getComputedStyle(), but the order of those properties is
implementation defined anyway.

Removes a 1.5% item from the profile when loading https://hemnet.se/
2024-09-08 09:45:31 +02:00
Jamie Mansfield
48366ddddf LibWeb/WebAssembly: Use a debug flag for dbgln calls
This prevents the horrendous console spam when functions are resolved,
e.g. on the Royal Albert Hall website.
2024-09-07 19:44:23 +02:00
Timothy Flynn
28f27ff1c4 LibWebView+LibUnicode: Remove (nearly) unused GeneratorUtil header
This header held a bunch of utility functions shared across several code
generators. The only user of any of these utilities now is the public
suffix generator. Move the one used function to that generator, and
remove the common header.
2024-09-06 16:36:20 -04:00
Aliaksandr Kalenik
4e9d6a543a Everywhere: Remove bitmap emojis inherited from SerenityOS
These are no longer used since we switched to using the system emoji
font.
2024-09-06 08:30:30 -04:00
Sam Atkins
1c6133aa52 LibWeb/CSS: Add CSSOM types for @layer rules
Depending on usage, `@layer` has two forms, with two different CSSOM
types. One simply lists layer names and the other defines a layer with
its contained rules.
2024-09-06 07:49:55 +02:00
Aliaksandr Kalenik
a9d5a99568 LibGfx+LibWeb: Replace remaining OpenType implementation with Skia
This change should move us forward toward emoji support, as we are no
longer limited by our own OpenType implementation, which was failing
to parse the TrueType Collection format used to store emoji fonts
(at least on macOS).
2024-09-05 19:21:52 +02:00
Jamie Mansfield
4c5a176354 LibWeb: Stub MediaCapabilities IDL interface 2024-09-05 14:52:26 +01:00
Sam Atkins
8cbc211616 Meta: Make embed_as_string_view.py produce Strings instead
This is only used for CSS style sheets. One case wants it as a String,
and the others don't care, but will in future also want to have the
source as a String.
2024-09-03 10:12:07 +01:00
Olekoop
873e576da2 LibGfx: Use a diffrent way for finding libjxl on Android
When trying to use pkgconfig for finding libjxl, the build fails
trying to link the cross-compiler's libc++.
Using this way libjxl also requires hwy library.

Findlibjxl.cmake was taken from SDL_image and altered to include its license.
2024-09-03 00:17:49 -06:00
Andrew Kaster
188b3bb9b8 CMake: Add find module for swift-testing
This project is a part of the Xcode-shipped toolchain on macOS, but
needs built from source on other platforms. However, using the Xcode
version of the framework leads to a bunch of rpath confusion when
trying to link it the expected way. I suspect that there will be a
more intuitive way to link this library from the toolchain when it
stabilizes. So we'll build it everywhere :)
2024-08-28 21:27:35 -06:00
Andrew Kaster
062e687289 Meta: Apply cxx-interop settings to swift targets directly
Instead of using a global setting, let's set this per-target. This
prevents conflicts when importing third-party dependencies that do
not tolerate the mode being "default".
2024-08-28 21:27:35 -06:00
Andrew Kaster
c5153cb398 Meta+Libraries+AK: Append Cxx to imported library module names in swift
At the same time, simplify CMakeLists magic for libraries that want to
include Swift code in the library. The Lib-less name of the library is
now always the module name for the library with any Swift additions,
extensions, etc. All vfs overlays now live in a common location to make
finding them easier from CMake functions. A new pattern is needed for
the Lib-less modules to re-export their Cxx counterparts.
2024-08-27 17:22:31 -06:00
Andrew Kaster
f27d638e0a CMake: Always use a target for linking skia 2024-08-27 17:22:31 -06:00
Tim Ledbetter
53ab6fa403 LibWeb: Stub the ServiceWorkerContainer interface 2024-08-25 09:48:30 +02:00
Tim Ledbetter
0c0a4a6042 LibWeb: Stub the ServiceWorkerRegistration interface 2024-08-25 09:48:30 +02:00
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