Commit Graph

3557 Commits

Author SHA1 Message Date
Andrew Kaster
3ecf6de652 LibMedia+Ladybird: Use pkg_check_modules to find pulseaudio 2024-10-02 20:23:03 -04:00
Zachary Huang
e0bd42be95 ImageDecoder+LibGfx: Collate decoded bitmaps before sending over IPC
There is an issue where gifs with many frames cannot be loaded, as each
bitmap is sent over IPC using a separate file descriptor, and there is
limit on the maximum number of descriptors per IPC message. Thus, trying
to load gifs with more than 64 frames (the current limit) causes the
image decoder process to die.

This commit introduces the BitmapSequence class, which is a thin wrapper
around the type Vector<Optional<NonnullRefPtr<Gfx::Bitmap>>> and
provides an IPC encode/decode routine that collates all bitmap data into
a single buffer so that only a single file descriptor is required per
IPC transfer, even if multiple frames are being sent.
2024-10-02 15:57:41 -06:00
Andrew Kaster
ebaba7fb7b LibMedia: Mark ffmpeg as required, and reorganize CMakeLists
Now it should be clearer looking at the build scripts what options
are available for building LibMedia, and what packages are required.
2024-10-02 16:03:33 -04:00
Sam Atkins
cd13b30fb8 LibWeb/CSS: Add parsing for <opentype-tag>
This is a special form of `<string>` so doesn't need its own style value
type. It's used in a couple of font-related properties. For completeness
it's included in ValueType.
2024-10-02 16:28:55 +01:00
Andrew Kaster
91de0438fe Meta: Add swift-format linter script
swift-format is available in the Xcode 16 Beta and homebrew.
We will need some extra docs to tell Linux developers how to get it on
their distribution.

This also makes use of the fact that you can pass git diff a colon
delimited pattern to include ':*pattern' or exclude ':!*pattern'
matching files, which is pretty neat.
2024-10-01 13:33:05 -06:00
Saleem Abdulrasool
cf702d21d1 Meta: Remove unused code generate tools
These are no longer in the tree, remove their definitions.
2024-10-01 10:14:16 -06:00
Jelle Raaijmakers
233b4f2ca8 LibMedia+everywhere: Remove superfluous and unused audio code
We had numerous NiH-based implementations of audio formats and metadata
that we now no longer need because we either don't make use of the code,
or we replaced its implementation by FFmpeg.
2024-09-30 18:48:12 +02:00
Jelle Raaijmakers
57783eff24 LibMedia: Convert OggLoader into generic FFmpegLoader
This loader supports whatever format libavformat and libavcodec can
handle. Currently only seekable streams are supported, and we still have
some limitations as to the number of channels and sample format.

Plays all non-streaming audio files at:

  https://tools.woolyss.com/html5-audio-video-tester/
