Commit Graph

96 Commits

Author SHA1 Message Date
MacDue
9c711bc868 LibWeb+Ladybird: Add option to enable the AffineCommandExecutorCPU
This adds a `--experimental-cpu-transforms` option to Ladybird and
WebContent (which defaults to false/off).

When enabled the AffineCommandExecutorCPU will be used to handle
painting transformed stacking contexts (i.e. stacking contexts where
the transform is something other than a simple translation). The regular
command executor will still handle the non-transformed cases.

This is hidden under a flag as the `AffineCommandExecutorCPU` is very
incomplete now. It missing support for clipping, text, and other basic
commands. Once most common commands have been implemented this flag
will be removed.
2024-05-29 08:17:01 +02:00
Timothy Flynn
f16f89eb32 Ladybird+LibWebView: Move SQLServer launcher to Ladybird
It previously resided in LibWebView to hide the details of launching a
singleton process. That functionality now lives in LibCore. By moving
this to Ladybird, we will be able to register the process with the task
manager.
2024-04-22 14:46:10 -06:00
Timothy Flynn
5dd3b91f0e LibCore+LibWebView: Move process statistics to LibCore
This will be needed to collect statistics from processes that do not
have anything to do with LibWebView. The ProcessInfo structure must be
virtual to allow callers to add application-specific information.
2024-04-22 14:46:10 -06:00
Shannon Booth
5bf34ecc32 Ladybird: Add an option to enable internals object outside of test mode
Sometimes I like to play around with running Ladybird tests using full
blown Ladybird instead of just headless browser to interactively mess
around with the test page. One problem with this is that the internals
object is not exposed in this mode.

This commit supports this usecase by adding an option to specifically
expose the internals object without needing to run headless-browser
in test mode.
2024-04-22 08:10:08 +02:00
Shannon Booth
1ec6399c00 Everywhere: Remove uneeded short option argument where possible 2024-04-22 08:10:08 +02:00
Andrew Kaster
5e1d678bae Ladybird+Userland: Remove use of unnecessary fd passing socket concept
Now that LibIPC is using SCM_RIGHTS properly, we can go back to only
having one socket laying around when needing to transfer fds to peers.
2024-04-19 16:38:55 -04:00
Andrew Kaster
c87e32154a Ladybird+headless-browser: Make RequestServer single instance on Lagom
Co-Authored-By: Timothy Flynn <trflynn89@pm.me>
2024-04-17 10:09:49 -04:00
Andreas Kling
f4f4f7781d Ladybird+LibWeb: Add optional IDL call tracing
When launched with the new --enable-idl-tracing option, we now log
every call to web platform APIs declared via IDL, along with the
arguments passed.

This can be very helpful when trying to figure out what a site is
doing, especially if it's not doing what you'd expect.
2024-04-16 16:57:06 +02:00
Andreas Kling
5f9a905793 Ladybird+LibJS: Add optional logging of *all* JS exceptions
When running with --log-all-js-exceptions, we will print the message
and backtrace for every single JS exception that is thrown, not just
the ones nobody caught.

This can sometimes be very helpful in debugging sites that swallow
important exceptions.
2024-04-16 16:57:06 +02:00
Andrew Kaster
3b5ac433ef Ladybird: Use MachPortServer to get WebContent Mach ports on macOS 2024-04-09 16:43:27 -06:00
Shannon Booth
e800605ad3 AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
2024-03-18 14:06:28 -04:00
Andrew Kaster
096ddb0021 Ladybird: Include Userland/ in for Applications that use LibWeb
After ea682207d0, we need Userland/
included directly in these application executables. This only impacts
the build with Ladybird/CMakeLists.txt as the top level CMakeLists, as
the Lagom/ directory includes Userland/ globally.
2024-03-06 19:50:00 -05:00
Ali Mohammad Pur
6dfb2f9dc8 Everywhere: Merge the WebSocket service into RequestServer
This keeps the APIs separate as they are wildly different, a future
improvement could be to somehow unify the APIs (if possible).

