Commit graph

64057 commits

Author SHA1 Message Date
Jelle Raaijmakers
69f11fc1c6 LibWeb: Implement navigator.deviceMemory
Fixes at least 2 subtests in wpt/device-memory.
2024-10-08 19:02:27 +02:00
Jelle Raaijmakers
6189d1ac9d LibWeb: Add WebIDL::Double type 2024-10-08 19:02:27 +02:00
Jelle Raaijmakers
9515290fde LibCore: Add System::physical_memory_bytes() 2024-10-08 19:02:27 +02:00
Andreas Kling
274411db97 LibWeb: Support Document.onvisibilitychange
We don't have a way to trigger this from a test, but the fix is so
simple that we might as well get it in. :^)
2024-10-08 18:49:11 +02:00
Andreas Kling
26be8f865a LibWeb: Support Document.onreadystatechange
This is just a standard IDL event attribute handler.

Fixes at least one WPT test:
https://wpt.live/html/dom/documents/resource-metadata-management/document-readyState.html
2024-10-08 18:49:11 +02:00
Timothy Flynn
de1475f99a Documentation: Update description of "Unable to find ninja" error
Unlike the current FAQ entry, this error really never involves having to
uninstall/reinstall Ninja or invoking it directly.
2024-10-08 16:34:13 +02:00
Jelle Raaijmakers
cb21201550 LibWeb: Implement AudioNode.channelCount 2024-10-08 14:33:42 +02:00
Jelle Raaijmakers
7b4f0d13ee LibWeb: Implement AudioNode.numberOfInputs and .numberOfOutputs 2024-10-08 14:33:42 +02:00
Jelle Raaijmakers
d7a3bad2b4 LibWeb: Forward declare AudioDestinationNode to break header loop 2024-10-08 14:33:42 +02:00
Andreas Kling
94721385ce LibWeb: Ignore boxes wholly in the negative scrollable overflow region
This fixes an issue where https://hey.com/ was horizontally scrollable
even though it shouldn't be.
2024-10-08 14:33:35 +02:00
Timothy Flynn
15e7aaee1a Meta: Remove the WPT test target from CMake
The run script it refers to no longer exists.
2024-10-08 07:41:07 -04:00
Timothy Flynn
8b3a5d0b96 UI/Qt: Remove Qt networking linkage from WebContent/WebWorker
Missed in commit 1b324f3ae1.

Note that the UI process still links Qt::Network, as it uses that infra
for autocomplete queries currently.
2024-10-08 07:41:07 -04:00
Jamie Mansfield
f610a12671 LibWeb/UIEvents: Implement TextEvent 2024-10-08 11:45:39 +02:00
Jamie Mansfield
86e20ea246 LibWeb/UIEvents: Implement CompositionEvent 2024-10-08 11:45:39 +02:00
Jamie Mansfield
9fce70069d LibWeb/UIEvents: Implement InputEvent 2024-10-08 11:45:39 +02:00
Jamie Mansfield
60d9c3929c LibWeb: Correct forward for UIEvents::UIEvent 2024-10-08 11:45:39 +02:00
Andreas Kling
13ba491924 LibWeb: Don't let input element placeholders influence line-height
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Before this change, we transferred the input element's line-height to
both the editable text *and* the placeholder. This caused some strange
doubling of the effective line-height when the editable text was empty,
pushing down the placeholder.
2024-10-08 08:12:07 +02:00
Tim Ledbetter
e1eeb93cc6 LibWeb: Fire iframe load event on document close
This matches the behavior of other browsers.
2024-10-08 06:55:01 +02:00
Timothy Flynn
00487a7b25 LibWebView+LibWeb: Remove ResourceLoader and WebSocket adapters
These were used to provide a layer of abstraction between ResourceLoader
and the networking backend. Now that we only have RequestServer, we can
remove these adapters to make the code a bit easier to follow.
2024-10-08 06:52:51 +02:00
Timothy Flynn
3de86cf0fa LibRequests: Add a forwarding header 2024-10-08 06:52:51 +02:00
Timothy Flynn
1b324f3ae1 LibWebView+UI: Remove Qt networking infrastructure
Now that we use libcurl, there's no reason to keep Qt networking around.
Further, it doesn't support all features we need anyways, such as non-
buffered request handling for SSE.
2024-10-08 06:52:51 +02:00
Tim Ledbetter
fd8d350b47 LibWeb: Don't discard PostedMessage tasks when closing a worker
The spec expects `postMessage()` to act as if it is invoked
immediately. Since `postMessage()` isn't actually invoked immediately,
keep tasks with source `PostedMessage` in the task queue, so that these
tasks are processed. Fixes a hang when `WorkerGlobalScope.close()` is
called immediately after `postMessage()`.
2024-10-08 06:51:04 +02:00
Noah Bright
d30ae92b82 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 :/
2024-10-08 03:44:55 +02:00
Timothy Flynn
be9071834e LibWeb: Wait for the iframe load before completing the beforeunload test
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
This test caused some flakiness due to the about:blank load it triggers.
It causes headless-browser to receive a load event for about:blank. If
we have moved onto the next test before that event arrived, that test
would ultimately time out, as its own load will have been dropped while
the about:blank load is still ongoing.

