960 Commits

Author SHA1 Message Date
Sönke Holz
77f058c32e Everywhere: Remove iOS support
Now that ladybird was hard-forked from SerenityOS, there's no good
reason to keep supporting iOS.

Ladybird only still exists in the SerenityOS repo to make testing LibWeb
easier.
2026-04-06 15:44:56 +02:00
Nico Weber
631ed53082 Meta: Patch up Apple SDK headers to work with C++26 2026-01-04 13:47:22 +01:00
Nico Weber
2a251257e6 Ladybird/AppKit: Stop including Carbon.h
Carbon.h also pulls in QD/ColorSyncDeprecated.h, and other than
in the previous commit we can't just hack it out, since that breaks
other things in Carbon.h.

But we only need Carbon.h for two enums in HIToolbox/Events.h, so
locally define those enums directly.

No behavior change.
2026-01-04 13:47:22 +01:00
Nico Weber
9877ee85c6 MacPDF+Ladybird/AppKit: Omit ColorSyncDeprecated.h from build
QD/ColorSyncDeprecated.h, normally pulled in by Cocoa.h, contains
many enums triggering

    "invalid arithmetic between different enumeration types"

in C++26. Omit it from the build by hackily defining its include
guard macro.
2026-01-04 13:47:22 +01:00
Nico Weber
ef10dd808d Ladybird/AppKit: Add explicit enum cast required by C++26
No behavior change.
2026-01-04 13:47:22 +01:00
Sönke Holz
2b67e1e82d Ladybird/Qt: Avoid promotions to double in WebContentView 2025-12-03 07:33:13 -05:00
Timothy Flynn
a11169e9a6 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.

(cherry picked from commit cbf1fd3e61710d9e8069ea1480b25734fd35d26f)
2025-10-29 12:55:26 -07:00
Timothy Flynn
6c122ef16f Meta: Do not pass an empty --resources flag to headless-browser
The ${resource_base_dir} no longer exists in this context. Thus LibWeb
tests were no longer actually running.

(cherry picked from commit cd581e9502dd765a61cd0a73a0c93f1ea1cb9b0f)
2025-10-24 19:10:49 -04:00
Timothy Flynn
dbb028d137 Meta: Copy resources to the app bundle during create_ladybird_bundle()
For some reason, moving the UI-specific CMake to its own files prevents
resource files from being copied to the Resource directory in the macOS
application. I'm not sure what the difference here is, but doing this
step during create_ladybird_bundle() works.

(cherry picked from commit 8641e78cdce4da621251b0faee755b4040f444c9)
2025-10-24 19:10:49 -04:00
Andrew Kaster
124e3e214b CMake: Simplify WebContent CMakeLists to always create a static lib
(cherry picked from commit 354b0062faa01c27c17f30311e08c38dd0064aac)
2025-10-24 19:10:49 -04:00
Andrew Kaster
b0794bb287 CMake: Move ladybird target creation to UI-specific CMakeLists
(cherry picked from commit 47d6a263d8543b248b90b8fc9e78be54de31fecb)
2025-10-24 19:10:49 -04:00
Lucas CHOLLET
0ff1f39b8b Everywhere: Run clang-format
The following command was used to clang-format these files:

    clang-format-20 -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")
2025-10-10 00:02:50 +02:00
Sönke Holz
53aefbda84 Ladybird: Stop using the Qt event loop in WebContent and WebWorker
After the last 2 commits there is no need to keep using the Qt event
loop.

Upstream ladybird also stopped using the Qt event loop in 62c5f4b822d.
2025-08-10 17:38:01 +02:00
Sönke Holz
0b09b7535d Ladybird: Remove Qt Network support
Now that ladybird was moved moved to its own repository, we don't need
to keep unnecessary features like Qt networking around.
Ladybird only still exists in the SerenityOS repo to make testing LibWeb
easier.

Upstream ladybird also removed Qt networking support in 1b324f3ae11.
2025-08-10 17:38:01 +02:00
Sönke Holz
82b46b7b26 Ladybird: Remove the Qt Multimedia audio plugin
Now that ladybird was moved moved to its own repository, we don't need
to keep unnecessary features like the Qt Multimedia audio backend.
This means that PulseAudio is now required to have working audio in the
Qt chrome.

