Commit Graph

277 Commits

Author SHA1 Message Date
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
Simon Wanner
81d1b129f7 Ladybird/QT: Avoid incorrect round trip via QUrl
QUrl::toString reverses the Unicode->ASCII conversion that already
occurred here. The text of m_location_edit is already in the format we
expect, so let's just convert QString->AK::URL directly, instead of
taking the detour QString->QUrl->AK::URL
2024-02-21 09:25:12 -05:00
Simon Wanner
cac23820c5 Ladybird/QT: Avoid constructing AK String types from char* without size
While QByteArray::data does return a null-terminated char* it's nicer to
avoid strlen() when we already know the size
2024-02-21 09:25:12 -05:00
Andrew Kaster
bb9da0ed8d Ladybird: Plumb overriding root certificate paths through the chromes 2024-02-08 08:49:32 -07:00
Dan Klishch
38164411f0 Ladybird/Qt: Properly listen for DPI changes on Wayland
Some Wayland compositors have support of fractional-scale-v1 protocol.
The protocol allows compositor to announce a preferred fractional scale
on a per-wl_surface basis. Qt forwards these Wayland events to an
application using a usual DevicePixelRatioChange event. However, in
contrast to the other platforms, this DevicePixelRatioChange event is
issued directly on widgets and not screens. Additionally, the exact
fractional scale is stored in QWindow object and not the current screen.

Note that in theory it is possible to obtain per-screen fractional
scaling on Wayland by interpolating data provided by wl_output and
xdg_output events but qtwayland does not do that.

If fractional-scale-v1 is not available, qtwayland will still fire
per-Widget DevicePixelRatioChange events, but, obviously, with the
per-screen possibly larger ceiled scaling.

This whole thing makes handling DPI changes on Wayland really simple.
All we need to do is to intercept DevicePixelRatioChange events firing
on QWindow objects and call the old device_pixel_ratio_changed handler
with the window's devicePixelRatio(). The only caveat here is not forget
to always set QWidget's parent before calling devicePixelRatio() on it.
2024-02-06 09:59:17 -07:00
Tim Ledbetter
8320faf052 Ladybird/Qt: Map Enter keypresses to the code point '\n'
Previously, on systems where pressing Enter would generate "\r\n", only
the '\r' character was being sent to the event handler. This change
ensures consistent behavior across platforms regardless of their native
line ending characters.
2024-02-05 16:52:03 -05:00
Andrew Kaster
36cd2fb7c5 Ladybird+WebContent: Update IPC calls to handle multiple traversables
The IPC layer between chromes and LibWeb now understands that multiple
top level traversables can live in each WebContent process.

This largely mechanical change adds a billion page_id/page_index
arguments to make sure that pages that end up opening new WebViews
through mechanisms like window.open() still work properly with those
extra windows.
2024-02-03 20:51:37 -05:00
Andrew Kaster
677bdc2a4f Ladybird: Add IPC call for creating a new child tab
This will be used for choosing a navigable that requires opening a new
tab or new window. Such as calls to window.open(), or specific WebDriver
calls.
2024-02-03 20:51:37 -05:00
Andrew Kaster
7245f6f11c Ladybird: Open files from the open files dialog as a QURL
This prevents us from needing to properly prepend file:// to the
returned filename.
2024-02-03 20:51:37 -05:00
Andrew Kaster
c75bd4ed15 Ladybird/Qt: Rename new_tab to new_tab_from_url and make it take AK::URL
Instead of having QString be the API for these load() calls, just pipe
AK::URL throughout the UI.
2024-02-03 20:51:37 -05:00
Andrew Kaster
a91680dd55 Ladybird/Qt: Rename new_tab(StringView) to new_tab_from_content
Having an overload of new_tab with StringView and QString that each do
very different things is uncomfortable, to say the least.
2024-02-03 20:51:37 -05:00
Andrew Kaster
48ce8fb4e9 Ladybird: Add ability to create a tab without creating a new WebContent 2024-02-03 20:51:37 -05:00
Dan Klishch
77e4f0d7d8 LibCore: Allow listening for multiple conditions using a single Notifier
While on it, implement currently unused Notifier::set_type correctly
(but not efficiently) by re-registering Notifier in the EventLoop.
2024-02-03 16:43:13 -07:00
Timothy Flynn
85b8971a80 Ladybird+LibWeb+WebContent: Port the did_request_cookie IPC to String 2024-01-26 20:22:39 +01: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
cde14901bc Ladybird+LibWeb: Add initial about:version internal page 2024-01-13 13:41:09 -05:00
Andrew Kaster
02edd240ae LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now
create them in the Browser chrome.

