Commit graph

2198 commits

Author SHA1 Message Date
Timothy Flynn 6520a9a849 LibWeb: Support TrackEvent instances with an AudioTrack track type 2023-06-14 17:54:40 +02:00
Aliaksandr Kalenik edf11b3809 Meta: Exclude cloned WPT repo from linting by check-markdown.sh 2023-06-14 06:45:04 +02:00
Aliaksandr Kalenik 0677270a3e Meta: Add WPT in Azure CI 2023-06-14 06:45:04 +02:00
Andreas Kling f7dc2742a9 CI: Don't run brew update on macOS CI 2023-06-13 17:25:39 +02:00
Andreas Kling 3d67f75bef CI: Disable ASAN's use-after-return check
This has apparently started defaulting to "on" at some point, which
breaks our conservative stack scan in LibJS.
2023-06-13 13:15:34 +02:00
Timothy Flynn a34e369252 Ladybird+LibWeb+WebContent: Create a platform plugin for playing audio
This creates (and installs upon WebContent startup) a platform plugin to
play audio data.

On Serenity, we use AudioServer to play audio over IPC. Unfortunately,
AudioServer is currently coupled with Serenity's audio devices, and thus
cannot be used in Ladybird on Lagom. Instead, we use a Qt audio device
to play the audio, which requires the Qt multimedia package.

While we use Qt to play the audio, note that we can still use LibAudio
to decode the audio data and retrieve samples - we simply send Qt the
raw PCM signals.
2023-06-13 06:14:01 +02:00
Timothy Flynn 936ec94f81 AK+LibAudio+AudioServer: Silence very noisy debug statements by default
These are spammed quite heavily on the debug console, especially at the
end of audio playback.
2023-06-13 06:14:01 +02:00
Jelle Raaijmakers 5ff80b60cf Meta: Rename BuildIt.sh to BuildGNU.sh
Bring it in line with `Toolchain/BuildClang.sh`.
2023-06-12 16:22:55 -07:00
Andreas Kling a6c6c24428 Lagom: Allow opting into linking with mold 2023-06-10 17:31:41 -07:00
Ali Mohammad Pur 47248a3511 LibWasm: Keep track of created directory fds in path_create_directory 2023-06-10 07:18:02 +02:00
Zaggy1024 873b0e9470 LibGfx/LibVideo: Read batches of multiple bytes in VPX BooleanDecoder
This does a few things:

- The decoder uses a 32- or 64-bit integer as a reservoir of the data
  being decoded, rather than one single byte as it was previously.
- `read_bool()` only refills the reservoir (value) when the size drops
  below one byte. Previously, it would read out a bit-sized range from
  the data to completely refill the 8-bit value, doing much more work
  than necessary for each individual read.
- VP9-specific code for reading the marker bit was moved to its own
  function in Context.h.
- A debug flag `VPX_DEBUG` was added to optionally enable checking of
  the final bits in a VPX ranged arithmetic decode and ensure that it
  contains all zeroes. These zeroes are a bitstream requirement for
  VP9, and are also present for all our lossy WebP test inputs
  currently. This can be useful to test whether all the data present in
  the range has been consumed.

A lot of the size of this diff comes from the removal of error handling
from all the range decoder reads in LibVideo/VP9 and LibGfx/WebP (VP8),
since it is now checked only at the end of the range.

In a benchmark decoding `Tests/LibGfx/test-inputs/4.webp`, decode times
are improved by about 22.8%, reducing average runtime from 35.5ms±1.1ms
down to 27.4±1.1ms.

This should cause no behavioral changes.
2023-06-10 07:17:12 +02:00
Sam Atkins 5e3da93f1a LibWeb: Add RatioStyleValue and parsing 2023-06-09 20:37:51 +02:00
implicitfield 71b184accf Meta+Lagom: Enable CMAKE_BUILD_WITH_INSTALL_RPATH
On macOS, CMake incorrectly tries to add and/or remove rpaths from files
that it has already processed when it performs installation. Setting the
rpaths during the build process ensures that they are only set once, and
as a bonus, makes installation slightly more performant.

Fixes #10055.
2023-06-08 17:59:53 +02:00
Jelle Raaijmakers 2e3bff7ab1 Meta: Re-add boot drive to aarch64 run configuration
This broke in c2e24a2fa1 where the boot
drive was removed from `SERENITY_MACHINE`. We now add the boot drive to
the common Qemu arguments, so it gets included in the aarch64 run
configuration as well.
2023-06-08 14:43:14 +02:00
Timothy Flynn cb912f0e1a LibEDID: Ignore duplicate PNP IDs
The PNP IDs data file was recently updated with an accidental duplicate
entry (HONOR Device Co., Ltd.). Rather than breaking everyone's build,
let's just ignore duplicates.
2023-06-08 13:03:14 +02:00
Andreas Kling 7f90b0cab7 LibWeb: Don't override prototype on generated iterator prototypes
Generated iterator prototypes already have the IteratorPrototype as
their prototype, but we were incorrectly hijacking them and rerouting
to ObjectPrototype.

