Commit Graph

4503 Commits

Author SHA1 Message Date
Shannon Booth
f9a996650b LibWeb/HTML: Implement the Origin interface
See: https://github.com/whatwg/html/commit/68909b2
2025-12-30 12:40:27 +01:00
R-Goc
1f3e20cebf LibMedia: Add a WASAPI playback stream for Windows
Implement PlaybackStream using WASAPI. The design is similar to
PlaybackStreamAudioUnit in that it uses a task queue. A high priority
thread is used to render the stream. All the stream controls save for
the exit being requested which happens on destruction of the stream are
managed by the render thread.

Due to the design of the windows audio mixer the audio we receive must
be resampled to match the sample rate of the mixer. We use a float based
interleaved PCM stream which matches both our existing code and the
audio mixer which internally usues floats.

Having to use a mutex around a queue for the task queue is suboptimal,
in a future PR a MPSC queue could be added to AK and used instead.
2025-12-29 18:02:02 -06:00
Callum Law
cbd07b2153 LibWeb: Don't mark whether shorthand properties are inherited
Inheritance applies to longhands individually so whether a shorthand was
marked as inherit or not is irrelevant
2025-12-29 16:11:13 +01:00
Jani Hautakangas
95ba98785b Meta/CMake: Avoid -march=native when cross-compiling
The introduction of ENABLE_CI_BASELINE_CPU made -march=native
the default for non-CI builds. This breaks cross-compilation
with Clang, where native CPU detection is explicitly unsupported
when a target triple is set.

Guard the use of -march=native behind NOT CMAKE_CROSSCOMPILING
so native tuning is only applied for true host builds, while
cross builds continue to use the toolchain defaults.
2025-12-26 13:40:03 +01:00
Sam Atkins
c446281844 LibWeb/CSS: Remove Transformation in favor of TransformationStyleValue
The Transformation class wasn't really accomplishing anything. It still
had to store StyleValues, so it was basically the same as
TransformationStyleValue, with extra steps to convert from one to the
other. So... let's just use TransformationStyleValue instead!

Apart from moving code around, the behavior has changed a bit. We now
actually acknowledge unresolvable parameters and return an error when
we try to produce a matrix from them. Previously we just skipped over
them, which was pretty wrong. This gets us an extra pass in the
typed-om test.

We also get some slightly different results with our transform
serialization, because we're not converting to CSSPixels and back.
2025-12-19 14:51:53 +01:00
Rocco Corsi
e7b3c70706 Meta: Remove unused option variables 2025-12-19 14:41:40 +01:00
Jan Koudijs
c79a3abcd0 Meta: Add Flatpak linting for vcpkg equality
The Flatpak manifest linter matches dependencies against vcpkg.json
and if there is a match checks if versions are equal.

If there is no version specified in vcpkg overrides then the vcpkg
baseline is queried for the version. The baseline is what ensures
dependency compatibility.

If there is no match it checks if there is a listed exclusion.
If there is no version match or no listed exclusion then linting fails.
2025-12-19 13:16:47 +01:00
Jan Koudijs
80133665f7 Meta: Bring Flatpak dependency versions in line with vcpkg versions 2025-12-19 13:16:47 +01:00
Sam Atkins
2b2e5a1db3 LibWeb/CSS: Support legacy selector aliases for pseudo-classes
These are replaced with the pseudo-class they are an alias of, during
parsing.
2025-12-18 14:50:27 +01:00
ayeteadoe
ee3aa865af Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.

SkFontMgr_New_FontConfig now requires a font scanner to be passed in.

There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.

The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.

The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
2025-12-17 12:00:33 +01:00
Aliaksandr Kalenik
c5d8cb5c47 LibMedia: Change demuxers to use IncrementallyPopulatedStream as input
Refactor the FFmpeg and Matroska demuxers to consume data through
`IncrementallyPopulatedStream::Cursor` instead of a pointer to fully
buffered.