Part 1/N of "all processes are owned by the chrome".
2024-01-12 15:53:11 -07:00
Timothy Flynn
8801fed54e Ladybird/Qt: Show an informational dialog after taking a screenshot
The dialog displays where the screenshot is saved and presents an option
to open its containing folder.
2024-01-06 20:11:12 +00:00
Bastiaan van der Plaat
0dd5aa40a8 LibWeb: Allow input color to give continuous updates 2024-01-06 10:02:15 -07:00
Timothy Flynn
d8fa226a8f Ladybird+LibWebView+WebContent: Make the screenshot IPCs async
These IPCs are different than other IPCs in that we can't just set up a
callback function to be invoked when WebContent sends us the screenshot
data. There are multiple places that would set that callback, and they
would step on each other's toes.

Instead, the screenshot APIs on ViewImplementation now return a Promise
which callers can interact with to receive the screenshot (or an error).
2024-01-01 10:11:45 +01:00
Timothy Flynn
c4e2c725ec Ladybird/Qt: Ensure the Inspector widget is deleted before the WebView
According to Qt documentation, destruction of a QObject's children may
happen in any order. In our case, the Tab's WebContentView is deleted
before its InspectorWidget. The InspectorWidget performs cleanup on that
WebContentView in its destructor; this causes use-after-free since it
has already been destroyed.

From reading Qt threads, if a particular destruction order is required,
it is okay to enforce that order with manual `delete`s. This patch does
so with the InspectorWidget to ensure it is deleted before the
WebContentView. Qt's object ownership is okay with this - it will remove
the InspectorWidget from the Tab's children, preventing any double
deletion.
2023-12-29 15:48:06 +01:00
Timothy Flynn
bacf3cede4 Ladybird+BrowserSettings: Load the NTP/home resource files with LibWeb 2023-12-24 14:09:23 +01:00
Bastiaan van der Plaat
29ee576345 LibWeb: Fix select dropdown position when scrolled on a page 2023-12-23 10:12:36 +01: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
Aliaksandr Kalenik
d87f3a4101 LibWebView+Ladybird: Remove unused on_scroll_into_view callback
Leftover from 9624eca116
2023-12-21 19:25:18 +01: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
Timothy Flynn
8255a1a5ee Ladybird/Qt: Enable SQLServer for cookie storage by default
It was disabled by default for issues that have since been fixed.
Primarily: 14091f32c6
2023-12-16 13:32:04 +01:00
Timothy Flynn
acf7044544 Ladybird/Qt: Use RequestServer as the networking backend by default
This will let us find and fix any RequestServer issues more easily. Qt
networking is still available via command line.
2023-12-16 13:32:04 +01:00
Aliaksandr Kalenik
4534a43aae Ladybird/Qt: Apply to_content_position after scaling event coordinates
Fixes regression introduced in b73ae80d8b
2023-12-16 12:55:29 +01:00
Bastiaan van der Plaat
b73ae80d8b LibWeb: Refactor WebContentServer mouse input message to DevicePixel 2023-12-16 11:08:51 +01:00
Bastiaan van der Plaat
c069ab1ca0 LibWeb: Refactor int types in WebContentServer to DevicePixels 2023-12-15 17:01:16 +01:00
Bastiaan van der Plaat
04b591b2e0 Ladybird/Qt: Listen to DPI changes and update WebContentView accordingly 2023-12-13 22:25:27 +01:00
Bastiaan van der Plaat
cbb660c756 LibWeb: Make request_select_dropdown more similar to context menu api 2023-12-13 10:30:13 +01:00
Bastiaan van der Plaat
aee8b39c65 Ladybird/Qt: Open context menus at requested position 2023-12-13 10:30:13 +01:00
Bastiaan van der Plaat
8b0abb8ded Ladybird/Qt: Don't use devicePixelRatio() directly 2023-12-13 10:30:13 +01:00
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
Aliaksandr Kalenik
57e5abae92 LibJS+LibWebView+WebContent+Ladybird: Output GC-graph into a file
Instead of displaying a massive JSON in stdout, it's more practical
to save the GC-graph to a file.
2023-12-12 15:35:35 +01:00
Timothy Flynn
451df70275 Ladybird+LibWebView: Ensure existing Inspector widgets inspect the page
If the Inspector widget already exists, be sure to inspect the page when
it is re-opened. However, this should be a no-op if the page was already
inspected (as any existing Inspector will be reset if a new page load
began).

