Commit graph

291 commits

Author SHA1 Message Date
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
Tim Ledbetter 7c953552b7 UI: Add the --disable-scripting option to disable scripting by default 2024-09-07 11:37:41 +02:00
Timothy Flynn a011aceeba UI/Qt: Implement the Inspector's cookie context menu 2024-09-07 11:10:27 +02: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
Timothy Flynn 4147d771a6 UI/Qt: Implement download directory selection 2024-09-03 14:13:41 -04:00
Sam Atkins da171c3230 Inspector: Add a basic style sheet inspector
Choosing options from the `<select>` will load and display that style
sheet's source text, with some checks to make sure that the text that
just loaded is the one we currently want.

The UI is a little goofy when scrolling, as it uses `position: sticky`
which we don't implement yet. But that's just more motivation to
implement it! :^)
2024-09-03 10:12:07 +01:00
Sam Atkins 421fb6309f UI/Qt: Assign dropdown handler for select in WebContentView, not Tab
This makes `<select>` elements also work outside of Tab content, for
example in the Inspector.

Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
2024-09-03 10:12:07 +01:00
Timothy Flynn cbf1fd3e61 UI/Qt: Prevent division by zero in tab width calculation
On macOS, the first time TabBar::tabSizeHint is called, the count is
reportedly zero, and results in a floating point exception on x64.
2024-08-30 15:08:15 -04:00
Timothy Flynn 0464212f82 UI/Qt: Update the User-Agent to the provided UA override name 2024-08-29 13:05:47 +01:00
Jamie Mansfield b0fc8b67d6 Ladybird/Qt: Rename convert functions to reflect their new types
This is a follow up to GH-1111 to reflect the new signatures that these
functions have.
2024-08-20 21:40:36 +01:00
Sidicer c380dcf15e UI/Qt: Move cursor to the front
Fix long URLs showing the end instead of domain
2024-08-20 19:51:14 +01:00
Andreas Kling 0c7670b226 LibGfx: Rename Painter => DeprecatedPainter 2024-08-20 09:30:05 +02:00
Timothy Flynn 4833ba06ea UI/Qt: Process drag-and-drop events through the web view
This forwards all drag-and-drop events from the UI to the WebContent
process. If the page accepts the events, the UI does not handle them.
Otherwise, we will open the dropped files as file:// URLs.
2024-08-19 13:29:19 +02:00
Andrew Kaster 804729fe37 Libraries+Ladybird: Rename LibProtocol -> LibRequests
The identifier "Protocol" is claimed by Objective-C and Swift for use
by the language's built-in protocol conformance feature, which is
similar to Rust traits or Java interfaces.

Rename LibProtocol -> LibRequests, and its namespace from Protocol to
Requests to accomodate this.
2024-08-19 12:56:55 +02:00
Jelle Raaijmakers 7e57cc7b09 UI/Qt: Enable basic IME keyboard input for WebContentView
This makes dead keys work (e.g. typing ' and e results in é).
2024-08-12 17:27:29 +01:00
Jamie Mansfield df34ee058b Ladybird/Qt: Don't change to new tab with 'Open in New Tab'
It now just opens a new tab, without changing the current tab.
2024-08-12 15:25:02 +02:00
Jamie Mansfield 6133707df8 Ladybird/Qt: Display ampersands in tab titles
Qt reads ampersands as shortcut keys, so this escapes them (with &&) so
they display correctly :^)
2024-08-12 15:17:17 +02:00
Timothy Flynn 96bb8fe944 UI/Qt: Add a debug menu item to dump RequestServer connection info 2024-08-03 15:53:07 -04:00
Timothy Flynn 62fa84865d UI/Qt: Unregister WebContentView instances just once
We already unregister the view in the ViewImplementation destructor. We
do not need to do so again in the WebContentView destructor.
2024-08-03 15:53:07 -04:00
Timothy Flynn 5f8d852dae LibWebView+UI: Migrate Ladybird's command line flags to LibWebView
Currently, if we want to add a new e.g. WebContent command line option,
we have to add it to all of Qt, AppKit, and headless-browser. (Or worse,
we only add it to one of these, and we have feature disparity).

