Commit graph

3423 commits

Author SHA1 Message Date
Jelle Raaijmakers
8563e4a1cc Meta: Reuse built-in JS types list for IDL to C++ generation
This opens up the code path for the `ArrayBuffer` type, which can now be
used as a method argument.

(cherry picked from commit 0b9d55b6761b85b3b80a459d6231841e72a26c51)
2024-11-13 10:17:34 -05:00
Nico Weber
1b0ed2d74a Meta: Add more commits and PRs to lb-cherry-picks.py 2024-11-13 09:58:46 -05:00
Jamie Mansfield
5ef8538d38 LibWeb/UIEvents: Implement TextEvent
(cherry picked from commit f610a12671cccc5bf96c7ce8f7773c02412b8d81)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
ad93d00ed2 LibWeb/UIEvents: Implement CompositionEvent
(cherry picked from commit 86e20ea2469c0defb6fca40de3cbb339c168b543)
2024-11-12 22:26:21 -05:00
Jamie Mansfield
77cdbb5318 LibWeb/UIEvents: Implement InputEvent
(cherry picked from commit 9fce70069dc29f2232feb8247e69d21fe720fa94)
2024-11-12 22:26:21 -05:00
justus2510
da16c169ae LibWeb: Handle unpaired surrogates in USVStrings
This should fix (at least) the last two remaining WPT test failures in
FileAPI/unicode.html.

(cherry picked from commit 55f0dc823ff266aeb29fd6f7d47d5e7f89a50ee6)
2024-11-12 19:57:55 -05:00
Timothy Flynn
ae6599c07a 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.

(cherry picked from commit 3332230cef8091f94f5c30e1f1984c1038cd4a1d)
2024-11-12 10:45:53 -05:00
Jonne Ransijn
5d6ef182f4 LibJS+LibWeb: Prevent double invocation of [[GetOwnProperty]]
The `[[GetOwnProperty]]` internal method invocation in
`OrdinarySetWithOwnDescriptor` was being invocated again with the same
parameters in the `[[DefineOwnProperty]]` internal method that is also
later called in `OrdinarySetWithOwnDescriptor`.

The `PlatformObject.[[DefineOwnProperty]]` has similair logic.

This change adds an optional parameter to the `[[DefineOwnProperty]]`
internal method so the results of the previous `[[GetOwnProperty]]`
internal method invocation can be re-used.

(cherry picked from commit 69f96122b6150c22d1e8dc848c097cead2d2ae3f)
2024-11-12 07:14:25 -05:00
sideshowbarker
aa34916d45 LibWeb: Complete support for all ARIA properties in current spec
This change completes handling for all ARIA properties defined in the
current ARIA spec — by adding handling for the following properties:

- aria-braillelabel
- aria-brailleroledescription
- aria-colindextext
- aria-description
- aria-rowindextext

(cherry picked from commit ede6924db8e4440ef3bdb0fbb34d31226568e55a)
2024-11-12 07:14:25 -05:00
Timothy Flynn
9f9c9c8bcb 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.