Note this is not an issue in the AppKit chrome.
2023-12-10 16:45:08 +01:00
Bastiaan van der Plaat
466153e680 Ladybird+LibWeb: Add basic select element support 2023-12-09 22:06:20 +01:00
Timothy Flynn
7e974f530d Ladybird+LibWebView: Add an Inspector action to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
d5d6ff8bf1 Ladybird+LibWebView: Add an Inspector action to insert a child DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn
71fdf0860e Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node 2023-12-07 10:53:12 +01:00
Timothy Flynn
e3df035c5d Ladybird+LibWebView: Add an Inspector action to copy a node's HTML/text 2023-12-07 10:53:12 +01:00
Timothy Flynn
51a0673b5c Ladybird+LibWebView: Add an Inspector action to copy an attribute value 2023-12-07 10:53:12 +01:00
Timothy Flynn
8162dc5ee6 LibWeb+LibWebView+WebContent: Separate tag/attribute in Inspector menu
It was a bit short-sighted to combine the tag and attribute names into
one string when the Inspector requests a context menu. We will want both
values for some context menu actions. Send both names, as well as the
attribute value, when requesting the context menu.
2023-12-07 10:53:12 +01:00
Timothy Flynn
be53596fe6 Ladybird/Qt: Add an Inspector context menu to edit the DOM 2023-12-06 13:04:50 +01:00
Sam Atkins
715d0bacdb Ladybird/Qt: Implement "Copy Email/Phone" menu item for links 2023-12-05 11:36:22 -05:00
Timothy Flynn
c55d8a9971 Ladybird/Qt: Make the Inspector widget owned by its parent tab
This ensures the Inspector is closed when the BrowserWindow which owns
the tab is closed.
2023-12-04 12:03:48 -07:00
Timothy Flynn
4653733a0d Ladybird/Qt: Do not "share" ownership of Qt objects
When a QObject subclass (widgets, etc.) are provided a parent, then
ownership of that object is passed to the parent. Similarly, objects
added to a QLayout are owned by the layout.

Thus, do not store these objects in an OwnPtr.
2023-12-04 12:03:48 -07:00
Timothy Flynn
a21998003c Ladybird/Qt: Make String allocation infallible 2023-12-04 12:03:48 -07:00
Timothy Flynn
82c827fc56 Ladybird/Qt: Support non-ASCII when converting a QString to a String
QString is UTF-16, thus QString::size returns the number of UTF-16 code
units. Thus, we would fail to perform, for example:

    ak_string_from_qstring(QString("😀"));