This change establishes a new rule: each track must be initialized with
its own cursor. Data providers now explicitly create a per-track context
via `Demuxer::create_context_for_track(track, cursor)`, and own pointer
to that cursor. In the upcoming changes, holding the cursor in the
provider would allow to signal "cancel blocking reads" so an
in-flight seek can fail immediately when a newer seek request arrives.
2025-12-16 02:42:48 -06:00
Zaggy1024
9d6bc89ed7 LibMedia: Remove the now-unused audio loader plugins 2025-12-15 18:03:03 -06:00
Andreas Kling
2577c5ce67 Revert "Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port"
This reverts commit ac9688ea1e.

Broke the build on arm64 Linux.
2025-12-15 14:12:34 -06:00
Sam Atkins
7418d262ed IDLGenerators: Convert reflected attribute names to ASCII lowercase 2025-12-15 14:08:24 +00:00
ayeteadoe
ac9688ea1e Meta+LibGfx+LibWeb: Update skia to 144 and remove overlay port
Skia deprecated some non-span versions of their API, but they provided
SK_SUPPORT_UNSPANNED_APIS to expose the legacy versions.

SkFontMgr_New_FontConfig now requires a font scanner to be passed in.

There were a few screenshot tests that visibily looked the same but skia
must've changed some rendering infrastructure as the PNGs were not
matching anymore so I rebaselined those and adjusted the fuzzy matching
config to allow them to pass on both macOS and Linux.

The empty-radial-gradient-crash Ref test started to fail as we were
setting the horizontal scale factor to inf in when the height = 0. It
looks like something changed to make doing that not valid anymore.

The overlay port is removed as the issues, mainly skcms symbol import
and export were resolved upstream in skia and utilized in the new port
version.
2025-12-15 10:56:27 +01:00
Zaggy1024
65c0be66e4 LibMedia: Implement audio conversion in AudioDataProvider 2025-12-13 08:58:26 +01:00
Zaggy1024
c75284591f LibMedia: Make PlaybackStream use the output's sample specification
Instead of specifying the sample rate, channel count/map, etc. to the
PlaybackStream, we'll now use the output device's sample specification
whenever possible. If necessary, the stream will fall back to sane
default.

This hugely simplifies AudioMixingSink, since it no longer has to take
care of reinitializing the stream with a new sample specification when
it encounters a track with a higher sample rate or more channels. We
wouldn't be likely to benefit from this anyway, since it turns out that
at least Windows's virtual surround doesn't work through WASAPI at all,
and WASAPI likely wouldn't support downmixing.

This commit breaks playback of audio files that don't match the system
default audio device's sample rate and channel count. The next commit
introduces a converter into the pipeline to allow mixing of any sample
specification.
2025-12-13 08:58:26 +01:00
Zaggy1024
d5e980aa61 LibMedia: Drop the Oboe audio stream implementation for Android
The Android build is likely bitrotted, and breaking changes need to be
made to the PlaybackStream interface. This should be reverted and the
implementation updated if the Android build is maintained again.
2025-12-13 08:58:26 +01:00
Zaggy1024
19ccec2c10 LibMedia: Create a channel map for audio blocks from decoders
Audio blocks now contain a sample specification with the sample rate
and channel map for the audio data they contain. This will facilitate
conversion from one sample specification to another in order to allow
playback on devices with more or less speakers than the audio data
contains.
2025-12-13 08:58:26 +01:00
Ali Mohammad Pur
cf7767395f Meta: Generate Wasm tests using wasm-tools instead of wabt 2025-12-12 19:12:53 +01:00
Feng Yu
b58fcaeecf LibWeb: Add HTMLSelectedContentElement for customizable select
Introduce the HTMLSelectedContentElement and integrate it into
<select>, <option> and HTMLParser.

See whatwg/html#10548.