Ladybird only still exists in the SerenityOS repo to make testing LibWeb
easier.
2025-08-10 17:38:01 +02:00
Sönke Holz
24a18a27fc Ladybird: Only set AUTO{MOC,RCC} for targets that need it
No target needs AUTOUIC, so remove it.
2025-08-10 17:38:01 +02:00
Andreas Kling
4810f037a8 Ladybird/AppKit: Use sRGB color space when blitting web content
Before this change, we were passing CGColorSpaceCreateDeviceRGB() to
CGImageCreate(), causing the system to assume that the image data is
in a device-specific RGB space without any color profile adjustments.

If your monitor is more vibrant than the assumed profile (for example,
a wide-gamut display), colors may appear over-saturated as there's no
correction applied for how the display actually renders those colors.

We now pass CGColorSpaceCreateWithName(kCGColorSpaceSRGB) instead,
which makes colors look the same in Ladybird as in other browsers. :^)

(cherry picked from commit 7cf7a4d7aace1694a3e3a2a9405ffdf5a034efb4)
2025-05-23 20:50:43 -04:00
Aliaksandr Kalenik
9f70dfa435 Ladybird: Account for backing store bitmap pitch
In the upcoming changes, Skia painter will be switched to Metal backend,
so we can no longer assume `pitch = width * 4` while reading Gfx::Bitmap
that wraps IOSurface populated by writing into MTLTexture that has
padded scanlines.

(cherry picked from commit 8de9516272b0543240398428628553bf879330f0)
2025-05-23 20:50:43 -04:00
Lucas CHOLLET
ee0ce703dc Ladybird/Qt: Fix building with -Wmissing-declarations 2025-03-19 08:05:34 -04:00
Lucas CHOLLET
a3f867a17a Ladybird/Qt: Mark TabBarButton::event as an override method 2025-03-19 08:05:34 -04:00
Gabriel Tassinari
7d1926cc6b Qt: Fix -Werror=deprecated-declarations when using Qt > 6.7
(cherry picked from commit 07400b515c3d8d03bf3d6e35c26ec8a3d7317560;
amended to omit change to code added in LadybirdBrowser/ladybird#1497
since we don't have that yet)
2025-02-06 09:04:14 -05:00
Sidicer
4a36ae5a70 UI/Qt: Fix hover_label hiding URLs
m_hover_label did not have checks if the mouse is in the same location.
This caused clickable URLs to be hidden.
Also shortened the label text to not be longer than half of the window.

(cherry picked from commit edf29857f8f8b669c45d673b088d9c0236659d73)
2024-12-21 14:58:20 -05:00
Timothy Flynn
dda405e652 UI/Qt: Execute dialogs opened from the page asynchronously
Invoking exec() entirely blocks the UI application's main thread. Qt
explicitly recommends against this. In practice, it seems prevents some
IPC messages from being handled by the UI until the dialog is closed by
the user.

Instead, use open() (which is non-blocking) and set up a signal handler
to deal with the result.

(cherry picked from commit ea9abe26e1c40c0d2e96007bf7d69afb49a7052a)
2024-11-28 18:58:55 -05:00
Timothy Flynn
965e1baa8c LibWeb+UI: Detect and handle left vs. right modifier keys
Our handling of left vs. right modifiers keys (shift, ctrl, etc.) was
largely not to spec. This patch adds explicit UIEvents::KeyCode values
for these keys, and updates the UI to match native key events to these
keys (as best as we are able).

(cherry picked from commit 4fcaeabe1a6acd9f4d5fd811a36f2e86748b2a72;
amended to make the rest of the system build and to keep `Mod_AltGr`
around in addition to adding it as a key)

Co-authored-by: Nico Weber <thakis@chromium.org>
2024-11-28 15:15:36 -05:00
Timothy Flynn
50fd33a531 UI/AppKit: Send keyboard events for modifier-only key presses/releases
If the user only presses the shift key, for example, we are required to
still send that event to WebContent and generate the corresponding JS
events. Unfortunately, NSApp does not inform us of these events via the
keyDown/keyUp methods. We have to implement the flagsChanged interface,
and track for ourselves what modifier keys were pressed or released.

(cherry picked from commit eabd5b0f2271e7a89727daf80dd28623711f3416)
2024-11-28 15:15:36 -05:00
Andrew Kaster
84231892c8 Ladybird+LibIPC: Move clearing FD_CLOEXEC helper logic to IPC::File
(cherry picked from commit 343a3a0d7e05a2abba96a91630ebac0547cde1a6)
2024-11-24 20:50:01 -05:00
Aliaksandr Kalenik
360fa4a0bf Everywhere: Hand pid of new process to client in launch_server_process()
Allows WebContentClient to get pid of WebContent process right after
creation, so there is no window between forking and
notify_process_information() IPC response, when client doesn't know the
pid.

(cherry picked from commit c46bea479c1cbf9bb9a30cbecaaa10c85a4ba321)
2024-11-24 20:50:01 -05:00
Timothy Flynn
52099ff54d LibWebView: Generate hyperlinks for attributes that represent links
On the view-source page, generate anchor tags for any 'href' or 'src'
attribute value we come across. This handles both when the attribute
contains an absolute URL and a URL relative to the page.

This requires sending the document's base URL over IPC to resolve
relative URLs.

(cherry picked from commit 1aab7b51ea9c27a6ffff8df0c8bcbec87680865c;
amended to update `on_received_source` signature in Browser too)
2024-11-17 11:03:57 -05:00
Sam Atkins
c7613b186b LibWebView+UI: Highlight CSS in the style sheet inspector
(cherry picked from commit f0dd0c51073823ad2e30041896030a2831419786)
2024-11-16 14:05:12 -05:00
Sam Atkins
d094c2984b 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! :^)

