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)
We already unregister the view in the ViewImplementation destructor. We
do not need to do so again in the WebContentView destructor.
(cherry picked from commit 62fa84865d64b6ac7bcb1f8f285b556e56481cb6)
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.
(cherry picked from commit 06484d0663c120198323547e6515404ba0a594ee)
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.
(cherry picked from commit e17362ab79d8442af70c146d351e29168bb8a5b7)
When working on the Inspector's HTML, it's often kind of tricky to debug
when an element is styled / positioned incorrectly. We don't have a way
to inspect the Inspector itself.
This adds a button to the Inspector to export its HTML/CSS/JS contents
to the downloads directory. This allows for more easily testing changes,
especially by opening the exported HTML in another browser's dev tools.
We will ultimately likely remove this button (or make it hidden) by the
time we are production-ready. But it's quite useful for now.
(cherry picked from commit 3ec5c1941f25041c6bf073f2940f6035e084a4e2)
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.
(cherry picked from commit ceb9c3b79746e5499dce781e1fc81a9107c86f84;
amended to add a FIXME: to OutOfProcessWebView for these new hooks)
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.
(cherry picked from commit 0f7623dd8322f0fd5ef6ee0e27e1295e11f276e6;
amended to update OutOfProcessWebView.cpp for on_enter_tooltip_area
API change)
This patch adds a simple in-memory HTTP cache to each WebContent
process.
It's currently off by default (turn it on with --enable-http-cache)
since the validation logic is lacking and incomplete.
(cherry picked from commit a3c8e60710451c1325f6718b253e8d1ee2029a30)
The location bar URL is no longer hidden when creating a new tab or
opening a new window that has an associated URL. Conversely, the
location bar is now always focused and the URL hidden when creating a
window or tab without an associated URL.
The location bar is focused when:
* Opening the browser from the command line with no URL arguments
* Opening a new tab (Ctrl+T)
* Opening a new window (Ctrl+N)
The location bar is not focused when:
* Opening the browser from the command line with one or more URLs
* Opening hyperlinks in a new tab
* Clicking a hyperlink with `target="_blank"`
This matches the behavior of other major browsers.
(cherry picked from commit efce3d967183f7071d47f27ce93310662217ef5e)
This prevents the user being able to shrink the window to the point
that the location bar and other controls are no longer visible.
(cherry picked from commit 4ed46adeeec4860b55d455da49aa93aff26bf1a3)
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.
(cherry picked from commit 7abf47f4bf5039869a8f38c12f1be62bba97e463)
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.
(cherry picked from commit 82915e1914bd9a8d4a6dcbec53982b3ba2caa68d)
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 ac062d0c977de7ca648504ef6238a8a016076aa6)
This allows multiple WPT tests to be run in parallel with using the
`--processes` option.
(cherry picked from commit c14dc77349eca6f9cddd7fbb1d8e216cc9fa6cf8)