There are two bugs with WPT tests which causes the third subtest
in selectedcontent.html and selectedcontent-mutations.html fail.
See whatwg/html#11882, web-platform-tests/wpt#55849.
2025-12-12 12:06:24 +00:00
Callum Law
3089f12609 Meta: Avoid outputting stray closing bracket in IDL code generation 2025-12-12 10:49:18 +00:00
Andreas Kling
cb23d65625 LibJS: Pass JS::Value directly to string formatting functions
We don't need to call .to_string_without_side_effects() when passing
a JS::Value in for string formatting. The Formatter will do it for us.
2025-12-09 21:44:13 -06:00
Marcos Del Sol Vives
77cab84620 LibUnicode: Update ICU to 78.1
Updated also IdnaTestV2 for Unicode 17.0.0
2025-12-08 11:29:12 -05:00
Callum Law
7110687155 LibWeb: Add method to get multiplicity of property 2025-12-08 11:41:13 +00:00
Sam Atkins
16c12c1485 LibWeb: Parse the ::part() pseudo-element selector
It doesn't yet do anything, but it helps a few tests that just check
serialization.
2025-12-08 09:44:32 +00:00
mikiubo
de4e3ef63a LibWeb: Honor LegacyNullToEmptyString in union string conversion
The IDL generator was passing 'false' to generate_to_cpp when converting
a union containing a string type.
This broke WebIDL's LegacyNullToEmptyString behavior.

Pass the actual legacy_null_to_empty_string flag instead.
Fixes some WPTs:

domparsing/outerhtml-02
trusted-types/block-string-assignment-to-Element-outerHTML
trusted-types/block-string-assignment-to-HTMLElement-generic
trusted-types/block-string-assignment-to-ShadowRoot-innerHTML
2025-12-07 07:45:45 +00:00
Timothy Flynn
aae8574d25 LibHTTP: Place HTTP disk cache log points behind a debug flag
These log points are quite verbose. Before we enable the disk cache by
default, let's place them behind a debug flag.
2025-12-02 12:19:42 +01:00
Timothy Flynn
adcf5462af LibWeb+WebContent: Rename the http-cache flag to http-memory-cache
Rather than having http-cache and http-disk-cache, let's rename the
former to http-memory-cache to be extra clear what we are talking about.
2025-12-02 12:19:42 +01:00
Lorenz A
b579608d41 Meta: Remove unused function check_program_version_at_least
The function `check_program_version_at_least` was only used in
`ladybird.sh`, which was removed in PR #4904.
2025-12-01 13:02:53 +01:00
Callum Law
12e8f503aa LibWeb: Support non-fixed <random-value-sharing>
This works by generating random values using XorShift128PlusRNG at
compute time and then caching them on the document using the relevant
random-caching-key
2025-12-01 11:00:33 +00:00
Callum Law
86e6aa0291 LibWeb: Keep track of random function index within property value
Caching keys for 'auto' <random-value-sharing> rely on this value to
distinguish between two random functions in a single property
2025-12-01 11:00:33 +00:00
Callum Law
2a5e389f63 LibWeb: Implement basic CSS random() function
At the moment this is limited to only fixed value sharing and does not
support step values
2025-12-01 11:00:33 +00:00
Callum Law
76108b1979 LibWeb: Update math function argument parsing to use TokenStream
This brings us in line with the rest of the parsing methods
2025-12-01 11:00:33 +00:00
Callum Law
6d9f10ba36 LibWeb: Support nullable arguments to CSS math functions
All existing arguments have defaults but this isn't always the case
(e.g. the step argument for `random()`)
2025-12-01 11:00:33 +00:00
Luke Wilde
0eceee0a05 LibJS: Replace Array.fromAsync with a native JavaScript implementation
This allows us to use the bytecode implementation of await, which
correctly suspends execution contexts and handles completion
injections.

This gains us 4 test262 tests around mutating Array.fromAsync's
iterable whilst it's suspended as well.

This is also one step towards removing spin_until, which the
non-bytecode implementation of await uses.

