Commit graph

64970 commits

Author SHA1 Message Date
Timothy Flynn
db47cc41f8 Everywhere: Move the Ladybird folder to UI 2024-11-10 12:50:45 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
950e819ee7 Everywhere: Hoist the Utilities folder to the top-level 2024-11-10 12:50:45 +01:00
Timothy Flynn
22e0eeada2 Everywhere: Hoist the Services folder to the top-level 2024-11-10 12:50:45 +01:00
Aliaksandr Kalenik
a7dc40eff3 LibWeb: Delete unused LineBoxFragment::absolute_rect()
Some checks are pending
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
2024-11-10 01:27:49 +01:00
Andreas Kling
72320be124 LibWeb: Stub out SVGGraphicsElement.getScreenCTM()
This allows us to run Speedometer 3.0 to completion. :^)
2024-11-10 00:35:32 +01:00
Cory Virok
39f844f77c LibWeb/Tests: Added example test for how to use http-test-server.py
The example shows how to write a test that depends on custom HTTP
headers in the response. This will be useful for testing browser JS
that depends on how Ladybird processes response headers, eg CORS
headers like Access-Control-Allow-Origin and others.
2024-11-09 13:08:31 -07:00
Andrew Kaster
3fdb2b081f Ladybird: Add a test fixture for the HTTP echo server 2024-11-09 13:08:31 -07:00
Andrew Kaster
ba78b294a0 Ladybird: Add ability to add test fixtures for LibWeb tests
This will be used to add test fixtures that use external
resources or require a specific setup.
2024-11-09 13:08:31 -07:00
Cory Virok
97d47a38c9 Meta: Add an HTTP echo server to help with testing Browser JS
This allows us to simulate HTTP responses from Browser JS tests.
Instead of using hacks like data URLs to "load" external data,
we can now generate an actual HTTP response that contains
arbitrary headers, body, and has a defined response delay.
2024-11-09 13:08:31 -07:00
Shannon Booth
e4891af970 LibJS: Implement Error.isError
Implementing the stage 2.7 proposal:

https://github.com/tc39/proposal-is-error
2024-11-09 13:04:54 -07:00
Aliaksandr Kalenik
4b93e27698 LibGfx+LibWeb: Create PaintingSurface snapshot without GPU->RAM readback
...by constructing ImmutableBitmap directly from SkImage.

This is a huge optimization for the case when content of canvas is
painted onto another canvas, as it allows pixels to remain in GPU memory
throughout the process.

Fixes performance regression on https://playbiolab.com/ introduced by
switching to GPU-backend for canvas.
2024-11-09 20:51:24 +01:00
Aliaksandr Kalenik
1a01a71568 LibWeb: Delete DrawScaledBitmap display list item type
It's possible to replaces all uses of this item by wrapping Gfx::Bitmap
in Gfx::ImmutableBitmap.
2024-11-09 20:51:24 +01:00
Aliaksandr Kalenik
698bca686e LibGfx+LibWeb: Cache SkImage in ImmutableBitmap
By caching the SkImage that is reused across repaints, we allow Skia t
optimize GPU texture caching.

ImmutableBitmap is chosen to own the SkImage because it guarantees that
the underlying pixels cannot be modified. This is not the case for
Gfx::Bitmap, where invalidating the SkImage would be challenging since
it exposes pointers to underlying data through methods like scanline().
2024-11-09 20:51:24 +01:00
Aliaksandr Kalenik
460803d2da LibGfx: Delete unused id property from ImmutableBitmap 2024-11-09 20:51:24 +01:00
Aliaksandr Kalenik
a2c33ea4e1 LibWeb: Return ImmutableBitmap from PaintingSurface::create_snapshot()
This is a preparation for upcoming changes where ImmutableBitmap will
own SkImage allowing Skia to cache GPU textures across repaints.
2024-11-09 20:51:24 +01:00
stasoid
31bf40b659 AK: Make LexicalPath::relative_path() fallible 2024-11-09 12:42:27 -07:00
stasoid
f026d495cd AK: Port LexicalPath to Windows
Supported:
* Normal absolute and relative paths: C:\Windows\Fonts, AK\LexicalPath.h
* Forward slashes and multiple separators: C:/Windows///\\\notepad.exe