This patch makes us wait for that iframe load event before completing
the test.

We may want to consider never sending subframe load events to the UI
process as well. We really only care about top-level page loads in the
receivers of that event.
2024-10-07 16:03:42 -04:00
Tim Ledbetter
d0008ae5e0 LibWeb: Don't print messages from workers to the console twice
Previously, any message logged to the console within a worker with a
log level greater than trace was printed twice.
2024-10-07 21:22:12 +02:00
Timothy Flynn
598fabbdd3 LibWebView: Increase the open file limit in a more central location
We don't create a ChromeProcess in headless-browser, so it is currently
not increasing it's open file limit. This is causing crashes on macOS,
which has a very low default limit.
2024-10-07 14:03:03 -04:00
Ali Mohammad Pur
cb4b2ca681 Meta: Avoid messing with the system python in CI
This uses the setup-python action in the setup action to install python
3.12, and removes the --break-system-packages hack that the system pip
requires.
2024-10-07 11:45:21 -06:00
Aliaksandr Kalenik
97066f09f4 LibWeb: Use PaintableBox::is_scrollable() while dispatching wheel event
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
With this change we use the same function to determine whether to render
scroll thumb and whether box wants to accept scroll UI events.
2024-10-07 18:35:24 +02:00
Aliaksandr Kalenik
a46c2a0887 LibWeb: Forbid scrolling of viewport if overflow=hidden
Before this change viewport was allowed to be scrolled whenever it has a
scrollable overflow, which is not correct when overflow is specified to
be hidden.
2024-10-07 18:35:24 +02:00
Khaled Lakehal
77761e123d LibWeb/CSS: Add support for unicode-bidi property 2024-10-07 14:57:15 +01:00
Gingeh
16f2f6aa42 LibWeb: Make empty media query lists evaluate to true 2024-10-07 14:50:57 +01:00
Shannon Booth
30377e6e35 LibWeb: Do not spin the event loop on processing iframe attributes
Partially reverting a3149c1ce9

Spinning the event loop was causing a crash on:

https://wpt.live/url/percent-encoding.window.html

As it was turning what is meant to be a synchronous operation into an
asynchronous one.

The sequence demonstrated by the reproducing test is as follows:
  * A src attribute is changed for the iframe
  * process_the_iframe_attributes entered with valid content navigable
  * Event loop is spun, allowing the queued iframe removal to execute
  * process_the_iframe_attributes continues with null content navigable
  * 💥
2024-10-07 15:10:41 +02:00
Timothy Flynn
62e732e5ad Revert "WebContent+WebDriver: Inform WebDriver when a window is closed"
This reverts commit 556a0936dd.

This was causing a large slow down in WPT, and a crash on macOS during
session shutdown when running WebDriver manually.
2024-10-07 07:40:22 -04:00
Carwyn Nelson
30f59cfe1a LibWeb: Skip transitions for pseudo elements
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
Transitions are currently not implemented for pseudo elements which
causes the transition to be applied to the "real"/"parent" element. When
a transition adjusts width/height on a pseudo element this causes the
real elements layout to break.

As a quick fix we just skip doing transitions when they are against
pseudo elements.
2024-10-07 09:31:40 +02:00
Andreas Kling
2fdf2b9215 LibWeb: Allow SVG root elements to have visible overflow
We were overly aggressive in clipping SVG roots, which effectively made
them behave as if they always had `overflow: hidden`.

This fixes incorrect clipping of the logo on https://basecamp.com/
2024-10-07 09:31:25 +02:00
Shannon Booth
f2134dc1e9 LibWeb: Throw exception for invalid URL before creating traversable
Which fixes the following WPT test from failing due to issues stemming
from all of the windows which have been opened.