Which is 2 UTF-16 code units, but 4 UTF-8 code units.
2023-12-04 12:03:48 -07:00
Timothy Flynn
1aedb0ae5a Ladybird/Qt: Replace the QString-from-AK helpers with a single method
There's no need for 2 overloads for String and DeprecatedString, we can
just use a StringView. This also avoids some cases of needlessly
allocating a DeprecatedString from a StringView when calling this
method.
2023-12-04 12:03:48 -07:00
Timothy Flynn
582f19ba24 Ladybird: Allow opening the Inspector with both ctrl+shift+I and F12
Ladybird on Serenity currently only uses F12, and on other platforms
only uses ctrl+shift+I. Most browsers support both hotkeys, so let's do
the same for consistency.

Note that the AppKit chrome cannot support both shortcuts. macOS does
not allow setting multiple "key equivalent" strings on an action. There
are some questionable hacks we could do to support this eventually, but
for now, just ctrl+shift+I is supported on macOS.
2023-12-02 22:54:06 +01:00
Timothy Flynn
c4daaa9902 Ladybird/Qt: Remove the standalone JavaScript console 2023-12-02 10:34:22 +01:00
Timothy Flynn
07e9a8f79b Ladybird+LibWebView: Move options used to launch WebContent to a struct
It is currently a bit messy to pass these options along from main() to
where WebContent is actually launched. If a new flag were to be added,
there are a couple dozen files that need to be updated to pass that flag
along. With this change, the flag can just be added to the struct, set
in main(), and handled in launch_web_content_process().
2023-12-01 20:07:27 -05:00
Timothy Flynn
b5d5e48ffc Ladybird/Qt: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Timothy Flynn
c03b69e664 LibWebView+Ladybird: Remove now-unused WebView TreeModel
This was used to provided base functionality for model-based chromes for
viewing the DOM and accessibility trees. All chromes now use the WebView
inspector model for those trees, thus this class is unused.
2023-11-24 08:37:19 +01:00
Timothy Flynn
52b5bcdb6d Ladybird/Qt: Port the Inspector to the WebView InspectorClient 2023-11-24 08:37:19 +01:00
Timothy Flynn
0415d03b4f Ladybird: Register Ladybird as a browser-type application on macOS
This allows Ladybird to be the default browser on macOS, and allows for
opening some file types (.html, .svg, .md, etc.) with Ladybird.

Note this currently only works in the GN build (and thus the Qt chrome).
The CMake build does not set up the Resources directory properly for
macOS to run the Ladybird app without $SERENITY_SOURCE_DIR set.
2023-11-14 09:36:36 -05:00
Timothy Flynn
6732a38cf8 Ladybird/Qt: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Timothy Flynn
9249f8bda8 Ladybird: Convert theme configuration to resource URIs 2023-11-06 09:39:59 +01:00
Timothy Flynn
818471b7a7 BrowserSettings+Ladybird: Convert home / new tab page to resource URIs 2023-11-06 09:39:59 +01:00
Timothy Flynn
1b30b510b9 Ladybird: Load all icons uses Core::Resource URIs 2023-11-06 09:39:59 +01:00
Timothy Flynn
bb43bd2dee Ladybird: Remove the now-unused ModelTranslator 2023-11-05 09:11:23 +01:00
Timothy Flynn
55b53e98d7 Ladybird/Qt: Convert the inspector widget to the WebView model class
This creates a Qt-specific wrapper around the WebView model classes and
uses it for the inspector widget tree / table view models.
2023-11-05 09:11:23 +01:00
Timothy Flynn
c72b42ebb2 Ladybird/Qt: Add a couple of missing header includes
These are currently included implicitly, but this will no longer be the
case after upcoming refactoring.
2023-11-05 09:11:23 +01: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
Andrew Kaster
810bbeaed1 Ladybird: Set Settings org to SerenityOS to load proper plist on macOS 2023-10-27 16:51:03 -06:00
Timothy Flynn
66c8400384 Ladybird/Qt: Add a context menu item to search for the selected text 2023-10-24 07:28:30 +02:00
Timothy Flynn
c8c3d00615 LibWebView: Rename find_search_engine to find_search_engine_by_name
We will also need to search by URL in the Serenity chrome.
2023-10-24 07:28:30 +02:00
Timothy Flynn
e7d977f58d Ladybird/Qt: Display drown-down settings using QPushButton
The default behavior of QPushButton is much closer to what we want from
a drop-down menu, as shown in the QPushButton::setMenu documentation:
https://doc.qt.io/qt-6/qpushbutton.html#setMenu