Not supported:
* Paths starting with two backslashes: \\?\C:\Windows, \\server\share
* Unusual relative paths like C:, C:a\b, \, \a\b

More on Windows path formats: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
2024-11-09 12:42:27 -07:00
stasoid
9ebed7d8d5 AK: Add StringBuilder::append_repeated(StringView, size_t)
By analogy with append_repeated(char, size_t)
2024-11-09 12:42:27 -07:00
stasoid
e6749eb6b7 LibCore: Port AnonymousBuffer to Windows 2024-11-09 12:40:35 -07:00
Shannon Booth
457cdd0cc3 LibWeb: Wire up UniversalGlobalScopeMixin to ShadowRealmGlobalScope 2024-11-09 12:36:12 -07:00
Shannon Booth
2ea31fad32 LibWeb: Add support for interfaces being exposed for shadow realm 2024-11-09 12:36:12 -07:00
Shannon Booth
fc2104f099 LibWeb: Add support for intrinsics on a synthetic realm 2024-11-09 12:36:12 -07:00
Shannon Booth
9ba68c5776 LibWeb: Move host_defined_intrinsics out of line 2024-11-09 12:36:12 -07:00
Andreas Kling
107b20e84d LibWeb: Restrict CSS gap properties to values allowed by the spec
Gap values are now represented by Variant<LengthPercentage, NormalGap>.
NormalGap is just an empty struct to represent the `normal` keyword.

This fixes a long-standing issue where we were incorrectly storing gaps
as CSS::Size, which led to us allowing a bunch of invalid gap values.
2024-11-09 19:21:00 +01:00
Andreas Kling
2a741f81c7 Tests: Import some WPT tests for the CSS gap properties 2024-11-09 19:21:00 +01:00
sideshowbarker
98b223b9df Docs: Beef up the FAQ 2024-11-09 11:07:55 -07:00
Jonne Ransijn
0080f399c7 LibJS: Remove PropertyKey::is_valid() method
Some checks failed
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled
This method was being used to check for invalid `PropertyKey`s.
Since invalid `PropertyKey`s are no longer created, and since the
associated method has also been removed in the latest edition of
ECMA-262, the method can now be removed here as well.

While we are removing all its calls, lets also update any surrounding
spec comments to the current latest edition, where possible.
2024-11-09 17:55:03 +01:00
Jonne Ransijn
bc05f6303f LibJS: Add PutBySpread instruction
This object property kind had completely different behaviour.
By adding an instruction for it, we can remove a bunch of special
casing, and avoid creating dummy `PropertyKey` values.
2024-11-09 17:55:03 +01:00
Jonne Ransijn
27859c17b4 LibJS: Remove default constructor of PropertyKey
This constructor was creating an "invalid" `PropertyKey`, but every
code path constructing such a `PropertyKey` was either never used or
immediately `VERIFY`ing that the `PropertyKey` was valid.

The `VERIFY` call has been moved to the `PropertyKey::from_value(...)`
call, and the array/object literal spreading code could be refactored
to not take a `PropertyKey` but creates dummy values for now.

The default constructor for `Reference` has similairly be deleted,
because it was never used.
2024-11-09 17:55:03 +01:00
Jonne Ransijn
1d8e62926f AK: Remove clang-tidy warnings for VERIFY(a || b) lines
Lines like these were getting a warning to simplify the expanded
boolean expression from `!(a || b)` to `(a && b)`, but since the
`!(...)` is part of the macro, that is never going to happen.
2024-11-09 17:55:03 +01:00
Timothy Flynn
ed6431a0b1 WebWorker: Move all WebWorker configuration to Services 2024-11-09 17:54:21 +01:00
Timothy Flynn
20bdd34696 WebContent: Move all WebContent configuration to Services 2024-11-09 17:54:21 +01:00
Timothy Flynn
528dd4fcbe RequestServer: Move all RequestServer configuration to Services 2024-11-09 17:54:21 +01:00
Timothy Flynn
6208abc221 ImageDecoder: Move all ImageDecoder configuration to Services 2024-11-09 17:54:21 +01:00
Timothy Flynn
19fb790dc6 WebDriver: Move all WebDriver configuration to Services 2024-11-09 17:54:21 +01:00
Timothy Flynn
d5c2d11ac7 Services: Remove unused main.cpp and CMakeLists.txt files
We will be moving the variants of these files from Ladybird to the
Userland/Services directory. To make the diffs in those commits actually
make sense, let's remove these unsused variants ahead of time.
2024-11-09 17:54:21 +01:00
Lucas CHOLLET
d0dfc0c3e1 Tests: Import WPT tests from css-color
Specifically, they are related to parsing the `lab()`, `lch()` and
`color(xyz-d50 ...)` color functions.
2024-11-09 17:53:53 +01:00
sideshowbarker
0a773b408a Tests: Allow wpt.live URLs for both “WPT.sh run” and “WPT.sh import”
This change allows you to give http[s]://wpt.live/ URLs to the WPT.sh
script for both the “WPT.sh run” and “WPT.sh import” commands.