```
Duration:
     -5.98s

Summary:
    Diff Tests:
        +4     -4 

Diff Tests:
    [...]/Array/fromAsync/asyncitems-array-add-to-singleton.js  -> 
    [...]/Array/fromAsync/asyncitems-array-add.js               -> 
    [...]/Array/fromAsync/asyncitems-array-mutate.js            -> 
    [...]/Array/fromAsync/asyncitems-array-remove.js            -> 
```
2025-11-30 11:54:54 +01:00
Andreas Kling
2d6bc21a33 LibJS: Show label names & targets in bytecode instruction serialization 2025-11-30 11:53:56 +01:00
ayeteadoe
59c963f98f Meta+LibGfx: Remove fontconfig dependency on Windows
Previously when launching a UI process and/or a WebContent process on
Windows, the following message would be output to the console:

Fontconfig error: Cannot load default config file: No such file: (null)

Apparently on Windows, you have to provide a font .conf file to
fontconfig explicitly. Since we are not doing that, the default fonts
that are backed off to are not ideal.

Similar to how we aren't using fontconfig on Android, Windows also has
native font infrastructure in terms of both a collection of System
installed fonts as well as skia support for font managers that use
native Windows APIs. With that, we can remove the usage of fontconfig
entirely and improve the fonts used on websites like ladybird.org or
google.com.
2025-11-22 07:51:55 -05:00
Andreas Kling
f37063e2a1 LibJS: Stop worrying about Instruction destructors
By adding static_asserts to prove that all of our generated instruction
classes are trivially destructible, we can confidently remove the
destructor walk in BasicBlock and save ourselves some unnecessary work.
2025-11-21 09:46:03 +01:00
Andreas Kling
003589db2d LibJS: Generate C++ bytecode instruction classes from a definition file
This commit adds a new Bytecode.def file that describes all the LibJS
bytecode instructions.

From this, we are able to generate the full declarations for all C++
bytecode instruction classes, as well as their serialization code.

Note that some of the bytecode compiler was updated since instructions
no longer have default constructor arguments.

The big immediate benefit here is that we lose a couple thousand lines
of hand-written C++ code. Going forward, this also allows us to do more
tooling for the bytecode VM, now that we have an authoritative
description of its instructions.

Key things to know about:

- Instructions can inherit from one another. At the moment, everything
  simply inherits from the base "Instruction".

- @terminator means the instruction terminates a basic block.

- @nothrow means the instruction cannot throw. This affects how the
  interpreter interacts with it.

- Variable-length instructions are automatically supported. Just put an
  array of something as the last field of the instruction.

- The m_length field is magical. If present, it will be populated with
  the full length of the instruction. This is used for variable-length
  instructions.
2025-11-21 09:46:03 +01:00
Andreas Kling
84443e1de6 Meta: Add ability for code generator to output one extra header 2025-11-21 09:46:03 +01:00
stasoid
01f6f33236 Meta: Compile for the native architecture of the host system on Windows
when ENABLE_CI_BASELINE_CPU is OFF
2025-11-21 09:10:28 +01:00
Jelle Raaijmakers
797e6dd4eb LibWeb: Implement SVGLengthList 2025-11-20 23:15:24 +01:00
Jelle Raaijmakers
871f121c75 Everywhere: Validate // NOTE: ... and // NB: ... comments 2025-11-18 09:07:37 -05:00
Psychpsyo
6951ef4ee3 Meta: Validate proper formatting for FIXMEs and AD-HOCs 2025-11-13 15:56:04 +01:00
Jelle Raaijmakers
7e869c7816 LibWeb: Add SVGNumber 2025-11-09 01:22:48 +01:00
Tim Ledbetter
93889c5cd7 CodeGenerators: Use a HashMap for string to PropertyID lookups 2025-11-08 09:29:27 +01:00
R-Goc
d25f0571a9 Meta: Ladybird.py debug on Windows
This adds the .exe suffix when passing the target process to the
debugger.
2025-11-07 23:17:35 +01:00
Undefine
0582c01c89 AK+Tests: Remove NoAllocationGuard
On systems other than SerenityOS this was a no-op anyways.
2025-11-07 11:27:51 +01:00
Undefine
17d3b881d3 AK+Everywhere: Remove ifdefs for WASM and Emscripten
Building the Ladybird code for Emscripten doesn't really make sense
and I doubt it is even possible with all the dependencies now.
2025-11-07 11:27:51 +01:00