This also results in much less of a "squished" look than before.
2023-10-23 12:12:36 -04:00
Timothy Flynn
63577e8d1c Ladybird/Qt: Increase default size of the settings dialog
The current size is too small to be able to read the new tab URL. Use
the `resize` API rather than setting a fixed-size as well, to allow the
user to resize the dialog themselves.
2023-10-23 12:12:36 -04:00
Timothy Flynn
f8f0c5459d Ladybird/Qt: Migrate to LibWebView for search engines 2023-10-23 12:12:36 -04:00
Timothy Flynn
e7f48abb74 Ladybird/Qt: Use LibWebView to decide what parts of a URL to highlight 2023-10-20 07:18:54 +02:00
Timothy Flynn
f023e37de7 Ladybird/Qt: Sanitize user-provided URLs with LibWebView 2023-10-13 13:37:11 -04:00
Adam Harald Jørgensen
d6796d5123 Ladybird: Add keyboard shortcuts for jumping to a specific tab
It's now possible to open a specific tab by using Ctrl/Command plus the
number key corresponding to its position in the tab row.
2023-10-06 08:10:30 +02:00
circl
84f845494e Ladybird/Qt: Add support for color pickers 2023-09-27 12:16:41 +01:00
Aliaksandr Kalenik
3c675e3f25 Userland+Ladybird: Always specify url to be about:srcdoc in load_html()
After moving to navigables, we started reusing the code that populates
session history entries with the srcdoc attribute value from iframes
in `Page::load_html()` for loading HTML.

This change addresses a crash in `determine_the_origin` which occurred
because this method expected the URL to be `about:srcdoc` if we also
provided HTML content (previously, it was the URL passed along with the
HTML content into `load_html()`).
2023-09-17 21:08:59 +02:00
Aliaksandr Kalenik
aef4b84e22 LibWeb+WebContent: Add option to dump session history of a traversable 2023-09-16 16:53:32 +02:00
Bastiaan van der Plaat
836a7b00dd Ladybird+LibWeb: Add MouseEvent screenX and screenY support 2023-09-15 22:12:56 +02:00
implicitfield
63d09f6daf Browser+Ladybird: Let the list of user agent strings be shared 2023-09-13 19:33:07 -04:00
Adam Harald Jørgensen
7bf842a974 Ladybird: Allow opening multiple URLs at once from the command line
Each URL is opened in a separate tab on startup, and the active tab is
the first URL supplied.
2023-09-11 17:01:17 +01:00
Timothy Flynn
bc5b7aeffb Ladybird: Hide the WebDriver-to-WebContent IPC path from the help menu
This is never meant to be passed by a human, it is created and passed by
WebDriver only. Hide it from the --help menu to avoid confusion.
2023-09-05 06:51:16 -04: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
Andreas Kling
2e45306d42 Ladybird: Update set of User-Agent spoofs to current versions 2023-09-01 09:16:55 +02:00
Timothy Flynn
e26ead0995 Ladybird+LibWebView: Move creation of the SQL client to LibWebView
This lets us remove the direct dependency from Ladybird to LibSQL.
2023-08-31 19:19:45 +02:00
Timothy Flynn
5c5a00dd3a Ladybird+LibWebView: Move CookieJar, Database, and History to LibWebView
These classes are used as-is in all chromes. Move them to LibWebView so
that non-Serenity chromes don't have to awkwardly reach into its headers
and sources.
2023-08-31 19:19:45 +02:00
Bastiaan van der Plaat
43f81f1d0c Ladybird: Remove save button from settings dialog
Save new tab page value on change when valid and
show red error border when URL is not valid
2023-08-31 15:46:21 +02:00
Bastiaan van der Plaat
9510df6eab Ladybird: Move new_tab_page along to set_new_tab_page 2023-08-31 15:46:21 +02:00
Timothy Flynn
204a6f9241 Ladybird+LibWebView: Move console history tracking to ConsoleClient
This will allow other chromes to make use of history in their console
implementations.
2023-08-31 12:20:10 +02:00
Timothy Flynn
bf59e06d2a Ladybird+LibWebView: Extract common JS console functionality to a helper
This creates WebView::ConsoleClient to handle functionality that will be
common to the JS consoles of all Ladybird chromes. This will let each
chrome focus on just the UI.