2024-09-30 18:48:12 +02:00
Sam Atkins
fdcece2e88 LibWeb/CSS: Implement legacy name aliases for properties
When a property is a "legacy name alias", any time it is used in CSS or
via the CSSOM its aliased name is used instead.
(See https://drafts.csswg.org/css-cascade-5/#legacy-name-alias)

This means we only care about the alias when parsing a string as a
PropertyID - and we can just return the PropertyID it is an alias for.
No need for a distinct PropertyID for it, and no need for LibWeb to
care about it at all.

Previously, we had a bunch of these properties, which misused our code
for "logical aliases", some of which I've discovered were not even
fully implemented. But with this change, all that code can go away, and
making a legacy alias is just a case of putting it in the JSON. This
also shrinks `StyleProperties` as it doesn't need to contain data for
these aliases, and removes a whole load of `-webkit-*` spam from the
style inspector.
2024-09-27 17:16:23 +01:00
Andrew Kaster
2b13079b35 Meta: Update Ladybird and services to build again with gn 2024-09-27 10:15:08 -06:00
Andrew Kaster
7880b2fba9 Meta: Update LibWeb to build again with gn 2024-09-27 10:15:08 -06:00
Andrew Kaster
9bcdf8eafe Meta: Update non-LibWeb libraries in gn build 2024-09-27 10:15:08 -06:00
Andrew Kaster
e53ad772f3 Meta: Update LibUnicode gn build to depend on icu 2024-09-27 10:15:08 -06:00
Andrew Kaster
4348efd078 Meta: Update LibMedia gn build to depend on ffmpeg 2024-09-27 10:15:08 -06:00
Andrew Kaster
b395e6a6a6 Meta: Update LibGfx gn build for removed files and added Libraries
LibGfx depends on a lot of third-party libs now.
2024-09-27 10:15:08 -06:00
Andrew Kaster
a1e2437b21 Meta: Add missing files and libraries to LibCore in gn build 2024-09-27 10:15:08 -06:00
Andrew Kaster
8aac8f25ba Meta: Handle removed and renamed libraries in gn build 2024-09-27 10:15:08 -06:00
Andrew Kaster
8636a49f47 Meta: Update AK gn build for new files and dependencies 2024-09-27 10:15:08 -06:00
Andrew Kaster
0fefcbcf5e Meta: Handle removal of emoji files in gn build
Also add inspector.html to the file sets that are copied to the build
directory and macOS bundle.
2024-09-27 10:15:08 -06:00
Andrew Kaster
6ee1afc9c0 Meta: Add third-party libraries to gn build with vcpkg install script
The vcpkg install is handled through an action to run vcpkg install with
the private --x-install-root flag that their CMake toolchain file uses
to install dependencies into a build-time directory.
2024-09-27 10:15:08 -06:00
Andrew Kaster
aa1bf3e8a4 Meta: Add missing -Wno-unqualified-std-cast-call warning to gn build 2024-09-27 10:15:08 -06:00
Andrew Kaster
994457d7af LibMedia: Use build-time rather than configure-time check for avcodec
Rather than checking the avcodec version in CMake, check it using the
avcodec version macros in the only source file that needs to know about
the AVFrame API/ABI change in version 59.24.100. This is friendlier to
other build systems that would rather avoid configure time checks.
2024-09-27 06:45:32 -04:00
Saleem Abdulrasool
a7a24fed68 Meta: Add an option for building against AppKit
The build assumed QT or AppKit are the only build UI frameworks. This
extends the default assumption away from that to start experimenting
with building on other platforms.
2024-09-25 14:56:40 -06:00
Saleem Abdulrasool
60e7a6ea28 Meta: Update environment variables for ak_debug_gen
This updates the environment variables that are passed along to the tool
to run this build command.
2024-09-25 12:51:48 -06:00
Saleem Abdulrasool
050ffddff3 Meta: Update the build rules for AK
The `gn` build did not generate the CMake configuration file for the
backtrace module. Update the rules to configure the generated macros
mirroring the CMake build.
2024-09-25 12:41:05 -06:00
Saleem Abdulrasool
199f0e45cb Meta: Make download_file work on Windows
The file is not committed to disk until the close which occurs at the
termination of the scope. Extract the `rename` to outside the scope
allowing this to work on Windows. The `download_file` utility downloads
a file in the `gn` build.
2024-09-25 10:19:51 -06:00
Jamie Mansfield
1a012f279a LibWeb/WebVTT: Implement VTTRegion idl interface 2024-09-24 23:48:56 +01:00
Tim Ledbetter
b634683662 Meta: Allow ladybird.sh to run any target in the MacOS app bundle
Previously, using `ladybird.sh run` with any target that was part of the
MacOS app bundle would try to run the given executable from the wrong
directory.
2024-09-23 11:11:36 -06:00
Andrew Kaster
0bedc79ca5 CMake: Pull swift-testing from the Swift toolchain
This confirmed works on Xcode 16, and Xcode 16.1 Beta 2, with CMake 3.28
or higher.

On linux, the 6.0.0 release from swiftly is still missing my libstdc++
workaround, so it needs a snapshot to work.
2024-09-23 11:06:26 -06:00
Andrew Kaster
7ab1d117f1 CMake: Enable finding the Swift -target flag in more cases
When the detected SDK for CMAKE_OSX_SYSROOT and friends has the same
version as your current macOS system version, CMake helpfully doesn't
set CMAKE_OSX_DEPLOYMENT_TARGET. Unfortunately, in this case, swiftc
will default to macOS 10.4, which is absolutely ancient. Grab the target
triple from the -print-target-info JSON when CMAKE_OSX_DEPLOYMENT_TARGET
is not provided at configure time.
2024-09-23 11:06:26 -06:00
Andreas Kling
42a1a0bd73 LibWeb: Put CSS transitions debug spam behind CSS_TRANSITIONS_DEBUG 2024-09-22 10:46:54 +02:00
Andreas Kling
d77843e2f0 LibHTTP: Remove the now-unused job classes
The request/response classes are still used in a couple places and will
need more careful removal.
2024-09-22 06:43:12 +02:00
Timothy Flynn
3332230cef LibWebView+WebContent+headless-browser: Make the page info IPCs async
The IPCs to request a page's text, layout tree, etc. are currently all
synchronous. This can result in a deadlock when WebContent also makes
a synchronous IPC call, as both ends will be waiting on each other.

This replaces the page info IPCs with a single, asynchronous IPC. This
new IPC is promise-based, much like our screenshot IPC.
2024-09-19 18:07:17 +02:00
Sam Atkins
76daba3069 LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue
This matches the name in the CSS Typed OM spec. There's quite a lot
still to do to make it match the spec behavior, but this is the first
step.
2024-09-18 20:38:41 +01:00
Tim Ledbetter
35ab0a2db6 Meta: Support all available logging formats in WPT.sh script
This change allows the user to specify the format of the log file to be
generated by the `WPT.sh` script. Multiple logging arguments may now be
specified.

The supported logging arguments are: `--log-raw`, `--log-unittest`,
`--log-xunit`, `--log-html`, `--log-mach`, `--log-tbpl`,
`--log-grouped`, `--log-chromium`, `--log-wptreport` and
`--log-wptscreenshot`. These arguments act the same as the equivalent
arguments supported by `wpt run`.

The short `--log` argument may also be used as an alias for `--log-raw`.
2024-09-14 15:04:22 +02:00
Timothy Flynn
541968b30d LibWeb+LibWebView+WebContent: Return a named enum from UI event handlers
UI event handlers currently return a boolean where false means the event
was cancelled by a script on the page, or otherwise dropped. It has been
a point of confusion for some time now, as it's not particularly clear
what should be returned in some special cases, or how the UI process
should handle the response.

This adds an enumeration with a few states that indicate exactly how the
WebContent process handled the event. This should remove all ambiguity,
and let us properly handle these states going forward.

There should be no behavior change with this patch. It's meant to only
introduce the enum, not change any of our decisions based on the result.
2024-09-12 17:38:36 -04:00
Jelle Raaijmakers
d29797f118 LibMedia: Add ogg/vorbis support
Technically this supports any ogg/* audio stream, but it was at least
tested successfully on ogg/vorbis :^)
2024-09-12 10:01:19 +02:00
Jelle Raaijmakers
1b267abf36 LibMedia: Link to avformat as well
This allows us to process container formats in future commits.
2024-09-12 10:01:19 +02:00
Jelle Raaijmakers
3bf910706f LibMedia: Remove AudioQueue and UserSampleQueue
Both unused.
2024-09-12 10:01:19 +02:00
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