Commit graph

1073 commits

Author SHA1 Message Date
Timothy Flynn
7bb9d0131c headless-browser: Add a flag to log the slowest 10 LibWeb tests
Useful for finding tests that take a long time to execute.

As of this commit, on macOS, we have:

Text/input/cookie.html: 1228ms
Text/input/css/transition-basics.html: 1060ms
Text/input/HTML/DedicatedWorkerGlobalScope-instanceof.html: 182ms
Text/input/WebAnimations/misc/animation-events-basic.html: 148ms
Text/input/Crypto/SubtleCrypto-deriveBits.html: 130ms
Text/input/IntersectionObserver/observe-box-inside-container-with-scrollable-overflow.html: 117ms
Text/input/navigation/attempt-navigating-object-without-a-document.html: 109ms
Text/input/css/getComputedStyle-print-all.html: 71ms
Text/input/WebAnimations/misc/animation-single-iteration-no-repeat.html: 61ms
Text/input/WebAnimations/animation-methods/updatePlaybackRate.html: 55ms

And on Linux:

Text/input/cookie.html: 1326ms
Text/input/css/transition-basics.html: 1155ms
Screenshot/text-shadow.html: 772ms
Screenshot/css-background-repeat.html: 622ms
Screenshot/object-fit-position.html: 541ms
Screenshot/css-background-position.html: 456ms
Screenshot/css-gradients.html: 451ms
Screenshot/border-radius.html: 400ms
Screenshot/svg-radialGradient.html: 398ms
Text/input/css/getComputedStyle-print-all.html: 325ms
2024-10-14 08:25:41 +02:00
thislooksfun
ef65694ac0 CMake: Fix codesigning error on Intel macOS
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-14, 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
Without this fix trying to build a Debug build on x86_64 macOS failed
with "Build/ladybird-debug/bin/Ladybird.app: code object is not signed
at all"
2024-10-12 17:01:14 -06:00
Timothy Flynn
567a6cc02d UI: Separate headless-browser into multiple files
The main goal here is to improve maintainability of headless-browser.
2024-10-11 09:09:40 +02:00
Timothy Flynn
79365c9519 UI: Migrate headless-browser to be alongside other Ladybird chromes
The headless-browser source is getting a bit unwieldy. The ordering of
class and method definitions is fragile; e.g. the application and web
view classes each require full definitions of each other. So it has
reached the point where it makes sense to give headless-browser some
better file structure.

To prepare for that, this patch simply moves its source to live along-
side the other browser chromes. This location is a bit better prepared
for creating more files, as the Utilities folder doesn't even have its
own CMakeLists.txt.
2024-10-11 09:09:40 +02:00
Timothy Flynn
4fcaeabe1a LibWeb+UI: Detect and handle left vs. right modifier keys
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-14, 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
Our handling of left vs. right modifiers keys (shift, ctrl, etc.) was
largely not to spec. This patch adds explicit UIEvents::KeyCode values
for these keys, and updates the UI to match native key events to these
keys (as best as we are able).
2024-10-09 19:10:02 +02:00
Timothy Flynn
eabd5b0f22 UI/AppKit: Send keyboard events for modifier-only key presses/releases
If the user only presses the shift key, for example, we are required to
still send that event to WebContent and generate the corresponding JS
events. Unfortunately, NSApp does not inform us of these events via the
keyDown/keyUp methods. We have to implement the flagsChanged interface,
and track for ourselves what modifier keys were pressed or released.
2024-10-09 19:10:02 +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
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
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
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
Andreas Kling
cc4b3cbacc Meta: Update my e-mail address everywhere
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
2024-10-04 13:19:50 +02:00
rmg-x
1f365ba44a UI/Qt: Simplify link context menu and update keyboard shortcuts
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
Removes the unnecessary separator, redundant open action, and changes
shortcuts to match other browsers.
2024-10-04 07:40:18 +01:00
Andrew Kaster
3ecf6de652 LibMedia+Ladybird: Use pkg_check_modules to find pulseaudio
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
2024-10-02 20:23:03 -04:00
Timothy Flynn
3393a74771 UI/Qt: Do not create signal notifiers until after an event loop exists
We are currently creating a signal socket and socket notifier before the
Qt event loop itself has been created. Thus, when we receive a signal,
we are not actually notified when we write that signal number to the
signal socket.