Note that this includes the `console.group` functionality that only the
Serenity chrome previously had. This was a FIXME in the Qt chrome, and
it is implemented such that all chromes will receive this functionality
for free.
2023-08-30 09:24:59 +02:00
Timothy Flynn
a6bdf8c2a9 Ladybird: Use a web view for the Qt chrome's View Source action
Unlike the existing popup window, this will provide syntax highlighting.
2023-08-29 08:11:11 -04:00
Timothy Flynn
a718a1f3a6 Ladybird: Allow creating new tabs with plain HTML
This will allow us to internally create a new tab with HTML, to be used
by the View Source command.
2023-08-29 08:11:11 -04:00
Timothy Flynn
9c4ce1b80b Ladybird: Do not enable the reload button if history is empty
Not much of an issue currently, but will be once tabs are used to render
plain HTML.
2023-08-29 08:11:11 -04:00
Timothy Flynn
0f9c088302 Ladybird: Install the native style sheet into the JS console web view
Without this, we are unable to render the web view in dark mode.
2023-08-26 15:32:36 -04:00
Timothy Flynn
d56f127c80 Ladybird+LibWebView: Rename some "on get" notifications to "on received"
The old names sounded like awkward English to me, as they implied the
WebContent process is asking for information. In reality, WebContent is
*providing* the information.
2023-08-23 12:07:02 -04:00
Timothy Flynn
edec5b1d91 Ladybird+LibWebView: Migrate input completions to LibWebView callbacks 2023-08-23 12:07:02 -04:00
Timothy Flynn
5116e97a9d Ladybird+LibWebView: Migrate tooltip changes to LibWebView callbacks 2023-08-23 12:07:02 -04:00
Timothy Flynn
78d9339aa9 Ladybird+LibWebView: Migrate scrolling changes to LibWebView callbacks 2023-08-23 12:07:02 -04:00
Timothy Flynn
00fe122b0a Ladybird+LibWebView: Migrate cursor changes to LibWebView callbacks 2023-08-23 12:07:02 -04:00
Timothy Flynn
bf464665a7 Ladybird+LibWebView: Migrate layout notification to LibWebView callbacks 2023-08-23 12:07:02 -04:00
Timothy Flynn
682a5f9b70 Ladybird+LibWebView: Move APIs which only repaint to LibWebView
We can easily add hooks to notify the browsers of these events if any
implementation-specific handling is needed in the future, but for now,
these only repaint the client, which we can do in ViewImplementation.
2023-08-23 09:59:04 -04:00
Timothy Flynn
ea7e1b5f53 Ladybird+LibWebView: Move most of paint handling to LibWebView
Storing the backup bitmap is the same across Browser and Ladybird. Just
peform that work in LibWebView, and handle only the implementation-
specific nuances within the browsers.
2023-08-23 09:59:04 -04:00
Timothy Flynn
15da77f4c4 Ladybird+LibWebView: Migrate file APIs to LibWebView callbacks
This also sets the default callback to do what every non-Serenity
browser is doing, rather than copy-pasting this callback into every
implementation. The callback is still available for any platform which
might want to override the default behavior. For example, OOPWV now
overrides this callback to use FileSystemAccessClient.
2023-08-23 09:59:04 -04:00
Timothy Flynn
ebdcba8b3b Ladybird+LibWebView: Migrate dialog APIs to LibWebView callbacks 2023-08-23 09:59:04 -04:00
Bastiaan van der Plaat
abf0c8f1a6 Ladybird: Use pixelDelta() on supported platforms for better scrolling 2023-08-20 12:17:58 -06:00
Bastiaan van der Plaat
0facfd3257 LibWeb: Make handle_mousewheel wheel delta use pixels 2023-08-20 12:17:58 -06:00
Timothy Flynn
9608bfb576 LibWebView+Ladybird: Remove duplicate WebContent callback
We have on_navigate_back + on_back_button and on_navigate_forward +
on_forward_button. Remove the *_button variants.
2023-08-19 05:15:35 +02:00
Aliaksandr Kalenik
24edb7c97f Ladybird, WebContent: Add option in debug menu to output GC graph dump 2023-08-17 18:27:02 +02:00
Andreas Kling
258af0fb1b Ladybird/Qt: Turn off web search and autocomplete by default
Anyone who wants this can enable it in the settings window.
2023-08-17 16:49:22 +02:00
Cameron Youell
d68433653a Ladybird: Add autocomplete to LocationEdit 2023-08-17 15:30:23 +01:00
Cameron Youell
c53d3e7aa4 Ladybird: Simplify the LocationEdit constructor 2023-08-17 15:30:23 +01:00
Cameron Youell
0da5af0eff Ladybird: Pass QIcon by reference in tab_favicon_changed 2023-08-17 15:30:23 +01:00
Cameron Youell
6e40e8316e Ladybird: Convert Browser::Settings to a singleton 2023-08-17 15:30:23 +01:00
Shannon Booth
c25485700a AK: Port URL scheme from DeprecatedString to String 2023-08-13 15:03:53 -06:00
Timothy Flynn
ccf2597bd3 Ladybird: Remove unused LoadType parameter from Tab::navigate
The only non-default use of this parameter was removed in 980e7164fe.
2023-08-13 21:49:06 +01:00
0x6D70
980e7164fe Ladybird: Add initial page to history
This fixes a bug where the reload button does not work on the page that
was initially opened
2023-08-13 09:24:19 -04:00
Bastiaan van der Plaat
b7b02693b9 Ladybird: Remember window position and size on close 2023-08-09 13:47:44 +01:00
Timothy Flynn
93ffa77370 Ladybird: Remove workaround for initial page load for WebDriver
The issue noted in the removed comment no longer seems to apply. The URL
loaded here is triggered before WebDriver even issues the POST /session
command.
2023-08-09 05:33:24 +02:00
Timothy Flynn
6c7422e8b7 Ladybird: Only load a single URL at launch
When we launch Ladybird, we currently:

