Commit graph

838 commits

Author SHA1 Message Date
Timothy Flynn b5d80013ea Ladybird/Qt: Add tooltips to the find-in-page widget 2024-05-31 06:30:39 -04:00
Andrew Kaster c4f2ff44a5 Ladybird: Respect window.open() features in Qt chrome 2024-05-30 16:16:33 -04:00
Tim Ledbetter 389a55fe36 Ladybird/Qt: Add a find in page widget 2024-05-30 16:30:11 +02:00
Jamie Mansfield b08d43a5d3 Ladybird/Qt: Calculate the 'physical pixels' for screens
This fixes a regression introduced by GH-23855 in [1], and re-applies
a previous change I made [2].

[1] https://github.com/SerenityOS/serenity/commit/dfc7534
[2] https://github.com/SerenityOS/serenity/commit/b7bd3fd
2024-05-30 07:09:03 +01:00
MacDue b3f63f35e5 Ladybird: Add --force-new-process option
This option skips attempting any chrome IPC which even with the
`--new-window` does not open a new browser process. This is annoying
when trying to compare browser options as opening a new window with
the currently running chrome ignores any options passed to the new
ladybird invocation.
2024-05-29 08:17:01 +02:00
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
Shannon Booth cb9e0c4e64 Ladybird/Qt: Wire up screen added and removed events 2024-05-27 17:24:51 -06:00
Shannon Booth dfc7534eef Ladybird/Qt: Factor out a method to update the screen rects 2024-05-27 17:24:51 -06:00
Timothy Flynn 168d28c15f LibProtocol+Userland: Support unbuffered protocol requests
LibWeb will need to use unbuffered requests to support server-sent
events. Connection for such events remain open and the remote end sends
data as HTTP bodies at its leisure. The browser needs to be able to
handle this data as it arrives, as the request essentially never
finishes.

To support this, this make Protocol::Request operate in one of two
modes: buffered or unbuffered. The existing mechanism for setting up a
buffered request was a bit awkward; you had to set specific callbacks,
but be sure not to set some others, and then set a flag. The new
mechanism is to set the mode and the callbacks that the mode needs in
one API.
2024-05-26 18:29:24 +02:00
Timothy Flynn 086ddd481d Ladybird+LibWeb: Move User-Agent definitions to their own file
This is to avoid including any LibProtocol header in Objective-C source
files, which will cause a conflict between the Protocol namespace and a
@Protocol interface.

See Ladybird/AppKit/Application/ApplicationBridge.cpp for why this
conflict unfortunately cannot be worked around.
2024-05-26 18:29:24 +02:00
Ali Mohammad Pur 57714fbb38 RequestServer: Handle IPC requests on multiple threads concurrently
Previously RS handled all the requests in an event loop, leading to
issues with connections being started in the middle of other connections
being started (and potentially blowing up the stack), ultimately causing
requests to be delayed because of other requests.
This commit reworks the way we handle these (specifically starting
connections) by first serialising the requests, and then performing them
in multiple threads concurrently; which yields a significant loading
performance and reliability increase.
2024-05-20 08:03:35 +02:00
MacDue 563d392db7 Ladybird: Ensure hamburger menu is placed within the browser window 2024-05-08 10:39:46 +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
MacDue 5bb37caf9e Ladybird: Add the "Debug" category back to the menubar
This was accidentally removed in 5da9af4.
2024-05-06 13:42:43 -04: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
MacDue b562c9759d Ladybird: Remove menu indicator on hamburger icon 2024-05-06 09:11:12 -04:00
Jamie Mansfield 5da9af435e Ladybird/Qt: Introduce a hamburger menu and use by default
There is an option to show the menubar, if desired (similar to KDE
software).
2024-05-06 08:24:56 -04:00
Jamie Mansfield d9f8203021 Ladybird/Qt: Move "About Ladybird" action to Help menu 2024-05-06 08:24:56 -04:00
Timothy Flynn 398ae75f9a Ladybird+LibWebView: Introduce a cache for cookies backed by SQL storage
Now that the chrome process is a singleton on all platforms, we can
safely add a cache to the CookieJar to greatly speed up access. The way
this works is we read all cookies upfront from the database. As cookies
are updated by the web, we store a list of "dirty" cookies that need to
be flushed to the database. We do that synchronization every 30 seconds
and at shutdown.

There's plenty of room for improvement here, some of which is marked
with FIXMEs in the CookieJar.

Before these changes, in a SQL database populated with 300 cookies,
browsing to https://twinings.co.uk/ WebContent spent:

    19,806ms waiting for a get-cookie response
    505ms waiting for a set-cookie response

With these changes, it spends:

    24ms waiting for a get-cookie response
    15ms waiting for a set-cookie response
2024-05-01 07:06:26 +02:00
Andrew Kaster 37a0466285 CMake: Resolve FIXMEs related to CMake < 3.20
We already have required this version for quite a while for Lagom,
Ladybird and Serenity. Now that we require it in all of our CMakeLists,
let's scrub for better ways of writing things.
2024-04-30 07:14:17 -06:00
Andrew Kaster effd368b5b CMake: Remove redundant configuration options from Ladybird CMakeLists
These options are already specified in common_compile_options.cmake and
lagom_install_options.cmake
2024-04-30 07:14:17 -06:00
Timothy Flynn 1a1191cc6e Ladybird/AppKit: Add support for a singleton chrome process 2024-04-30 06:02:15 -06:00
Timothy Flynn bfb356fd6c Ladybird/AppKit: Track the currently active tab
Will be needed to open new tabs from other Ladybird processes from the
active tab.
2024-04-30 06:02:15 -06:00
Timothy Flynn 7ad7ec3c0c Ladybird/AppKit: Bring newly active windows/tabs to the front
This actually actives the underlying tab if needed. This wasn't an issue
previously, as new tabs were always created in already active windows.
But when new windows/tabs are requested from new Ladybird processes, we
need to actually activate those tabs.
2024-04-30 06:02:15 -06:00
Timothy Flynn 606df46e46 Ladybird/AppKit: Retrieve socket notifiers from the local thread data
For some reason, we occasionally receive a junk `info` pointer from the
CFSocketCallback we create for socket notifiers. Instead of capturing a
pointer to the local Core::Notifier for this `info` member, grab it from
the thread data instance based on the socket FD.

