Commit Graph

44 Commits

Author SHA1 Message Date
Andrew Kaster
47d6a263d8 CMake: Move ladybird target creation to UI-specific CMakeLists 2024-06-05 13:56:46 -04:00
Andreas Kling
f2fd8fc928 Everywhere: Remove LibGemini
This hasn't been maintained (or worked at all) for a long time,
and it's not a widely supported protocol, so let's drop it.
2024-06-04 09:19:39 +02:00
Andrew Kaster
77e890b15e Meta+Documentation+Ports: Move from C++20 to C++23
Now that oss-fuzz is on a clang commit > the 17.x release candidates,
we can start looking at some shiny new features to enable.
2024-05-06 11:46:28 -06:00
Andrew Kaster
68ec099b66 Ladybird: Update Android build to work with current LibWebView/LibCore
Also update to the latest gradle plugin versions and other dependencies
as recommended by Android Studio Jellyfish.
2024-05-06 09:31:32 -06: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
Andrew Kaster
4dd2ec68fc RequestServer: Transfer ownership of Protocols to all_protocols map
It's no change in application behavior to have these objects owned by
the function-scope static map in Protocol.cpp, while allowing us to
remove some ugly FIXMEs from time immemorial.
2024-03-06 08:15:03 +00: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
Shannon Booth
9ce8189f21 Everywhere: Use unqualified AK::URL
Now possible in LibWeb now that there is no longer a Web::URL.
2024-02-25 08:54:31 +01:00
Andrew Kaster
080aa567a5 RequestServer+LibTLS: Allow applications to specify multiple root certs 2024-02-08 08:49:32 -07: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
Aliaksandr Kalenik
02936f6944 LibWebView+WebContent: Drive repainting from WebContent process
With this change, chrome no longer has to ask the WebContent process
to paint the next frame into a specified bitmap. Instead, it allocates
bitmaps and sends them to WebContent, which then lets chrome know when
the painting is done.

This work is a preparation to move the execution of painting commands
into a separate thread. Now, it is much easier to start working on the
next frame while the current one is still rendering. This is because
WebContent does not have to inform chrome that the current frame is
ready before it can request the next frame.

Additionally, as a side bonus, we can now eliminate the
did_invalidate_content_rect and did_change_selection IPC calls. These
were used solely for the purpose of informing chrome that it needed to
request a repaint.
2023-12-22 17:47:34 +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
Dan Klishch
d317309d89 Everywhere: Unport Core::System::current_executable_path from new string
Storing paths in AK::String is never correct.
2023-12-07 10:13:21 -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
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
a54baa2c34 Ladybird/Android: Use new capitalized name for main Ladybird shlib 2023-11-01 14:30:30 -06:00
Andrew Kaster
4956514dfb Ladybird/Android: Make bind_service helper public in WebContentService
We'll need to call this from other Ladybird files for future services.
2023-11-01 14:30:30 -06:00
Andrew Kaster
5b03135c46 Ladybird/Android: Set up a Core::Resource implementation in services
Use the File implementation until we get around to creating one that
uses AssetManager
2023-11-01 14:30:30 -06:00
Andrew Kaster
4fd915b005 Ladybird/Android: Add EditText for URL bar and attach to native WebView 2023-09-29 15:58:55 -06:00
Andrew Kaster
a93507231c Ladybird/Android: Move JavaEnvironment helper to Ladybird namespace 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
de1bcf3597 Ladybird/Android: Enable content filters and Autoplay allowlist
Copy these over from the standard main.cpp for WebContent. The ideas are
already starting to come together on how to unify these main files.
2023-09-17 19:22:29 -06:00
Andrew Kaster
27fda83dcf Ladybird/Android: Add window options to night theme
These were added to the non-night theme to accomodate our custom action
bar. Add them to the night theme to make it actually usable.
2023-09-17 19:22:29 -06:00
Andrew Kaster
642a2570a8 Ladybird/Android: Explicitly schedule Core::EventLoop in main activity
Instead of having an annoying loop that constantly reschedules a
Core::EventLoop trigger, have the ALooperEventLoopManager do it itself
in the did_post_event() function.