This was also the source of the following error message being displayed
on every launch of the browser:

    QSocketNotifier: Can only be used with threads started with QThread
2024-10-01 12:23:35 -04:00
Jelle Raaijmakers
233b4f2ca8 LibMedia+everywhere: Remove superfluous and unused audio code
We had numerous NiH-based implementations of audio formats and metadata
that we now no longer need because we either don't make use of the code,
or we replaced its implementation by FFmpeg.
2024-09-30 18:48:12 +02:00
Sam Atkins
f0dd0c5107 LibWebView+UI: Highlight CSS in the style sheet inspector
Some checks failed
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Has been cancelled
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Has been cancelled
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Has been cancelled
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Has been cancelled
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Has been cancelled
Run test262 and test-wasm / run_and_update_results (push) Has been cancelled
Lint Code / lint (push) Has been cancelled
Push notes / build (push) Has been cancelled
2024-09-30 08:53:25 +01:00
Tim Ledbetter
fbc941d4f4 WebDriver: Enable autoplay when launching Ladybird with WebDriver
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.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-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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-09-24 23:50:54 +01:00
Tim Ledbetter
63632159ce UI: Add an option to enable autoplay globally 2024-09-24 23:50:54 +01:00
Andrew Kaster
87f6c6895d CMake: Don't install fonts on Linux
On macOS, it's a bit trickier to not install them, as we're using the
MACOSX_PACKAGE_LOCATION file property to get them into the build
directory and install tree in the same way.
2024-09-23 16:39:49 -06:00
Andrew Kaster
c04f3c7748 CMake: Don't install service libraries
This pattern was in place for out of tree chromes. If needed we can add
it back, but there's no current interest in such chromes.
2024-09-23 16:39:49 -06:00
Vitaly Takmazov
2d34e797ef CMake: Fix Makefile build on case-insensitive file system
Some checks are pending
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Lint Code / lint (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
Push notes / build (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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
2024-09-23 11:43:42 -06:00
Bastiaan van der Plaat
86e372b7dd Ladybird/AppKit: Use system accent color in palette 2024-09-23 11:04:42 -04:00
rmg-x
7a2d837c8a UI/Qt: Move "Open in New Tab" to the top of the link context menu 2024-09-23 08:00:36 +01:00
Timothy Flynn
76662d2f01 LibWebView+UI: Remove history traversal WebView callbacks
Some checks are pending
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, 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-22.04, Linux, Linux-x86_64) (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
We can handle these entirely within LibWebView.
2024-09-22 14:11:18 -04:00
Timothy Flynn
9e21e44841 LibWebView+WebContent+UI: Remove cookie related WebView callbacks
There's no need for each individual chrome to implement the cookie
callbacks. We can handle these entirely within LibWebView.
2024-09-22 14:11:18 -04:00
Timothy Flynn
aef85a83bd Base: Import the Noto Emoji font for LibWeb tests only
The Noto Emoji font is licensed under the Open Font License. Let's use
it for LibWeb tests, to ensure we use the same emoji font across all
platforms.
2024-09-21 08:57:54 +02:00
ronak69
276ad23b70 UI/Qt: Do not perform search if query text is empty
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.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-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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-09-19 23:05:21 +01:00
Timothy Flynn
b688bbf26c UI/Qt: Remove unused WebContentView::dump_layout_tree 2024-09-19 18:07:17 +02:00
Andreas Kling
c2590afcf9 RequestServer: Stop using LibHTTP 2024-09-19 07:37:46 +02:00
Andreas Kling
6d91c42214 RequestServer: Remove "dump connection info" mechanism and UI
This is not relevant anymore when we use CURL.
2024-09-19 07:37:46 +02:00
Andreas Kling
e483bb70f0 RequestServer: Use libcurl for HTTP and HTTPS downloads
This replaces the use of our home-grown implementations inherited
from SerenityOS.
2024-09-19 07:37:46 +02:00
PiyushXCoder
9b79081a06 UI/Qt: Don't allow tabs to be dragged past the new tab button
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.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-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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, if would a tab it will pass the add new tab button
(+ button).

closes #1124
2024-09-18 17:53:09 +01:00
Timothy Flynn
27776c8854 UI/AppKit: Implement opening child web views from e.g. window.open
Some checks are pending
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-22.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-22.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-22.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 has been implemented in Qt for quite some time. This patch adds the
same feature to AppKit. This is needed to run many WPT subtests with the
AppKit chrome. This is also needed to handle window.open, target=_blank
link clicks, etc.
2024-09-18 10:09:49 +02:00
Timothy Flynn
e6965b11e4 UI/AppKit: Do not open child web views with an about:blank URL
This is overriding the URL passed to e.g. window.open and link clicks on
an <a target=_blank> element.

Note: This alone is not enough to support such use cases. We will also
need to actually implement opening child web views. But getting this fix
out of the way first makes that patch a bit simpler.
2024-09-18 10:09:49 +02:00
Jelle Raaijmakers
85fd2e281b LibMedia: Absorb LibAudio
LibMedia will be responsible for both audio and video decoding.
2024-09-12 10:01:19 +02:00
Asutosh Variar
229b64a4b7 Everywhere: Convert from_string_view -> from_string_literal where static 2024-09-11 10:59:04 +01:00
Tim Ledbetter
6c608bac65 UI/Qt: Don't change LocationEdit cursor position on right click
Previously, right clicking highlighted text in the location bar would
cause the current selection to be lost.
2024-09-10 07:39:29 +02:00
Timothy Flynn
9cd34a7d80 UI/AppKit: Re-order field designators to be in declaration order
This is required by C++, but for some reason, only started causing a
compiler error today.
2024-09-08 09:45:39 +02:00
Tim Ledbetter
7c953552b7 UI: Add the --disable-scripting option to disable scripting by default 2024-09-07 11:37:41 +02:00
Tim Ledbetter
256b56dde8 UI/AppKit: Disable popup blocking on startup if --allow-popups is set 2024-09-07 11:37:41 +02:00
Timothy Flynn
40db0848d5 UI/AppKit: Implement the Inspector's cookie context menu 2024-09-07 11:10:27 +02:00
Timothy Flynn
a011aceeba UI/Qt: Implement the Inspector's cookie context menu 2024-09-07 11:10:27 +02:00
Timothy Flynn
2c35e272ba LibWebView: Migrate the Inspector's HTML to its own HTML file
It's getting a bit unwieldy to maintain as an inlined string. Move it to
its own file so it can be edited with syntax highlighting and other IDE
features.
2024-09-07 11:10:27 +02:00
Aliaksandr Kalenik
0244859ab7 LibGfx+Ladybird: Remove unused Emoji.h and Emoji.cpp 2024-09-06 16:56:20 +02:00
Aliaksandr Kalenik
4e9d6a543a Everywhere: Remove bitmap emojis inherited from SerenityOS
These are no longer used since we switched to using the system emoji
font.
2024-09-06 08:30:30 -04:00
Aliaksandr Kalenik
22b8380e37 LibWeb: Include system emoji font in a font cascade list
Adds emoji rendering support on macOS and linux (if it has "Noto Color
Emoji" font).
2024-09-06 08:30:30 -04:00
Timothy Flynn
ed3c450359 LibWebView+UI: Move the database and cookie jar to WebView::Application
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.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-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.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-22.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
The main motivator here was noticing that --disable-sql-database did not
work with AppKit. Rather than re-implementing this there, move ownership
of these classes to WebView::Application, so that each UI does not need
to individually worry about it.
2024-09-05 19:45:47 -04:00
Aliaksandr Kalenik
99f64139d0 LibGfx+WebContent: Load resource://fonts after FontDatabase construction
This is a preparation for upcoming changes where Gfx::Typeface will
depend on `FontDatabase::should_force_fontconfig()`, so we will no
longer be able to construct typefaces from FontDatabase constructor
because of circular dependency.
2024-09-05 19:21:52 +02:00
Timothy Flynn
6a0c67d5d2 UI/AppKit: Do not expose PUA key event code points to WebContent
AppKit uses Private Use Area code points for a large collection of
functional keys (arrows, home/end, etc.). Re-assign them to 0 to avoid
tripping up WebContent's key handler.
2024-09-05 14:37:57 +01:00