When calling `clipboard.readText` on content script, Gecko dispatches
`MozClipboardReadPaste` event. On Desktop Firefox uses XUL pop up window
to handle it, then it shows "Paste" button whether user can allow to read
clipboard data.
But GeckoView doesn't have XUL pop up. To implement this feature, we show
"Paste" pop up using action mode as default. Also, browser side can override
delegated methods if it wants another permission pop up or to support Android L
(Android L doesn't have action mode).
Differential Revision: https://phabricator.services.mozilla.com/D151102
(Co-authored with m_kato)
GeckoView's overscroll is implemented by OS side using
`WidgetOverscrollEffect`.
When not releasing finger during overscroll, stretched animation is kept on
Android 12+ since `EdgeEffect.onRelease` isn't called. Then, when releasing
finger, this animation isn't finished on GeckoView with Android 12+.
When this situation, APZ doesn't call
`WidgetOverscrollEffect::HandleFlingOverscroll` by releasing finger due to too
small velocity value in `AsyncPanZoomController::HandleEndOfPan`. So there is
no way to detect whether releasing finger on GeckoView side.
I think We should notify GeckoView of releasing finger to finish animation.
This won't occurs on `GenericOverscollEffect` on macOS since overscoll
animation is managed by APZ and this animation will be finished by
`UpdateAnimation`.
Differential Revision: https://phabricator.services.mozilla.com/D156611
Original issue was bug 1701283, but that fix was removed by bug 1755094
unfortunately.
Some devices (autofill service?) seem to throw a `SecurityException` when
calling autofill manager. So we need try-catch block for it.
Differential Revision: https://phabricator.services.mozilla.com/D156501
These files were made available as:
- `chrome://browser/locale/netError.dtd`
- `chrome://browser/locale/appstrings.properties`
For desktop, overrides are defined in `browser/base/jar.mn` that map the corresponding `global/` paths to the above:
```
% override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
% override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
```
For mobile, similar overrides were earlier defined in `mobile/android/chrome/jar.mn`, but that file was removed in bug 1589182 three years ago.
Consequently, the `global/` paths for these files that are used under `docshell/` and `dom/` have resolved to the non-overridden `dom/` files since Firefox 72.
It should therefore be safe to remove them.
Differential Revision: https://phabricator.services.mozilla.com/D156403
In Geolocation.cpp, the call to start the geolocation device always
had HighAccuracyRequested() set to false because no callbacks were
listening. Changed to set the callbacks first, before listening.
In Android, this patch stops the use of checking for last known location
on high accuracy location requests, adjusts comparing locations,
and also streamlines the criteria for picking the best location provider.
Differential Revision: https://phabricator.services.mozilla.com/D153226
To support overscroll drawing on old Andorid (9 or early), we use the
reflection to access `Paint` object. But this is removed by bug 1724480. So I
would like to revert overscroll part for Android 9 or early.
I tested on old Galaxy S7 (Android 9).
Differential Revision: https://phabricator.services.mozilla.com/D155716
When switching to previous tab, overscroll animation doesn't work since new
`EdgeEffect` doesn't have size. So we should set it from previous information.
If new size is available, `GeckoSession.onWindowBoundsChanged` will set new
size.
Also, this fix includes that `OverscrollEdgeEffect` doesn't use current
`GeckoSession` to draw edge effect. When switching to new `GeckoSession`,
we should set it to `OverscrollEdgeEffect`. `OverscrollEdgeEffect` is public
API, so I don't modify it for this.
Differential Revision: https://phabricator.services.mozilla.com/D155144
window.innerHeight is rounded to integer because of dom.innerSize.rounded=true,
so the quantity being compared to it needs to be rounded as well.
Differential Revision: https://phabricator.services.mozilla.com/D155519
This patch fixes a pre-existing "setPopup + openPopup" GeckoView test case that was apparently disable
because it was failing intermittently.
While trying to run it locally I noticed that the test was getting stuck because there is no
tab delegate that would be allowing the test extension to update the current tab from
http://example.com to the extension page that was meant to be triggering the openPopup API call.
Loading the extension page using mainSession.loadUrl seems to be making the test able to fully
run and pass.
It is possible that the test case was originally working but got broken while it started to be ignored,
the test was missing to await for the setPopup call to be fully handled and that may have been likele
a source of intermittent failures over a larger number of runs.
Differential Revision: https://phabricator.services.mozilla.com/D154548
Beginning in Android 12, apps needing to use high sensor rates need to
have the HIGH_SAMPLING_RATE_SENSORS permission requested.
Differential Revision: https://phabricator.services.mozilla.com/D155238
In bug 1780093 we discovered that our usage of the SurfaceControl
compositing path was preventing the text selection magnifier from
working. We attempted to toggle the SurfaceControl compositing path
off when the magnifier was active, however this has caused much more
severe issues with rendering content at the wrong size after the
keyboard has been dismissed.
For now, stop toggling SurfaceControl usage until we have found out
how to do so without rendering at the wrong size. This will mean the
magnifier will once again not work.
Differential Revision: https://phabricator.services.mozilla.com/D155202
Adds event "GeckoView:Test:NewTab”, which allow testers to create tabs.
`GeckoViewTestUtils.jsm` sends the event from the JavaScript side for
use in testing.
A `ServiceWorkerDelegate` is required to be set for the
`GeckoRuntime` to use these events, which was setup on the test
runner.
Differential Revision: https://phabricator.services.mozilla.com/D152891
Instead of using SessionStateAggregator.js send() to collect history data and send the event StateUpdated to the app, the new GeckoViewSessionStore is used. It is enabled when fission is true and initialized by GeckoViewStartup when Services.appinfo.sessionHistoryInParent is true. It will observe two existing topics: browsing-context-did-set-embedder, which creates the history listener, and browsing-context-discarded, which unregisters it. When the history listener is created, it will collect history from the parent. It will only collect data when the current uri is not “about:blank” and when the history count is greater than 0. It uses SessionHistory’s collectFromParent.
The new code path was manually confirmed by debugging the app history delegate to see that the state map contains all the history data.
Differential Revision: https://phabricator.services.mozilla.com/D150020
When turning on fission, OOP child frame doesn't receive touch events such as
`touchstart`.
When dispatching touch event from GeckoView side, some informations such as
`mLayersId` are missing since copy constructor of `MultiTouchInput` doesn't
copy all information.
Since the structure of Input data has a lot of members, we should use
`std::move` instead of copy constructor of `InputData`. It can avoid
unnecessary copy.
Differential Revision: https://phabricator.services.mozilla.com/D154242
Rather than when a selection is active. Originally we chose to disable
SurfaceControl whenever a selection was active, as it is then likely
the magnifiers may be shown soon, but it reduced the amount of times
we switch between SurfaceControl being enabled and disabled when the
selection is frequently modified.
However, that has 2 issues: First, the magnifier can be shown when
dragging a single caret in a form, rather than just when a selection
is active. With the original fix, the magnifier did not work in this
case. And second, we encountered a bug when the widget is resized at
the same time as SurfaceControl is toggled, where we end up rendering
the page at the wrong size.
This patch therefore makes us only disable SurfaceControl when the
magnifier is actually being shown. This may cause us to enable or
disable it more frequently, but that doesn't appear to be a big deal.
Differential Revision: https://phabricator.services.mozilla.com/D154086
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.
Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).
Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).
Differential Revision: https://phabricator.services.mozilla.com/D152503
This patch adds the minimum necessary to register the
declarativeNetRequest API and its permissions, behind prefs.
Tests have been added/updated to verify that the permissions and API
access are enforced correctly (effectiveness of preferences, API
visibility, permission warnings).
Before landing this, we need to register the permission warning in
Android-Components too, as mentioned in the bug (i.e. bug 1671453).
Differential Revision: https://phabricator.services.mozilla.com/D152503
In bug 1772839 we added a check for whether a Surface is in an
abandoned state prior to resuming the compositor. This check requires
calling a native function via JNI, however, this may be called before
gecko has reached the JNI_READY state. Calling this function then
results in crashes due to UnsatisfiedLinkError exceptions.
To fix this, check whether the gecko state is at least JNI_READY prior
to calling the native function. If JNI is not yet ready, we just have
to assume that the Surface is in a valid state, which may cause us to
crash if that is not actually the case. But that should be a rare
occurrence, and is certainly preferable to always crashing due to
the UnsatisfiedLinkError.
Differential Revision: https://phabricator.services.mozilla.com/D153935
GeckoViewNavigation.jsm's `onLocationChange` should check that the principal
to get permissions for is a supported principal.
Differential Revision: https://phabricator.services.mozilla.com/D153527
On Android we previously added a rendering path using the
SurfaceControl API, in order to work around an Android OS bug when
recovering from a GPU process crash. Unfortunately the Magnifier
widget (shown when moving a text selection caret) does not work when
rendering using SurfaceControl.
This patch makes it so that we temporarily disable the SurfaceControl
path when a text selection is active, allowing the Magnifier to work.
Unfortunately this means that if a GPU process crash occurs while
there is an active selection we will be unable to recover. Hopefully
this turns out to be a relatively rare occurence.
Differential Revision: https://phabricator.services.mozilla.com/D153454
Ensure extensions can manage tabs and sessions that include tabs from other extensions. The parent
patch to this introduces cross-extension access validation. However that breaks this specific use case
that we need to continue supporting. This patch modifies three extension apis, tab.create/update and
windows.create to allow the creation of extension tabs which cannot be otherwise accessed.
Differential Revision: https://phabricator.services.mozilla.com/D151766
Actually, default timeout of geckoview junit is 3000ms, but we can change it
by `@TimeoutMillis`.
When changing timeout value, the timeout of clean up function such as
`cleanupExtensions` is also changed. So if `@TimeoutMillis` is small, cleanup
may be failed due to timeout.
So we shouldn't apply `@TimeoutMillis` on clean up. I guess bug 1606702 and bug
1607631 are same root cause too.
Differential Revision: https://phabricator.services.mozilla.com/D153123
Actually, `evaluateJS_canTimeout` test uses `alert()` to time out.
But when this test is failure, alert prompt is closed by calling reject
callback during timed out. Then, gv-junit cannot detect `TimeoutException`.
Since this reject callback is called by `nsIAndroidEventFinalizer`, I think
that using alert isn't good for `evaluateJS_canTimeout`.
So I would like to use other way instead of something prompt.
Differential Revision: https://phabricator.services.mozilla.com/D152751