To prevent this, this moves command line flags to WebView::Application.
The flags are assigned to ChromeOptions and WebContentOptions structs.
Each chrome can still add its platform-specific options; for example,
the Qt chrome has a flag to enable Qt networking.

There should be no behavior change here, other than that AppKit will now
support command line flags that were previously only supported by Qt.
2024-08-01 11:38:42 +02:00
Sam Atkins 06484d0663 UI/Qt: Manually paint the tab-bar background where the "add" button was
The TabBar itself does not stretch the entire width of the TabWidget,
because it leaves space for the width of the new-tab button. So, we
manually tell Qt to paint the TabBar's background into the gap.

Fixes #768.
2024-07-29 12:02:02 +02:00
Sam Atkins e17362ab79 UI/Qt: Make TabWidget responsible for new-tab button positioning
Makes use of the fact that QTabWidget automatically reserves space
for "corner widgets", and gives us the ability to override their
location with a custom style.

Also, determine the height of the new-tab button using the height of the
tab bar, instead of a hard-coded 32px which was too tall on MacOS.
2024-07-29 12:02:02 +02:00
Tim Ledbetter 2d95cc01dc UI/Qt: Don't save size and location of popup windows on exit 2024-07-28 00:54:50 +01:00
Jamie Mansfield 132ab775d8 Ladybird/Qt: Add setting for preferred languages 2024-07-25 11:38:59 +01:00
Tim Ledbetter a4b289ebac UI/Qt: Don't crash when launching Inspector with Qt networking enabled 2024-07-23 14:48:56 -04:00
Timothy Flynn d58a8b5146 LibWebView+UI: Raise the chrome process open file limit
The default limit (at least on Linux) causes us to run out of file
descriptors at around 15 tabs. Increase this limit to 8k. This is a
rather arbitrary number, but matches the limit set by Chrome.
2024-07-23 09:04:42 +02:00
Jamie Mansfield 01ff3d4286 Ladybird/Qt: Add missing filters for TVG icons
Ladybird now uses the correct theme colours when hovering over icons.
2024-07-22 12:59:36 -04:00
lmutter abddd0ac1b UI/Qt: Move New Tab button in tab bar 2024-07-21 16:04:12 -06:00
circl 3adfdd3257 UI: Rename s_serenity_resource_root to s_ladybird_resource_root 2024-07-21 15:59:25 -06:00
Aliaksandr Kalenik 3627329bed Everywhere: Use Skia painter by default
Skia painter is visibly faster than LibGfx painter and has more complete
CSS transforms support. With this change:
- On Linux, it will try to use Vulkan-backend with fallback to
  CPU-backend
- On macOS it will try to use Metal-backend with fallback to
  CPU-backend
- headless-browser always runs with CPU-backend in layout mode
2024-07-21 10:36:17 +02:00
Andrew Kaster 5ace53c96f Ladybird/Qt: Prefix AK::Duration with AK Namespace 2024-07-18 09:43:38 +01:00
Daniel Bertalan c62240aa80 Everywhere: Warn on function definitions without prototypes
If no header includes the prototype of a function, then it cannot be
used from outside the translation unit it was defined in. In that case,
it should be marked as `static`, in order to avoid possible ODR
problems, unnecessary exported symbols, and allow the compiler to better
optimize those.

If this warning triggers in a function defined in a header, `inline`
needs to be added, otherwise if the header is included in more than one
TU, it will fail to link with a duplicate definition error.