That facilitates the use case where you’ve navigated to a wpt.live URL
in a browser, and you want to just directly copy-paste the URL in order
to either run the test in Ladybird, or import the test into the repo.

Otherwise, without this change, when using WPT.sh, you’re limited to
needing to specify either a WPT path fragment or filesystem pathname —
which doesn’t allow for easy copy-paste directly from wpt.fyi.
2024-11-09 15:32:51 +01:00
Sam Atkins
b0e58054aa LibWeb: Add pseudoElement parameter to GetAnimationsOptions
This corresponds to: https://github.com/w3c/csswg-drafts/pull/11050

For now, we don't do anything useful with this parameter, because we
don't yet support animating pseudo-elements.
2024-11-09 15:32:03 +01:00
Sam Atkins
c5c5d97544 LibWeb: Match spec changes to "apply the history step"
Corresponds to https://github.com/whatwg/html/pull/10704
2024-11-09 15:18:37 +01:00
Sam Atkins
0a578ee345 LibWeb/HTML: Update spec comments for "URL and history update steps"
Corresponds to:
https://github.com/whatwg/html/pull/10587
2024-11-09 15:18:37 +01:00
Sam Atkins
36f8dfaed0 LibWeb/HTML: Dispatch toggle and beforetoggle events from dialogs
Corresponds to https://github.com/whatwg/html/pull/10091
2024-11-09 15:18:00 +01:00
Lucas CHOLLET
10dc7ff042 LibWeb/CSS: Support the xyz-d65 colorspace in the color() function
This also adds support for `xyz` as it defaults to `xyz-d65`. We now
pass the following WPT tests:
 - css/css-color/xyz-001.html
 - css/css-color/xyz-002.html
 - css/css-color/xyz-004.html
 - css/css-color/xyz-d65-001.html
 - css/css-color/xyz-d65-002.html
 - css/css-color/xyz-d65-004.html
2024-11-09 15:15:36 +01:00
Lucas CHOLLET
ff6102430e LibGfx: Add Color::from_linear_srgb()
This will be usefully on its own later on when supporting this color
space directly, but it also allows us to do some factorization in the
current codebase.
2024-11-09 15:15:36 +01:00
Gingeh
47992f7b39 LibWeb: Compute mimetype when loading a document
computed type != supplied type
2024-11-09 14:30:38 +01:00
Sam Atkins
7a104fef66 LibWeb/CSS: Make non-nested & selector have 0 specificity
If a & simple selector is on a style rule with no parent style rule,
then it behaves like :scope - but notably, :scope provides 1
specificity in the class category, but & is supposed to provide 0.

To solve this, we stop replacing it directly, and just handle the & like
any other simple selector. We know that if the selector engine ever
sees one, it's equivalent to :scope, because the nested ones will have
been replaced with :is() before that point.

This gets us one more subtest pass. :^)
2024-11-09 14:29:37 +01:00
Sam Atkins
219346011b LibWeb/CSS: Require that tag-name simple selectors go first
This fixes 1 subtest.
2024-11-09 14:29:37 +01:00
Sam Atkins
a0403ac427 LibWeb: Add & when setting nested style rule's selector text
When we first parse a nested CSSStyleRule's selectors, we treat them as
relative selectors and then patch them up with an `&` as needed.
However, we weren't doing this when assigning the `cssText` attribute.
So, let's do that!

This gives us a couple of subtest passes. :^)
2024-11-09 14:29:37 +01:00
Andrew Kaster
3e0c182344 DevContainer: Use correct path for vcpkg binary
Now more correct than 7ae7b9b695
2024-11-09 08:18:41 -05:00