Commit Graph

3456 Commits

Author SHA1 Message Date
Sönke Holz
b0503607d9 Meta: Try to download files with gzip compression in download_file.py
This makes downloading emoji-test.txt a lot faster.
2024-11-21 10:08:16 +01:00
Sönke Holz
be9c0921ff Meta: Use download_file.py for the CMake build
This required making the `-v` and `-f` arguments optional.
2024-11-21 10:08:16 +01:00
stelar7
c39fa9a033 LibWeb: Parse the rotate css property
(cherry picked from commit 488436fb54347e69040cfed4f523926241a136a3)
2024-11-19 11:02:38 -05:00
Lucas CHOLLET
5148cd3122 LibWeb/CSS: Start parsing the color() function
This is really bare bone as we only support the `xyz-d50` color space
for the moment.

It makes us pass the following WPT tests:
 - css/css-color/predefined-016.html
 - css/css-color/xyz-d50-001.html
 - css/css-color/xyz-d50-002.html

(cherry picked from commit 48bbebc636598eca905b8eef984ee2cba548ff64)
2024-11-18 20:22:45 -05:00
Lucas CHOLLET
12c57e3026 LibWeb/CSS: Introduce a base class for LCH-based color values
This will be used by both CSSLCH and CSSOKLCH.

(cherry picked from commit e8fc731b8cde75a0af9571a3b491f6149038ea21)
2024-11-18 13:21:10 -05:00
Nico Weber
bb2ce8b993 Meta: Add CSSNestedDeclarations to GN 2024-11-18 09:48:28 -05:00
Lucas CHOLLET
b49cc740e8 LibWeb/CSS: Make CSSOKLab inherit from a new CSSLabLike class
This class provides the common base for both CSSOKLab and the future
CSSLab classes.