Closes #23080.
2024-03-06 10:07:27 +01:00
Filiph Siitam Sandström
fd694e8672 AK+Lagom: Make it possible to build for iOS
This commit makes it possible to build AK and most of Lagom for iOS,
based on the work for the Ladybird build demoed on discord:
https://discord.com/channels/830522505605283862/830525031720943627/1211987732646068314
2024-03-03 13:13:42 -07:00
Andrew Kaster
68402bec12 Ladybird: Remove $SERENITY_SOURCE_DIR from resource root candidates
Now we will only load resources from $build/share/Lagom. On macOS, we
load from the bundle directory Contents/Resources instead. This
simplifies the commands and environment variables needed to execute
Ladybird from the build directory, and makes our install setup less
awkward for distributions and packagers.
2024-02-26 13:16:27 -07:00
Andrew Kaster
bb9da0ed8d Ladybird: Plumb overriding root certificate paths through the chromes 2024-02-08 08:49:32 -07:00
Bastiaan van der Plaat
dc2233ef7a Ladybird+WebContent: Add chrome command line and exe path passing 2024-01-17 17:32:05 +01:00
Bastiaan van der Plaat
009729d5e3 LibWeb: Use resources to find internal HTML template paths 2023-12-27 10:54:07 -05:00
Bastiaan van der Plaat
b39d99cf2f LibWeb: Use resource scheme for icons in internal pages 2023-12-27 10:54:07 -05:00
Andrew Kaster
1e68e484cc Ladybird: Add command line flag to wait for debugger in WebContent 2023-12-21 19:03:40 +01:00
Ali Mohammad Pur
5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Andrew Kaster
57a04c536c Ladybird: Enable rich debug messages on all processes
Android is excluded from this patch because the Android dbgln routes
messages to the NDK logger, which already includes process and time
information.
2023-12-12 10:11:24 -07:00
Timothy Flynn
05c8d5ba57 Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to
Ladybird, but are scattered across a couple of subfolders in Base. This
moves them all to Base/res/ladybird.
2023-12-04 19:46:35 -05:00
Andrew Kaster
fbfb70f81a LibWeb+WebContent: Plumb ability for WebContent process to hold N pages
In order for same-origin NavigableContainers (iframe, frame, embed, ...)
and window.open() WindowProxies to have the proper JS access to their
embedder/opener, we need to host multiple top level traversables in the
same WebContent process. As a first step, make WebContent::PageHost hold
a HashMap of PageClient objects, each holding their own Web::Page that
represents a TraversableNavigable's API surface with the UI process.
2023-12-01 20:47:44 +01:00
Timothy Flynn
bbdd624d50 Ladybird: Do not require Qt6 Multimedia if PulseAudio is available
If PulseAudio is available, the Qt6 audio plugin will never be used. So
let's remove it from the build.

Note that on macOS, the Qt6 audio plugin will be used if the Qt chrome
is enabled. Otherwise, Audio Unit will be used for the AppKit chrome.
2023-11-04 08:36:34 -04:00
Andrew Kaster
c990db0913 Ladybird/Android: Create a service for ImageDecoder
This follows the pattern for the other services spawned by WebContent.
The notable quirk about this service is that it's actually spawned by
the ImageCodecPlugin rather than in main.cpp in the non-Android port.

As a result we needed to do some ifdef surgery to get all the pieces
in place. But we can now load images in the Android port again :^).
2023-11-01 14:30:30 -06:00
Andrew Kaster
40363f54d8 WebContent: Use the accelerated_graphics CMake helper
Instead of relying on AK_OS_LINUX, actually use the more accurate
HAS_ACCELERATED_GRAPHICS define to figure out if we should try to use
the generic LibAccelGfx GPU painter.
2023-11-01 14:30:30 -06:00
Aliaksandr Kalenik
b6732b0234 Ladybird+WebContent: Add option to use GPU painter
Adds `--enable-gpu-painting` param to enable painting command executor
that uses LibAccelGfx.
2023-10-29 17:13:23 +01:00
Lucas CHOLLET
5c7e5cc738 Ladybird: Decode images out of process
This patch brings a service to handle image decompression. With it comes
security enhancement due to the process boundary. Indeed, consequences
of a potential attack is reduced as only the decoder will crash without
perturbing the WebContent process.
It also allows us to display pages containing images that we claim to
support but still make us crash, like for not-finished-yet decoders.

As an example, we can now load https://jpegxl.info/jxl-art.html without
crashing the WebContent process.
2023-10-27 07:26:32 +02:00
Andrew Kaster
4fd915b005 Ladybird/Android: Add EditText for URL bar and attach to native WebView 2023-09-29 15:58:55 -06:00
Bastiaan van der Plaat
04ee15a5ad Ladybird+LibWeb: Use old error.html template for navigation errors again 2023-09-24 19:59:00 -06:00
Bastiaan van der Plaat
8f2319e966 Ladybird+LibWeb: Rename FileDirectoryLoader to GeneratedPagesLoader 2023-09-24 19:59:00 -06:00
Andreas Kling
51caa14381 LibWeb: Remove FrameLoader
This class is no longer used, now that we've moved to navigables.
2023-09-20 18:29:17 +02:00
Andrew Kaster
a243bc465f Ladybird/Android: Bind a RequestServerService for networking needs
Add a RequestServerService class that uses the LadybirdServiceBase class
added previously. Bind to it from the WebContentService's service_main()
during startup.
2023-09-17 19:22:29 -06:00
Andrew Kaster
da8f450335 Ladybird/Android: Move common service functionality to a base class
Create LadybirdServiceBase to hold the standard "set resource dir" and
"init ipc sockets" service functionality that will be common between the
WebContent, RequestServer, and WebSocket services.

