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.
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.
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.
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)
The ${resource_base_dir} no longer exists in this context. Thus LibWeb
tests were no longer actually running.
(cherry picked from commit cd581e9502dd765a61cd0a73a0c93f1ea1cb9b0f)
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)
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.
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.
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)
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)
(cherry picked from commit 07400b515c3d8d03bf3d6e35c26ec8a3d7317560;
amended to omit change to code added in LadybirdBrowser/ladybird#1497
since we don't have that yet)
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)
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)
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>
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)
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)
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)
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)
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.)
This is a follow up to GH-1111 to reflect the new signatures that these
functions have.
(cherry picked from commit b0fc8b67d64089587552effbe3b994cdb5967ce5)
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)
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#284LadybirdBrowser/ladybird#45, and
WebWorker/CMakeLists.txt due to serenity still having
`SERENITY_SOURCE_DIR` instead of `LADYBIRD_SOURCE_DIR` --
LadybirdBrowser/ladybird#17)
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)
(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)
Removes the unnecessary separator, redundant open action, and changes
shortcuts to match other browsers.
(cherry picked from commit 1f365ba44a2f95006121f689429e2f58db30bc5b)
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)
Qt reads ampersands as shortcut keys, so this escapes them (with &&) so
they display correctly :^)
(cherry picked from commit 6133707df88d0b6e2e9eb62797658c1a88380a07)
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)
Before this change, if would a tab it will pass the add new tab button
(+ button).
closes#1124
(cherry picked from commit 9b79081a0601ef6649592acc1025b12c52e63d5c)
Previously, right clicking highlighted text in the location bar would
cause the current selection to be lost.
(cherry picked from commit 6c608bac659b7e39be52ffecd68ecd46172665bc)
This also eliminates the clang-tidy warning “Std::move of the const
expression has no effect”.
(cherry picked from commit ff170de49dfae56d123fb5e8bb61825e7cd16f5c)