Regressed in cfe663435e.
2023-06-08 10:05:56 +02:00
Ben Wiederhake 4a359b5a42 Meta: Check that local includes can be resolved
If a local include does not point to a file in the repository, it should
be a system include instead. This is now checked on every commit.

While this does introduce significant overhead in terms of percentage,
I think that an additional 10ms on huge commits (or less on smaller
commits) are acceptable:

hyperfine -w1 './Meta/check-style.py AK/*.h AK/*.cpp' # Before
Benchmark 1: ./Meta/check-style.py AK/*.h AK/*.cpp
  Time (mean ± σ):      20.3 ms ±   0.4 ms    [User: 17.1 ms, System: 3.
5 ms]
  Range (min … max):    19.5 ms …  21.6 ms    128 runs

hyperfine -w1 './Meta/check-style.py AK/*.h AK/*.cpp' # After
Benchmark 1: ./Meta/check-style.py AK/*.h AK/*.cpp
  Time (mean ± σ):      32.3 ms ±   0.4 ms    [User: 27.9 ms, System: 4.
4 ms]
  Range (min … max):    31.4 ms …  34.9 ms    91 runs
2023-06-06 23:19:50 +02:00
Ben Wiederhake 6a351376aa Everywhere: Only use local includes where appropriate
If a local include does not point to a file in the repository, it should
be a system include instead.
2023-06-06 23:19:50 +02:00
Andreas Kling 941092e3ad LibWeb: Make CSS/Properties.json "logical-aliases-for" an array
This allows us to specify all aliases properties instead of just one.
2023-06-06 21:02:04 +02:00
Jelle Raaijmakers c2e24a2fa1 Meta: Use SERENITY_BOOT_DRIVE for aarch64 as well 2023-06-06 06:44:05 -07:00
Jelle Raaijmakers 210e90dab8 Meta: Enable NVME by default
This results in significant performance improvements in both sequential
and random disk reading and writing.
2023-06-06 06:44:05 -07:00
Sam Atkins 2d7308cb88 LibWeb: Support infinite range for CSS properties
This makes `[-∞,∞]` generate valid code, instead of `return ;`
2023-06-02 20:04:23 +02:00
Sam Atkins 51f75d7071 LibWeb: Generate bounds-checking functions for CSS basic types 2023-06-02 17:46:35 +02:00
Fabian Dellwing 33815d550b Meta: Update cacert.pem 2023-05-30 13:05:19 +02:00
Ali Mohammad Pur 0e3fb39a0a LibWeb: Make 'optional BufferSource' IDL arguments actually optional
Previously this was compiled to require an object despite the IDL file
specifying 'optional'.
This commit makes IDLGenerator respect this modifier, and fixes the only
affected instance.
2023-05-30 12:50:13 +02:00
Ali Mohammad Pur e90752cc21 LibWeb: Add preliminary support for CSS animations
This partially implements CSS-Animations-1 (though there are references
to CSS-Animations-2).
Current limitations:
- Multi-selector keyframes are not supported.
- Most animation properties are ignored.
- Timing functions are not applied.
- Non-absolute values are not interpolated unless the target is also of
  the same non-absolute type (e.g. 10% -> 25%, but not 10% -> 20px).
- The JavaScript interface is left as an exercise for the next poor soul
  looking at this code.

With those said, this commit implements:
- Interpolation for most common types
- Proper keyframe resolution (including the synthetic from-keyframe
  containing the initial state)
- Properly driven animations, and proper style invalidation

Co-Authored-By: Andreas Kling <kling@serenityos.org>
2023-05-29 05:35:41 +02:00
Ali Mohammad Pur 279924242d LibWeb: Add CSS CompositeStyleValue
This represents the value of properties assigned via their shorthands,
and is expanded when computing actual property values.
2023-05-29 05:35:41 +02:00
Andreas Kling ad6027433d headless-browser: Print a diff when a test failure occurs
This will make it a lot easier to understand what went wrong, especially
when the failure occurs on CI but not at home.

And of course, use LibDiff to generate the diff! :^)
2023-05-28 22:03:57 +02:00
Karthik Karanth 72507c318a LibWeb: Add logical-alias-for in Properties.json
This allows for succint definitions of logical properties, by allowing
them to inherit initial values, valid identifiers, etc from another
property
2023-05-27 16:02:33 +02:00
Matthew Olsson f63d027b0b Meta: Fix unresolvable reference to WebIDL::OperationReturnsPromise 2023-05-27 13:55:14 +02:00
Ben Wiederhake 64a2a63df6 LibCore: Drop TestLibCoreIODevice
It does not make sense to test known-working code that is deprecated and
in the process of being removed. Also, this test becomes too cumbersome
to write without using read_all or line iteration in some form, and
migrating the test is just silly.
2023-05-27 07:16:01 +02:00
Sam Atkins f6fae315e3 LibWeb: Add CustomIdentStyleValue, along with parsing for it
This corresponds to the `<custom-ident>` type in CSS grammar.
2023-05-25 15:31:20 +01:00
Sam Atkins 6b8f484114 LibWeb: Stop generating now-unused property_accepts_value() function 2023-05-25 06:36:10 +02:00
Sam Atkins 465ecf37c2 LibWeb: Make property_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins 03613dc14d LibWeb: Make value_id_from_string() return Optional 2023-05-25 06:36:10 +02:00
Sam Atkins 9b61f79eae LibWeb: Generate property_accepts_[identifier/type]() functions
These will be used to parse StyleValues more intelligently.
2023-05-25 06:36:10 +02:00
kleines Filmröllchen 82c681e44b LibTimeZone+Userland: Change timezone functions to use UnixDateTime
This incurs a whole host of changes in, among others, JavaScript Intl
and Date.
2023-05-24 23:18:07 +02:00
kleines Filmröllchen 213025f210 AK: Rename Time to Duration
That's what this class really is; in fact that's what the first line of
the comment says it is.

This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
2023-05-24 23:18:07 +02:00
implicitfield b6af5eaa72 Fuzzers: Unbreak FuzzHttpRequest
Previously, the exit condition was inverted, causing the fuzzer to
try to read the value of an error.
2023-05-24 16:25:13 +02:00
Daniel Bertalan 81b6723b29 Meta: Add GCC 13 and Clang 16 to compiler autodetection 2023-05-24 01:20:02 -06:00
Daniel Bertalan 4202bb597b Meta+Documentation: Require Xcode 14.3 or Clang 14 for the host compiler
There have been multiple reports of Xcode 14.0 (based on upstream LLVM
14) segfaulting when compiling `LibCore/Process.cpp`. Let's require
Xcode 14.3, which is a known good version based on LLVM 15.

Note that Xcode 14.3 requires macOS Ventura, so users of Monterey or
older are expected to get Homebrew Clang instead.

Homebrew Clang 13 also suffers from the same crash. Although I have not
tested on Linux, the backtrace points to the middle-end, so x86_64 is
also likely to be affected. LLVM 14 was released 14 months ago, so it's
not an unreasonable requirement.
2023-05-24 01:20:02 -06:00
Tim Schumacher 0f2b6345c6 test-fuzz: Add all the missing fuzzers 2023-05-23 06:11:33 +02:00
Tim Schumacher 9690b4011b Lagom: Extract the list of fuzzing targets to a separate file 2023-05-23 06:11:33 +02:00
Luke Wilde a5936864d9 LibWeb: Stub AudioContext constructor
This is enough to make Discord not throw up "Well this is awkward" on
login.
2023-05-22 06:07:05 +02:00
Caoimhe fd4f00ee91 AK: Add SPICE_AGENT_DEBUG flag 2023-05-21 18:45:53 +02:00
Andreas Kling cfe663435e LibWeb+LibJS: Don't lazily construct web prototypes in cell constructors
It's not safe to allocate from the GC heap while in the constructor of a
GC heap cell. (Because if this ends up triggering a collection, we may
end up trying to call through an uninitialized vtable).

This was already done safely in the initialize() virtual in much of
LibJS and LibWeb. This patch moves the logic for prototypes, mixins,
and CSSStyleDeclaration as well.

Fixes a long-standing GC crash that was pretty easy to reproduce by
refreshing https://vercel.com/
2023-05-21 14:23:58 +02:00
Ben Wiederhake 943ecaede6 LibIPC: Remove redundant IPC::Dictionary type
We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is essentially equivalent.
2023-05-21 07:53:45 +02:00
Ben Wiederhake 6055eed5a5 xml: Prefer LibFileSystem over DeprecatedFile 2023-05-21 07:50:52 +02:00
Ben Wiederhake f43f83512e Meta: Also run markdown-check on markdown files in each Port subdir 2023-05-21 07:50:09 +02:00
Ben Wiederhake 2a051738ca Base: Move user nona from group 200 into existing group users
It seems that group 200 never existed, and group 100=users always did:
90bab5ea71
2023-05-20 14:40:24 +02:00