1. Create a BrowserWindow, whose constructor navigates to the configured
   new tab page URL.
2. Then navigate to either "about:blank" or whatever URL is provided via
   the command line.

This patch removes step 2 and forwards the URL from the command line (if
any) to BrowserWindow. BrowserWindow's constructor then either navigates
to that URL or the new tab page URL.
2023-08-09 05:33:24 +02:00
Timothy Flynn
601da7e5bd Ladybird: Add the select-all action to the JS console
Also clarify a comment, because it wasn't immediately clear to me what
wouldn't work without the code below it.
2023-08-09 05:13:24 +02:00
Timothy Flynn
59b583329a Ladybird: Close the current tab even if we're closing the window
Currently, if the JS console is open and tied to the last opened tab in
the browser window, it will prevent the main process from exiting when
the last tab is closed. This change explicitly closes that tab before
closing the window (if it's the last tab), allowing Qt to delete the
Tab object.
2023-08-09 05:13:24 +02:00
Andreas Kling
99ac34eeae Ladybird+LibWebView+Browser: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andreas Kling
e769776bdd Ladybird: Remove ability to run with AST interpreter 2023-08-08 13:07:13 +02:00
Andrew Kaster
82495083c3 Ladybird: Ensure selected new tab URL is a valid URL before saving 2023-08-07 22:17:40 -04: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