The reason this diff got so big is that Lagom-only code wasn't built
with this flag even in Serenity times.
2024-07-17 21:51:29 +02:00
circl be147ae122 WebContent: Load {allow,block}lists from Ladybird's config directory 2024-07-17 09:57:46 -06:00
circl b61b1374f0 UI: Copy the default config to the user's config directory
Currently only used on the Qt chrome.
2024-07-17 09:57:46 -06:00
circl 5da1dae67e UI/Qt: Use the IniFormat for QSettings
This means that the settings will receive their own directory on all
platforms
2024-07-17 09:57:46 -06:00
Jamie Mansfield 7abf47f4bf Ladybird/Qt: Only update navigation buttons for current tab
This resolves a bug where if you opened a link in a new tab and quickly
went back to the original, the navigation buttons would update for the
new page shortly after.
2024-07-13 16:44:42 +03:00
Tim Ledbetter 11039085d0 UI/Qt: Pass WebContentOptions to TaskManagerWindow constructor
Previously, the browser would crash when opening a task manager window
with the `--enable-qt-networking` flag set because we were passing the
default WebContentOptions to the underlying WebContentView.
2024-07-10 16:29:27 +02:00
Tim Ledbetter 28b95e8ed0 WebContent+WebWorker: Use custom certificate paths with Qt networking
This change adds a `--certificate` option to both WebContent and
WebWorker, which allows one or more custom root certificate paths to be
specified. Certificates are then loaded from these paths when Qt
networking is used.

This allows WPT tests that require a https connection to be run locally
with Qt networking.
2024-07-10 16:29:27 +02:00
Jamie Mansfield fe551d3eff Base: Update to new project logo
This removes the existing 16x16 and 32x32 app icons with 48x48 and
128x128 versions, as the new logo is not well suited to such small
resolutions.
2024-07-09 11:21:07 +02:00
Tim Ledbetter 4ed46adeee UI/Qt: Set a minimum size policy for the navigation control toolbar
This prevents the user being able to shrink the window to the point
that the location bar and other controls are no longer visible.
2024-07-09 08:14:43 +02:00
Tim Ledbetter 8867146327 WebWorker: Allow the WebWorker process to optionally use Qt networking
This change adds a `--use-lagom-networking` flag to the WebWorker
process. Qt networking is used if this flag isn't passed. The flag is
passed the UI launches the WebWorker process unless the Qt chrome is
being run with the `--enable-qt-networking` flag.
2024-07-06 14:50:26 -06:00
simonkrauter 82915e1914 Ladybird/Qt: Apply selected color scheme for new tabs
Previously, new tabs always had the `auto` color scheme, regardless of
what the user has selected before.
Replace the 3 individual slots with a `set_preferred_color_scheme`
method.
2024-07-06 20:32:33 +01:00
Jamie Mansfield 197f57f5d2 Ladybird/Qt: Add actions to set navigator compatibility mode 2024-07-05 07:14:03 +02:00
Jamie Mansfield e34254298a Ladybird/Qt: Add setting for sending DNT header 2024-07-04 16:42:34 +02:00
Aliaksandr Kalenik 830b287c46 Everywhere: Remove GPU painter and AccelGfx
GPU painter that uses AccelGfx is slower and way less complete compared
to both default Gfx::Painter and Skia painter. It does not make much
sense to keep it, considering Skia painter already uses Metal backend on
macOS by default and there is an option to enable GPU-accelerated
backend on linux.
2024-07-04 14:47:02 +02:00
circl ceb9c3b797 LibWeb+UI: Add tooltip overriding and use it for <video> tags
This call is used to inform the chrome that it should display a tooltip
now and avoid any hovering timers. This is used by <video> tags to
display the volume percentage when it is changed.
2024-07-04 14:15:51 +02:00
circl 0f7623dd83 LibWeb+UI/Qt: Display 'title' tooltips only when the mouse stops moving
Now instead of sending the position in which the user entered the
tooltip area, send just the text, and let the chrome figure out how to
display it.

In the case of Qt, wait for 600 milliseconds of no mouse movement, then
display it under the mouse cursor.
2024-07-04 14:15:51 +02:00
Andrew Kaster 4cc3d598f9 LibWebView+LibCore: Manage process lifecycle using a SIGCHLD handler
This large commit also refactors LibWebView's process handling to use
a top-level Application class that uses a new WebView::Process class to
encapsulate the IPC-centric nature of each helper process.
2024-07-01 18:10:56 +02:00
Andrew Kaster 53f9e68799 Ladybird/Qt: Add Qt implementation of register/unregister_signal 2024-07-01 18:10:56 +02:00
Tim Ledbetter b95c05b611 UI/Qt: Ignore tab bar middle clicks if the user didn't click on a tab
This avoids a segfault that would previously occur when middle clicking
to close a tab if only 1 tab was open.
2024-06-30 13:09:39 +02:00