This was mostly seen when spamming new window requests to an existing
Ladybird process.
2024-04-30 06:02:15 -06:00
Timothy Flynn 478ceb71ec Ladybird/AppKit: Ensure LibCore events are processed
When we receive a LibCore event, we post an "application defined" Cocoa
event to the NSApp. However, we are currently only processing these from
`pump`, which is only invoked manually.

Instead, we should listen for the event that we've posted and process
the event queue at that time. This is much closer to how Qt's event loop
behaves as well with EventLoopImplementationQtEventTarget.
2024-04-30 06:02:15 -06:00
Jamie Mansfield 17fc995ee4 Ladybird: Add a context menu to the tab bar
This shows the following actions:

* Reload Tab
* Duplicate Tab
* Move Tab
  * Move to Start
  * Move to End
* Close Tab
* Close Other Tabs
  * Close Tabs to Left
  * Close Tabs to Right
  * Close Other Tabs
2024-04-29 08:11:21 +02:00
Jamie Mansfield 56ed3d5e21 Ladybird: Increase minimum tab width to 128
This is double what the previous minimum is, and is more helpful when
lots of tabs are open.
2024-04-29 08:11:21 +02:00
Andrew Kaster 6b5deb2259 Ladybird: Support multiple browser windows in Qt chrome
This also moves the ownership of the TaskManger to the Application.
2024-04-27 20:32:12 -04:00
Andrew Kaster 2bb0f65309 Ladybird: Add singleton process logic for Qt chrome
This only adds the new tab behavior, as handling multiple windows in
the same process needs some extra help.
2024-04-27 20:32:12 -04:00
Jamie Mansfield c2829ce2a0 Ladybird: Retreive the tab title from the underlying Tab
Rather than getting the tab name from the tab container. This resolves
an issue where ampersands were being introduced to the window title
when changing tabs.
2024-04-27 13:39:47 -04:00
Timothy Flynn 56e0cd0b1a Ladybird: Restore ability to run WebContent under callgrind
This broke due to the way we now use posix_spawn under the hood. This
moves the handling of the callgrind option to the launcher helper where
we iterate over the candidate process paths, as we need to augment the
way we fork the process for callgrind based on those paths.

This also opens the door for running other processes under callgrind in
the future.
2024-04-27 15:17:31 +02:00
Timothy Flynn 8588008d42 Ladybird: Use RequestServer for networking by default
This really only affects headless-browser when it is linked with Qt. In
that case, it currently uses Qt networking by default and does not have
a flag to use RequestServer instead. Change the default to use RS so it
can undergo sanitized testing in CI.
2024-04-26 09:48:20 +02:00
Andrew Kaster ce9eed918f ImageDecoder: Schedule decode jobs on the LibThreading background thread
This allows the ImageDecoder service to handle new IPC requests while
decoding in parallel.
2024-04-26 09:41:24 +02:00
Timothy Flynn c11019ebc1 Ladybird: Use Core::Process facilities to spawn singleton processes 2024-04-24 15:51:58 -06:00
Timothy Flynn 9fb84e4693 Ladybird: Use Core::Process facilities to spawn helper processes
Note that WebContent now also uses launch_generic_server_process()
instead of its own implementation.
2024-04-24 15:51:58 -06:00
Timothy Flynn ec492a1a08 Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-18 -i $(find . \
        -not \( -path "./\.*" -prune \) \
        -not \( -path "./Base/*" -prune \) \
        -not \( -path "./Build/*" -prune \) \
        -not \( -path "./Toolchain/*" -prune \) \
        -not \( -path "./Ports/*" -prune \) \
        -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")

There are a couple of weird cases where clang-format now thinks that a
pointer access in an initializer list, e.g. `m_member(ptr->foo)`, is a
lambda return statement, and it puts spaces around the `->`.
2024-04-24 16:50:01 -04:00
Andrew Kaster 39dfb659cf LibWeb+WebContent: Convert ImageCodecPlugin to use the promise-based API 2024-04-23 12:32:04 -06:00
Andrew Kaster 28fcf64835 Documentation: Update Ladybird README with more descriptive information 2024-04-23 11:24:14 -06:00
Jamie Mansfield b7bd3fd920 Ladybird: Calculate the 'physical pixels' for screens
Previously the 'device independent pixels' (which consider scaling)
were used, and then scaling would be applied again when calculating the
screen width for CSS.
2024-04-23 16:25:20 +02:00
Timothy Flynn 771054bff7 Ladybird: Slightly increase the size of the Task Manager window
This adds a bit more room to see most titles on one line.
2024-04-22 14:46:10 -06:00
Timothy Flynn d2bd692bbe Ladybird: Register RequestServer with the chrome's mach server on macOS
This ensures we register RequestServer with the appropriate mach server
name.
2024-04-22 14:46:10 -06:00
Timothy Flynn b83babdf8b Ladybird: Register SQLServer with the task manager 2024-04-22 14:46:10 -06:00
Timothy Flynn 278fc8e57f Ladybird: Return a reference to the mach server name
Rather than a copy, return a reference so that it's a bit safer to use
the result as a StringView within the calling scope.
2024-04-22 14:46:10 -06: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