Refactor the handler class slightly to avoid the HandlerLeak lint by
making the class a static class inside the companion object and use a
WeakReference to the service instead of a strong one.
2023-09-17 19:22:29 -06:00
Andrew Kaster
315ad2d391 Ladybird/Android: Move JNI functions into their own files
This should be easier to work on, and keeps the layers of the native
code nice and clean cut.
2023-09-17 19:22:29 -06:00
Andrew Kaster
d93911928b Ladybird/Android: Add EventLoopImplementation for ALooper
Timers run in their own thread, to take advantage of existing Java
Executor features. By hooking into ALooper, we can spin the main
Activity's UI thread event loop without causing a fuss, or spinning the
CPU by just polling our event loop constantly.
2023-09-13 15:00:56 -06:00
Timothy Flynn
2eb9f3f639 Ladybird: Install the Audio Unit plugin on macOS 2023-09-09 13:03:36 -04:00
Andrew Kaster
6952de73dc Ladybird: Add WebContentService for Android port
This will let us spawn a new process for an Android Service to handle
all our WebContent needs. The ServiceConnection is manged by each
WebView. The lifecycle of the Service is not quite clear yet, but each
bindService call will get a unique Messenger that can be used to
transfer the WebContent side of the LibIPC socketpair we use in other
ports.
2023-09-09 10:53:30 -06:00
Andrew Kaster
7bc009d80f Ladybird: Add new template Kotlin Android application without Qt
This template app from Android Studio should hopefully be more fun to
work on than the Qt wrapped application we were using before. :^)

It currently builds the native code using gradle rules, and has a stub
WebViewImplementationNative class that will wrap a c++ class of the same
name that inhertis from WebView::ViewImplementation. Spawning helper
processes and creating proper views in Kotlin is next on the list.
2023-09-03 11:38:51 +02:00
Timothy Flynn
2418a033d4 Ladbird: Remove LibSQL dependency from Ladybird's WebContent
It is not used in WebContent or any of its dependencies.
2023-08-31 19:19:45 +02:00
Bastiaan van der Plaat
eafdb06d87 LibWeb: Add directory entries page when visiting a local directory 2023-08-15 10:41:54 +01:00
Bastiaan van der Plaat
e4c3a52cfa LibWeb: Add resource_directory_url for internal HTML pages
The error.html page now uses the resource_directory_url this
variable contains the relative path to /Base/res/ on the host
system as a file:// url. This is needed for future pages to load
resource files like icons. For the error.html page this was not
really needed because it lies over this own URL in FrameLoader.cpp.
2023-08-15 10:41:54 +01:00
Timothy Flynn
553d35e503 Ladybird: Create a runtime error for unknown audio codec plugins
This will allow us to bring the WebContent process into non-Qt macOS
chromes. This branch is only reached when creating an <audio> element,
so while the chrome is heavily under development, we can just avoid
these elements.
2023-08-14 13:36:00 -06:00
Andrew Kaster
2299fe1481 Ladybird: Install headers for WebContent when used externally 2023-08-11 20:09:20 -06:00
Andrew Kaster
e28d883f8d Ladybird: Link libraries to WebContent impl lib to add dependencies 2023-08-11 19:26:21 -06:00
Andrew Kaster
88082bfada Ladybird: Install an impl library for WebContent when ENABLE_QT=OFF
This should allow out of tree chromes to prototype other LibWeb platform
plugins easier when using Lagom as a find_package dependency.
2023-08-11 19:07:45 -06:00
Andrew Kaster
79108f615d Ladybird: Add configuration option to build without Qt
This should open the door for adding more GUI chromes to the repository
2023-08-10 20:10:05 -06:00
Andreas Kling
99ac34eeae Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andrew Kaster
391beef707 Ladybird: Move Qt-specific classes and functions to a Qt subdirectory
This will help a lot with developing chromes for different UI frameworks
where we can see which helper classes and processes are really using Qt
vs just using it to get at helper data.

As a bonus, remove Qt dependency from WebDriver.
2023-08-07 14:58:04 -06:00