https://wpt.live/url/failure.html

This will give us 1205 new subtests passing in WPT.
2024-10-06 22:54:27 -06:00
Neil Viloria
1e29a3ae13 Documentation: Update command for regenerating test expectations 2024-10-06 22:48:13 -06:00
Timothy Flynn
dfabdb7fed headless-browser: Support running LibWeb tests concurrently
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
We currently create a single WebView and run all 1400+ LibWeb tests in
serial over that WebView. Instead, let's create as many WebViews as
there are processes on the system, and run LibWeb tests concurrently
over those views.

To do this performantly requires that we never block the main thread of
the headless-browser process once the tests are running. Doing so will
effectively pause execution of all other tests. So test execution is now
Promise-based.

On my machine (with a hardware concurrency of 32), this reduces the run
time of LibWeb tests from 31.382s to 3.640s. CPU utilization increases
from 5% to 67%.
2024-10-06 19:24:25 +02:00
Timothy Flynn
49a53a6194 headless-browser: Move completion handlers for dump/ref tests to lambdas
No functional difference here, and this probably seems a bit silly, but
the purpose is to make the diff of a future patch much easier to read.
2024-10-06 19:24:25 +02:00
Timothy Flynn
08426efebc headless-browser: Define the test-related structures earlier
And re-order the Test fields to have the test mode first.

No functional change - this is just to reduce diff noise a bit in an
upcoming patch.
2024-10-06 19:24:25 +02:00
Timothy Flynn
e6975ec76a headless-browser: Make taking screenshots during tests more asynchronous
This will be necessary to run tests concurrently, otherwise taking a
screenshot for one test will block all tests from executing.
2024-10-06 19:24:25 +02:00
Timothy Flynn
642a611418 headless-browser: Do not track the current test path
Instead, just log the view's current URL when the WebView crashes. It
won't make any sense to track the executing test this way once there are
many tests running concurrently.
2024-10-06 19:24:25 +02:00
Timothy Flynn
adfe120d1e headless-browser: Migrate service management to the browser Application
We currently run all tests in a single WebView instance. That instance
owns the process-wide RequestClient / ImageDecoderClient, so if we were
to create a second instance, we'd run into trouble.

This migrates ownership of these services to the Application class, and
makes the Application own the WebView. In the future, this will let the
Application own a list of views.
2024-10-06 19:24:25 +02:00
Timothy Flynn
377d1f22ae headless-browser: Make the browser Application more accessible
We currently pass around the individual fields of the Application class
to a bunch of free functions. This makes adding a new field, and passing
it all the way to e.g. run_dump_test pretty annoying, as we have to go
through about 5 function calls.

This will get much worse in an upcoming patch to run LibWeb tests
concurrently. There, we will have to further pass these flags around as
async lambda value captures.

To make this nicer, just access the flags from Application::the(), which
is how the "real" UIs access their application objects as well.
2024-10-06 19:24:25 +02:00
Timothy Flynn
b1718f5691 LibWeb: Disable remaining Worker tests for now
These time out on macOS CI.
2024-10-06 19:24:25 +02:00
Aliaksandr Kalenik
d0463bf652 LibWeb: Simplify static position calculation for block-level boxes
There is no need to save vertical offset in UsedValues to use later,
when static position could be assigned directly upon encountering
abspos box.
2024-10-06 18:51:16 +02:00
Aliaksandr Kalenik
7225087fa2 LibWeb: Replaced remaining usage and delete Size::resolved() 2024-10-06 18:51:03 +02:00
Timothy Flynn
76152845fd LibWeb: Remove debug spam from Navigator methods
These are logged ~1000 times on fast.com.
2024-10-06 18:50:44 +02:00
Aliaksandr Kalenik
908455ab06 LibWeb: Skip queuing a rendering task if task queue already contains it
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, 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
If, by the time we need to schedule rendering of the next frame, the
previous one is still not processed, we could skip it instead of growing
task queue.

Should help with https://github.com/LadybirdBrowser/ladybird/issues/1647
2024-10-06 16:25:33 +02:00
Shannon Booth
ea971792b5 LibWeb: Throw a SyntaxError on invalid URL for Location href setter
Aligning with a spec update, fixing 195 tests for:

https://wpt.live/url/failure.html
2024-10-06 10:06:26 -04:00