(cherry picked from commit 541968b30dc50208f473566498100769711f10c8;
amended to fix tiny conflict in ConnectionFromClient.h due to serenity
not having #1182 yet)
2024-11-12 06:45:27 -05:00
Nico Weber
871003161e Meta: Add PerformanceEventTiming to GN build
Makes Tests/LibWeb/Text/input/all-window-properties.html pass with GN
again.
2024-11-11 19:54:09 -05:00
Sam Atkins
20610c8589 Documentation: Stop telling people to get gn from homebrew
Homebrew doesn't have an entry for gn, so this was confusing.

(cherry picked from commit de1552342b7c4f3a998d45fe4e819ebac2cdb91d)
2024-11-11 19:54:09 -05:00
Noah Bright
8725bb12f2 LibWeb: Define PerformanceEventTiming
https://www.w3.org/TR/event-timing/#sec-performance-event-timing

Add idl, header and stubs for PerformanceEventTiming interface.

Two missing `PerformanceEntry` types that have come up in issues
are the `first-input` and the `event` entryTypes. Those are both
this.

Also, because both of those are this same interface, the static
methods from the parent class are difficult to implement because
of instance-specific details. Might either need subclasses or to
edit the parent and also everything that inherits from it :/

(cherry picked from commit d30ae92b82d997bc4db407c563c88f90d8260093)
2024-11-11 19:54:09 -05:00
Andreas Kling
5cd1016714 LibJS: Add RawNonnullGCPtr<T>
This is really just a type alias for NonnullGCPtr<T>, but it provides
a way to have non-owning non-visited NonnullGCPtr<T> without getting
yelled at by the Clang plugin for catching GC errors.

(cherry picked from commit 6a6618f5eab6e6a2c7c3fc03f8063cc6b497a0ec)
2024-11-11 17:22:05 -05:00
Sönke Holz
03a59014b9 Meta: Add the PrekernelPEImageGenerator tool
This tool will be used to convert the Prekernel into an EFI PE32+ image.
2024-11-11 09:06:40 -05:00
Sönke Holz
eaa729c58a Meta: Make LibELF available to Lagom tools
This will be required for the PrekernelPEImageGenerator lagom tool.
2024-11-11 09:06:40 -05:00
sideshowbarker
7e9c2bd36f 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.

(cherry picked from commit a7578164d4ea2aa6e7831d83e9a55b1ff39e37f7;
minorly amended to resolve conflict in lint-ci.sh due to serenity still
having check-emoji.py and check-markdown.sh)
2024-11-10 21:19:33 -05:00
Ali Mohammad Pur
9d11d82e2c Meta+Toolchain: Move the jakt runtime files into the Toolchain build dir
These files are all static libs and source code, and aren't needed to be
present at runtime inside the image.
2024-11-10 19:22:14 +01:00
Nico Weber
c4bbc08c2c Meta: Add TextTrackCue{,List}, VTT{Cue,Region} to GN build 2024-11-10 10:46:01 -05:00
Jamie Mansfield
b8530d3848 LibWeb/WebVTT: Implement VTTRegion idl interface
(cherry picked from commit 1a012f279a9791c685781b7189fba6cddb973f96)
2024-11-10 10:46:01 -05:00
Nico Weber
9f53517674 Meta: Add {Entries,MediaCapabilities}API, AbstractWorker to GN 2024-11-09 16:08:01 -05:00
Jamie Mansfield
722e144eba LibWeb/EntriesAPI: Implement FileSystemEntry
(cherry picked from commit 169163b0023302ae3a0762d875e7b7840cfcb687)
2024-11-09 16:08:01 -05:00
Jamie Mansfield
89e76f4ea6 LibWeb: Stub MediaCapabilities IDL interface
(cherry picked from commit 4c5a1763546a0ce71703fb89a7f89c968a7ac12f)
2024-11-09 07:29:52 -05:00
Nico Weber
435b07d893 Meta: Add ConsoleObjectPrototype.cpp to GN build
Added in 7d4fd29673 in #25322.
2024-11-09 07:28:00 -05:00
Timothy Flynn
8160fba4a9 LibWeb: Allow callback parameters to be nullable
This is needed for DataTransferItem's getAsString(callback?) prototype.

(cherry picked from commit 8865d18a6715480c186141ecfe2e182405a7eb93)
2024-11-08 22:32:11 -05:00
Nico Weber
0472ffe329 Meta: Tweak lb-cherry-picks.py script
* Use argparse to add flags for printing cherry-picked and rejected
  upstream PRs

* Add a few more entries to PRs we don't want, and for PRs that we
  already have through non-cherrypicks
2024-11-08 20:50:49 -05:00
Jamie Mansfield
77847cbb0e LibWeb/SVG: Add missing SVGGElement IDL file
(cherry picked from commit ea61e189eb31b185bfd7ccf381258d5ab5023072)
2024-11-07 23:07:20 -05:00
Jamie Mansfield
df05fe55c7 LibWeb/SVG: Implement <metadata> element
(cherry picked from commit e2f599ebee67ee1bf1509685b98abcef7a5d4ca9)
2024-11-07 23:07:20 -05:00
Sönke Holz
b07b589dad Meta: Add a virtio-serial device to the RISC-V machine
This unbreaks `Meta/serenity.sh run riscv64`, since 36a2826 enabled
SPICE by default (which requires a virtio-serial device).
2024-11-07 07:57:01 -05:00
Nico Weber
71ade49580 Meta: Add a script that prints potential Ladybird cherry-picks 2024-11-05 09:08:41 -05:00
sideshowbarker
271559bd80 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

(cherry picked from commit 15d67f0da2083c0a39964f8fc6bdcbbd4907b2ed)
2024-11-05 06:05:19 -05:00
Zachary Huang
f341138c70 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.

(cherry picked from commit e0bd42be9590b967d0b5788ce7537a861a35ba74;
amended to fix conflict on build files since we still BitmapMixer.cpp
that upstream removed in LadybirdBrowser/ladybird#41, and
BitmapSequence.cpp conflicted with that. Also amended to not have
AlphaType in BitmapMetadata since we don't have that, and to have
scale instead, which we still do have. Also updated encode() and
decode() to send things in the order they're in in the struct.)
2024-11-04 19:29:13 -05:00
Nico Weber
d646499dde Meta: Add HTML/ServiceWorker{Container,Registration} to GN build 2024-11-04 13:16:23 -05:00
Tim Ledbetter
8ef2496882 LibWeb: Stub the ServiceWorkerContainer interface
(cherry picked from commit 53ab6fa403ac774d6edb76c33a9b0f460eea9640)
2024-11-04 13:16:23 -05:00
Tim Ledbetter
c455a7492d LibWeb: Stub the ServiceWorkerRegistration interface
(cherry picked from commit 0c0a4a6042f7d25186c65ca60aa04d066dc51e97)
2024-11-04 13:16:23 -05:00
Tim Ledbetter
210d2c0193 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.

(cherry picked from commit 70fdf7affb95679382a1d46cdcea81bd847c8768)
2024-11-04 13:16:23 -05:00
Nico Weber
f2d448a2ff Meta: Add CSS_TRANSITIONS_DEBUG to GN build 2024-11-04 13:15:58 -05:00
Andreas Kling
1030034130 LibWeb: Put CSS transitions debug spam behind CSS_TRANSITIONS_DEBUG
(cherry picked from commit 42a1a0bd73fecd22452e224859d27221588c3f5f;
amended to fix conflicts in Debug.h.in and all_the_debug_macros.cmake)
2024-11-04 13:15:58 -05:00
Nico Weber
691cb9de0f Meta: Add CSS/Interpolation.cpp to GN build 2024-11-04 13:15:58 -05:00
MacDue
36a2826cd2 Meta: Enable qemu-vdagent (for copy/paste support) by default on Linux
This updates `run.py` so that it will configure the `qemu-vdagent`
(QEMU's built-in spice agent for clipboard support) when it's available.

Setting `SERENITY_SPICE=1` is only needed to use `spicevmc`, which
implements more features (such as file transfers), but requires more
setup to get working (see Documentation/SpiceIntegration.md).

This matches the behaviour of the old `run.sh` script, the logic was
changed (perhaps unintentionally) in the `run.py` rewrite.

Note: For copy/paste to work you may need to rebuild QEMU with
`--enable-gtk-clipboard` (which is added to `Toolchain/BuildQemu.sh`
for Linux as part of this patch).
2024-11-04 08:56:57 -05:00
Nico Weber
2177b63355 Meta: Add ClipboardEvent to GN build 2024-11-01 22:04:14 -04:00
Timothy Flynn
cf1bdd72ac LibWeb: Implement DataTransferItemList.prototype.add()
(cherry picked from commit 74d9cfbf2a2ef84e8634dafc78fc56e6cb153b6b)
2024-11-01 22:04:14 -04:00
Timothy Flynn
7e3ead83b0 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.

(cherry picked from commit 0b0d44da275067458e61a5dd80c4563f6aa7fdc6)
2024-11-01 22:04:14 -04:00
Timothy Flynn
c94054ff5c LibWeb: Sort list of imported namespaces
(cherry picked from commit 268d6dda2f060aef2a07dee7f06bcc57dccae136)
2024-11-01 22:04:14 -04:00
Jelle Raaijmakers
1da66b51fc Meta: Move SerenityOS.org website to separate repository
Our website is now hosted on GitHub pages, and published through this
new repository:

  https://github.com/SerenityOS/serenityos.org
2024-11-02 02:02:57 +01:00
Nico Weber
549699ac8b Meta: Make GN build actually refer to StorageAPI
This should have been part of #25241.
2024-11-01 20:24:55 -04:00
Nico Weber
819520ff1c Meta: Add dra-and-drop-related files to GN build 2024-11-01 19:58:08 -04:00
Andrew Kaster
5182adab7e LibJS+ClangPlugins: Add escape hatch for GCPtr checks
(cherry picked from commit f314f58fca04ac8246fcdacd47f4a3829d3c6e01)
2024-11-01 18:41:49 -04:00
Jamie Mansfield
ce7cbe3baa LibWeb: Implement NavigatorStorage mixin interface
Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
(cherry picked from commit e3b3041a0c87f4cfd6d7941963452c3c9428b487)
2024-11-01 18:23:28 -04:00
Jamie Mansfield
e27951fc9d LibWeb: Stub StorageManager idl interface
(cherry picked from commit 1b84062c747e90ee00c5cbc42224f2c22e9e2aba)
2024-11-01 18:23:28 -04:00