We cannot simply re-use the Unix implementation directly because that
implementation expects to actually be called all the time in order to
service timers. If you don't call its' pump() method, timers do not get
triggered. So, we do still need the seconary thread for Timers that was
added earlier.
2023-09-17 19:22:29 -06:00
Andrew Kaster
ff0494c63b Ladybird/Android: Bind WebSocketService for WebSocket purposes
Similar to the RequestServer, bind this from the WebContentService
implementation and have it work the same way. Deduplicate some code
while we're here.
2023-09-17 19:22:29 -06: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
78ebeb6a5a Ladybird/Android: Move gradle files to Ladybird/Android directory
And add documentation for how to use the thing
2023-09-15 14:18:52 -06:00
Andrew Kaster
ec05b4bc0a Ladybird/Android: Post timer events to the correct event loop
The FIXME at the bottom of Timer.nativeRun was on the money, and was
the cause of some leaked timers. Solve the issue by passing the
EventLoopImplementation to the JVM Timer object and retrieving it's
thread_local timer list, and posting the events to the Impl rather than
trying to invoke the receiver's timer event callback directly in
the Timer thread. Because the implementation of
ALooperEventLoopManager::did_post_event() reaches for
EventLoop::current(), we also need to make sure that the timer thread
acutally *has* an EventLoop, even if we don't expect to use it for
anything. And we need to make sure to pump it to clear out any of the
poke() invocations sending 4 bytes to the wake pipe for that thread.
2023-09-15 14:18:52 -06:00
Andrew Kaster
3c39579510 Ladybird/Android: Revive extract_tar_archive function
This function used to live in AndroidPlatform.cpp, but was removed
during the transition to the new app. We still need to extract the
assets from the tarball that CMake creates. At least, until we come
up with a generic "Resource" concept in LibCore.
2023-09-15 14:18:52 -06:00
Andrew Kaster
a58ee0ecd2 Ladybird/Android: Implement enough of WebContent to load local files
The local files can only be loaded by calling loadURL on the WebView,
but it's a start.
2023-09-15 14:18:52 -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
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
920dc1ba53 Ladybird/Android: Move host build into its own shell script
This lets us select a proper host compiler version if cc/cxx are not
suitable for building Lagom.
2023-09-08 09:01:34 -06:00
Andrew Kaster
4e9dc127ae Meta: Run Android CI via gradle wrapper instead of via CMake 2023-09-06 11:26:20 -04:00
Andrew Kaster
0a05440220 Ladybird: Target JDK 11 instead of 1.8, which was the default
Also use CMake >=3.23.0 instead of 3.27.4, which is much more reasonable
for diverse host systems.
2023-09-06 11:26:20 -04:00
Andrew Kaster
52d6c49ccc Ladybird: Add Espresso test on Android to verify we can load our views
The simple smoke test makes sure that we can boot up an android emulator
with our package in it, and that the WebView is visible on boot.

More tests to come with more features :^)
2023-09-05 19:17:48 +02:00
Andrew Kaster
f87388ff72 Ladybird: Force-add the .gitkeep file for the assets folder on Android
This folder is gitignored because we copy a generated tar file to it
during the build so that the android build tools will add it to our
APK file. However, the gitkeep was not re-added when the folder moved.
2023-09-05 19:17:48 +02:00
Andrew Kaster
1d369cb722 Ladybird: Add Android View for WebView and paint into it from bindings
This allows our WebViewImplementationNative class to paint into an
Android Bitmap class from the onDraw() view event. We also set the
viewport geometry from the view since we're setting the Kotlin Bitmap
at the same time.
2023-09-05 19:17:48 +02: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