(cherry picked from commit 8efa046e0c56d970cabe5644e0e8b4eef85013c3)
2024-11-18 09:07:51 -05:00
Sam Atkins
fe9ab2c91e LibWeb/CSS: Rewrite CSS Parser core methods according to new spec
CSS Syntax 3 (https://drafts.csswg.org/css-syntax) has changed
significantly since we implemented it a couple of years ago. Just about
every parsing algorithm has been rewritten in terms of the new token
stream concept, and to support nested styles. As all of those
algorithms call into each other, this is an unfortunately chonky diff.

As part of this, the transitory types (Declaration, Function, AtRule...)
have been rewritten. That's both because we have new requirements of
what they should be and contain, and also because the spec asks us to
create and then gradually modify them in place, which is easier if they
are plain structs.

(cherry picked from commit e0be17e4fbf1870f35614d0cde8f63e72f78bd16;
amended to tweak test expectation due to serenity not yet having
LadybirdBrowser/ladybird#1603)
2024-11-17 22:08:57 -05:00
Sam Atkins
962207a2db LibWeb/CSS: Bring TokenStream in line with spec
When the TokenStream code was originally written, there was no such
concept in the CSS Syntax spec. But since then, it's been officially
added, (https://drafts.csswg.org/css-syntax/#css-token-stream) and the
parsing algorithms are described in terms of it. This patch brings our
implementation in line with the spec. A few deprecated TokenStream
methods are left around until their users are also updated to match the
newer spec.

There are a few differences:

- They name things differently. The main confusing one is we had
  `next_token()` which consumed a token and returned it, but the spec
  has a `next_token()` which peeks the next token. The spec names are
  honestly better than what I'd come up with. (`discard_a_token()` is a
  nice addition too!)

- We used to store the index of the token that was just consumed, and
  they instead store the index of the token that will be consumed next.
  This is a perfect breeding ground for off-by-one errors, so I've
  finally added a test suite for TokenStream itself.

- We use a transaction system for rewinding, and the spec uses a stack
  of "marks", which can be manually rewound to. These should be able to
  coexist as long as we stick with marks in the parser spec algorithms,
  and stick with transactions elsewhere.

(cherry picked from commit b645e26e9b29437c0e248b5e43e3ec76aacf960d)
2024-11-17 18:57:30 -05:00
Nico Weber
6c341b9819 Meta: Add more commits and PRs to lb-cherry-picks.py
Also implement a consistency check for never_merge_commits,
and move one commit from it to never_merge_prs that was failing
that check.
2024-11-17 15:05:50 -05:00
Shannon Booth
be9872c3fd LibWeb: Add support for dictionaries in overload resolution
By making use of the known set of supported dictionary names in that
overload set. Note that this list is typically very small (the max that
we have currently is 1).

(cherry picked from commit 70599d3f8d015ca0e5c704e8b0afad85a0f2fa1a)
2024-11-17 13:47:42 -05:00
Shannon Booth
c48cc68197 LibWeb: Verify that all overloads contain Unscopable if present
It would be strange for the IDL to be defined as such, so instead of
leaving a FIXME comment, let's just verify that this doesn't happen in
practise incase it does end up happening in reality.

(cherry picked from commit 013c2a1c7cda0d5921e2368e5de3a65ed9208625)
2024-11-17 13:47:42 -05:00
Andrew Kaster
eac6c59e68 LibWeb: Add ServiceWorker job registration and execution
Now we can register jobs and they will be executed on the event loop
"later". This doesn't feel like the right place to execute them, but
the spec needs some updates in this regard anyway.

(cherry picked from commit 29416befe640eae7bf44b72e3f4ad42a1e397701)
2024-11-17 13:47:42 -05:00
Nico Weber
2a3333bf17 Meta: Add ServiceWorker-related files to GN 2024-11-17 11:03:57 -05:00
Nico Weber
9f8db75b2a Meta: Let LibWebView link to LibSyntax, add Document to LibSyntax in GN 2024-11-16 14:05:12 -05:00
Nico Weber
4678fc1029 Meta: Add StyleSheetIdentifier.cpp to the GN build 2024-11-15 23:10:03 -05:00
Sam Atkins
5d86305596 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.

(cherry picked from commit 8cbc2116162764479edeec78e4b2b7c41447b643;
amended to fix conflicts in two cmake files, due to serenity
still having more code_generators, and still buildling
OutOfProcessWebView.cpp. Also kept embed_as_string_view because
it's used by stringify_gml. Did this by giving embed_as_string.py
a --type= argument that defaults to string but can also be set
to string-view.)
2024-11-15 23:10:03 -05:00
Andrew Kaster
05fffee336 CMake: Move ca_certificate_download include up with other downloads
(cherry picked from commit 82b73b2eee8448e07925909720191bb3bbdac670)
2024-11-15 08:56:56 -05:00
stelar7
25374a193c LibWeb/Meta: Adjust how missing/invalid default values are generated
(cherry picked from commit d81f31c6993a422e02d48b02872de436a07e73b7)
2024-11-14 17:46:06 -05:00
Jelle Raaijmakers
35f4f5cf54 LibWeb: Implement AudioListener
This exposes BaseAudioContext.listener, which is a container for
parameters related to the configuration of an actual "listener" in 3D
space.

(cherry picked from commit 2a98f2a12d5069a2189fa38b4a7e158d84ee03ec)
2024-11-14 17:46:06 -05:00
sin-ack
23e49f2835 BindingsGenerator: Handle global interfaces without named properties
DedicatedWorkerGlobalScope is an object with a Global extended
attribute, but does not define any named property getters. This needs to
be handled by setting the prototype chain to:

    DedicatedWorkerGlobalScope
    ^ DedicatedWorkerGlobalScopePrototype
    ^ WorkerGlobalScopePrototype

(This is different from something like Window, where there is an
intermediate WindowProperties object for named properties.)

Previously, we treated the GlobalMixin object as if it was a simple
prototype object, accidentally setting DedicatedWorkerGlobalScope's
prototype to WorkerGlobalScopePrototype. This caused the expression

    self instanceof DedicatedWorkerGlobalScope

to return false inside workers.

This makes us pass many more of the "/xhr/idlharness.any.worker" WPT
tests than before, rather than failing early.

(cherry picked from commit d5948709cd499ef0e7bfa3c24e8c03befed115fe)
2024-11-14 17:46:06 -05:00
Nico Weber
5dbc8f8481 Meta: Add new WebGL source files to GN build as well
LadybirdBrowser/ladybird#2308 updated idl_files.gni,
but not the actual build file.
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
b67c8d138c LibWeb: Add WebGLShaderPrecisionFormat
(cherry picked from commit 3d8ab0e67c707062e4d889598fbd176fa0c6fce8)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
b288bfd994 LibWeb: Add WebGLActiveInfo
(cherry picked from commit d63a979bde54ad93422c2fadb5cf24cbc3339e07)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
59ed552646 LibWeb: Add WebGLUniformLocation
(cherry picked from commit 889e7942fa090a240743d3b53ab2bc5288e064c3)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
1097eaf38b LibWeb: Add WebGLTexture
(cherry picked from commit f2a164365007ad5e06f3ce47702ded55c42fbcb6)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
e41789f5f9 LibWeb: Add WebGLShader
(cherry picked from commit 2b09afb971059f22a0eb82661262954211b694b9)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
e64cf9633d LibWeb: Add WebGLRenderbuffer
(cherry picked from commit d53cb9833b274658c1ec1b6c1813cfb466470bdb)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
8e05ba45d0 LibWeb: Add WebGLProgram
(cherry picked from commit 6b7d5dbec6a9daf1033ee2e8c4c48037ccd35360)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
88ce676d20 LibWeb: Add WebGLFramebuffer
(cherry picked from commit 5d0b206d6ec9c3a5284ee6db7452b21a6cf6c7cd)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
4e9c64c37f LibWeb: Add WebGLBuffer
(cherry picked from commit b21857b26587a1108325ba7d1e7c69986d3ddaa3)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
1e0b742903 LibWeb: Add WebGLObject interface
(cherry picked from commit e6ee7f3e642acd548b3ae96c47f7174ceb98f730)
2024-11-13 19:32:27 -05:00
Jelle Raaijmakers
e87b17b0e0 LibWeb: Add stubbed Media Source Extensions API
Just the boilerplate :^)

(cherry picked from commit 35043702813117d22e841e1b1d887d1726d4ed2d;
amended to fix conflict in idl_files.gni due to ladybird being worse
than serenity at having that file sorted alphabetically)
2024-11-13 19:32:14 -05:00
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