(cherry picked from commit da171c3230caaee53213d0dd04007c9b4343e3e2)
2024-11-15 23:10:03 -05:00
Sam Atkins
549f5fe374 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>
(cherry picked from commit 421fb6309f6d5ea13676c5788a3d8294631a403b;
amended to resolve conflict due to us not yet having
LadybirdBrowser/ladybird#910, so this will cause extra conflicts
when finally cherry-picking that. But that PR will need lots of
conflict resolving anyways.)
2024-11-15 23:10:03 -05:00
Jamie Mansfield
70d69c194f 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.

(cherry picked from commit b0fc8b67d64089587552effbe3b994cdb5967ce5)
2024-11-15 23:10:03 -05:00
Timothy Flynn
4a6e669343 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.

(cherry picked from commit 4833ba06eaef20053f85343a13c0307394d67ded)
2024-11-15 19:27:44 -05:00
Tim Ledbetter
27f724b435 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.

(cherry picked from commit 886714632759c1e2feeb636388975f0e3b515839;
amended Qt/main.cpp to resolve minor conflict due to serenity not having
LadybirdBrowser/ladybird#284 LadybirdBrowser/ladybird#45, and
WebWorker/CMakeLists.txt due to serenity still having
`SERENITY_SOURCE_DIR` instead of `LADYBIRD_SOURCE_DIR` --
LadybirdBrowser/ladybird#17)
2024-11-15 19:07:17 -05:00
Tim Ledbetter
42712fd165 WebDriver: Add option to use Qt networking
Using Qt networking when running web platform tests improves
performance significantly. The time to run the subset of tests we run
on CI drops from 21.9 seconds to 8.2 seconds on my machine.

(cherry picked from commit ff2123a949446b834e6c3b0be7ca4c994d71f3e1)
2024-11-15 19:07:17 -05:00
Asutosh Variar
50cc1b5d63 Everywhere: Convert from_string_view -> from_string_literal where static
(cherry picked from commit 229b64a4b723a391c21f247d72d78cd575ace6ff;
minorly amended to fix conflict in image.cpp due to serenity in the
meantime adding webp writing support, and due to changes in Android and
Vulkan-related files that serenity doesn't have)
2024-11-15 08:56:39 -05:00
Galvin
4ed48dfb9e UI/AppKit: Fix tab title icon and text layout
Make the tab title icon and text vertical center

(cherry picked from commit e8ff9b6eb4c77d8606e492e8f0608190d40b7649)
2024-11-13 10:17:34 -05:00
Timothy Flynn
69953cb70e UI/Qt: Remove unused WebContentView::dump_layout_tree
(cherry picked from commit b688bbf26c6efb84fec19ec900cd3f1a4cf04a1b)
2024-11-12 10:45:53 -05:00
Kostya Farber
cec134792e Qt: Add box icon to line box debug menu action
(cherry picked from commit 3e7faae6472d9696637d58f30994199a28dddc01)
2024-11-12 07:14:25 -05:00
rmg-x
7f96fb2c1f UI/Qt: Simplify link context menu and update keyboard shortcuts
Removes the unnecessary separator, redundant open action, and changes
shortcuts to match other browsers.

(cherry picked from commit 1f365ba44a2f95006121f689429e2f58db30bc5b)
2024-11-11 19:54:09 -05:00
Andreas Kling
ad4abc1818 UI/AppKit: Make "Dump GC Graph" menu action actually work again
This was originally implemented as a debug request, but later changed.
The Qt UI already did the right thing, so just copy the logic over.

(cherry picked from commit 08ae305dc5a621233b2d329581969899efbb1195)
2024-11-10 19:39:05 -05:00
Jelle Raaijmakers
b471972353 UI/Qt: Enable basic IME keyboard input for WebContentView
This makes dead keys work (e.g. typing ' and e results in é).

(cherry picked from commit 7e57cc7b090455e93261c847064f12a61d686ff3)
2024-11-10 18:24:10 -05:00
Jamie Mansfield
603f66017a 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.

(cherry picked from commit df34ee058b1285d31386ee973f056d56f13d7bf6)
2024-11-10 18:24:10 -05:00
Jamie Mansfield
088c42ab6e Ladybird/Qt: Display ampersands in tab titles
Qt reads ampersands as shortcut keys, so this escapes them (with &&) so
they display correctly :^)

(cherry picked from commit 6133707df88d0b6e2e9eb62797658c1a88380a07)
2024-11-10 18:24:10 -05:00
Timothy Flynn
bedf88c8eb UI/Qt: Do not create signal notifiers until after an event loop exists
We are currently creating a signal socket and socket notifier before the
Qt event loop itself has been created. Thus, when we receive a signal,
we are not actually notified when we write that signal number to the
signal socket.

This was also the source of the following error message being displayed
on every launch of the browser:

    QSocketNotifier: Can only be used with threads started with QThread

(cherry picked from commit 3393a7477103cb2dc2fe970e3559abb34b3a0ce8)
2024-11-10 10:46:01 -05:00
rmg-x
2d67391151 UI/Qt: Move "Open in New Tab" to the top of the link context menu
(cherry picked from commit 7a2d837c8ab137d8d31b3789dfe7ef377b3b225e)
2024-11-10 10:46:01 -05:00
ronak69
c74a70ea1d UI/Qt: Do not perform search if query text is empty
(cherry picked from commit 276ad23b7090a3edc778a6d48e8ff2ff450f2896)
2024-11-09 16:08:01 -05:00
PiyushXCoder
2b84c92566 UI/Qt: Don't allow tabs to be dragged past the new tab button
Before this change, if would a tab it will pass the add new tab button
(+ button).

closes #1124

(cherry picked from commit 9b79081a0601ef6649592acc1025b12c52e63d5c)
2024-11-09 16:08:01 -05:00
Tim Ledbetter
d460654347 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.

(cherry picked from commit 6c608bac659b7e39be52ffecd68ecd46172665bc)
2024-11-09 16:08:01 -05:00
sideshowbarker
2949d90c82 Ladybird: Remove unnecessary copy of decoded images
This also eliminates the clang-tidy warning “Std::move of the const
expression has no effect”.

(cherry picked from commit ff170de49dfae56d123fb5e8bb61825e7cd16f5c)
2024-11-09 07:29:52 -05:00