To align with other browsers, the user gesture requirement has
been removed and there is now an optional first argument which
can be used to provide a windowId.
Differential Revision: https://phabricator.services.mozilla.com/D139796
`osfile` is deprecated and `./mach lint -l eslint` shows warning message for
it. So I would like to replace it with `PathUtils`.
Differential Revision: https://phabricator.services.mozilla.com/D159343
Also assure that unregistering an accessible removes the right one and
doesn't confuse the attached document with the detached one.
Add stderr output to Accessible::DebugPrint in Android as well.
Differential Revision: https://phabricator.services.mozilla.com/D157528
This migration creates the first FTL file under mobile/android/.
As GeckoView isn't actually localised (see bug 1605358), this file
is not exposed to localisers.
A migration script is still included, as previous localisations of
the about:config view's strings are available from its Fennec days.
Running the script will fail in an m-c checkout bootstrapped for
desktop development; it's possible to hack around this by manually
setting the `l10n_toml` value in `python/l10n/test_fluent_migrations/fmt.py`.
Differential Revision: https://phabricator.services.mozilla.com/D155450
This migration creates the first FTL file under mobile/android/.
As GeckoView isn't actually localised (see bug 1605358), this file
is not exposed to localisers.
A migration script is still included, as previous localisations of
the about:config view's strings are available from its Fennec days.
Running the script will fail in an m-c checkout bootstrapped for
desktop development; it's possible to hack around this by manually
setting the `l10n_toml` value in `python/l10n/test_fluent_migrations/fmt.py`.
Differential Revision: https://phabricator.services.mozilla.com/D155450
Also assure that unregistering an accessible removes the right one and
doesn't confuse the attached document with the detached one.
Add stderr output to Accessible::DebugPrint in Android as well.
Differential Revision: https://phabricator.services.mozilla.com/D157528
Now that it's no longer used, the global.dtd file and its single remaining string `locale.dir` may be removed.
A test specifically targeting this is also removed as obsolete.
Differential Revision: https://phabricator.services.mozilla.com/D157797
After the preceding changes, brand.dtd has no more actual users and may be removed.
One mochitest is switched to use a different DTD file which will still remain in the tree.
The dependency in aboutSupport.xhtml appears to have been accidentally left in when its localization was migrated to Fluent.
Differential Revision: https://phabricator.services.mozilla.com/D156668
Although this test doesn't run on our CI since CI uses Android 7.0, I would
like to add this for the future.
Image keyboard support requires content:// uri for image, so we need content
provider for testing this feature.
Differential Revision: https://phabricator.services.mozilla.com/D157714
The android magnifier widget does not work when using our
SurfaceControl rendering path, as we no longer render in to the
Surface provided by the SurfaceView, but instead into a child Surface
we have created and attached the SurfaceControl.
To fix this, we create a SurfaceView subclass, MagnifiableSurfaceView,
which allows us to set an override Surface to be used by the
magnifier. This class works by overriding getHolder() to return a
custom SurfaceHolder, which returns our override Surface rather than
the default one when called by the Magnifier class.
Depends on D157308
Differential Revision: https://phabricator.services.mozilla.com/D157309
In order to fix the magnifier widget being broken, the previous patch
in this bug added a mechanism to disable and enable the SurfaceControl
rendering path. This caused some glitches to occur, so we removed the
calls to that code in bug 1783542, but the code remained.
As we now have an alternative solution to fix the magnifier widget, we
no longer require this code. This patch therefore reverts the original
patch, to lead the way for the new solution in the next patch.
Differential Revision: https://phabricator.services.mozilla.com/D157308
This migration creates the first FTL file under mobile/android/.
As GeckoView isn't actually localised (see bug 1605358), this file
is not exposed to localisers.
A migration script is still included, as previous localisations of
the about:config view's strings are available from its Fennec days.
Running the script will fail in an m-c checkout bootstrapped for
desktop development; it's possible to hack around this by manually
setting the `l10n_toml` value in `python/l10n/test_fluent_migrations/fmt.py`.
Differential Revision: https://phabricator.services.mozilla.com/D155450
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
A disabled form controls cannot be focused, and its frame selection is different
from the one for not-editable content. Use GetLastFocusedFrameSelection() (added
in Bug 253870) to get the correct frame selection that is visible to the user.
Add some basic tests for disabled <textarea> such as long pressing to select,
dragging, etc. They should behave the same as normal <textarea>.
Differential Revision: https://phabricator.services.mozilla.com/D151800
Android's `is24HourFormat` could not be be called from GeckoAppShell
when using isolated process. Changed GeckoAppShell's `getIs24HourFormat`
to be set as a variable in GeckoRuntime, which has correct access to
`is24HourFormat`.
Differential Revision: https://phabricator.services.mozilla.com/D152132
`onBeforeUnloadTest` may be failure when `beforeunload` is immediately called
again.
Although 1st prompt by `beforeunload` is closed in test, Gecko may be clear
the flag (`nsDocumentViewer::mInPermitUnloadPrompt`) for prompt state at this
time. Then, if 2nd `beforeunload` is fired immediately, since the flag
isn't clear, `nsDocumentViewer` recognizes that `beforeunload` prompt is still
opened. Then newer prompt isn't called.
So we need a wait to clear this flag.
Differential Revision: https://phabricator.services.mozilla.com/D151903
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When setting focus to input element, Gecko sets focused element to central via
`zoomToFocusedInput`. So when we receives `focusin` event, content may be
scrolled and zoomed. To pass correct element rectangle, we have to wait until
it is completed.
Fennec added `PanZoom:StateChange` event to listen APZ state. So GV should use
same way.
Differential Revision: https://phabricator.services.mozilla.com/D150453
On some Android devices (predominantly Huawei devices running Android
9 or below) we are seeing large numbers of crashes due to the
compositor being unable to create an EGL surface to render in to. From
local testing, this appears to be due to the Surface we are being
provided from the SurfaceView being in an "abandoned"
state. Presumably this is due to an operating system bug - the Surface
is valid at the time of the surfaceChanged() callback, but becomes
abandoned moments later despite surfaceDestroyed() not being called.
We are able to detect when the Surface is in such a state from C++
code by calling ANativeWindow_getWidth(), as that will return a
negative value to indicate an error.
This patch uses this method to check whether the Surface is in such a
state prior to resuming the compositor. If so, rather than immediately
resuming the compositor it instead toggles the SurfaceView's
visibility. This tricks the SurfaceView in to providing a new (and
hopefully valid) Surface, which will in turn resume the compositor via
the surfaceChanged callback.
Differential Revision: https://phabricator.services.mozilla.com/D151479
In some test runs, the `onPause` Android Lifecycle event is not occuring
in the GeckoView test `GeolocationTest`.
Increasing the time between calling an `onPause` event (going Home)
and the `onResume` event (returning to app) will give the device more
time to complete the `onPause` event and return the expected results.
Differential Revision: https://phabricator.services.mozilla.com/D151031
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When setting focus to input element, Gecko sets focused element to central via
`zoomToFocusedInput`. So when we receives `focusin` event, content may be
scrolled and zoomed. To pass correct element rectangle, we have to wait until
it is completed.
Fennec added `PanZoom:StateChange` event to listen APZ state. So GV should use
same way.
Differential Revision: https://phabricator.services.mozilla.com/D150453
When Surfaces/SurfaceTextures are allocated they are given a handle,
which is a monotonically increasing 32-bit integer. To render
Surfaces, we typically pass the Surface handle to the compositor,
which then looks it up in a map to find the corresponding
SurfaceTexture.
Following a GPU process restart, content may be left with stale
handles referencing SurfaceTextures which no longer exist. Once new
SurfaceTextures are allocated, these stale handles may reference new
SurfaceTextures with no relation to the old handle. This can lead to
rendering the wrong texture. Additionally, we may crash when
allocating "sync" SurfaceTextures, as the previous sync texture for a
certain handle may not have been released yet.
To fix this, this patch combines the existing handle with a new ID
uniquely identifying the process in which the SurfaceTexture was
allocated (or 0 for the parent process). We use a monotonically
increasing value rather than the pid to guard against the new GPU
process possibly having the same pid as the previous instance. We
combine these two 32-bit integers and use the resulting 64-bit integer
as the Surface handle.
Differential Revision: https://phabricator.services.mozilla.com/D150963
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.
This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.
Differential Revision: https://phabricator.services.mozilla.com/D149436
This bug unsets the location listeners when the Android lifecycle
`onPause` is called and sets the location listeners when `onResume` is
called (if location was in use).
Differential Revision: https://phabricator.services.mozilla.com/D149442
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.
This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.
Differential Revision: https://phabricator.services.mozilla.com/D149436
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.
This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.
Differential Revision: https://phabricator.services.mozilla.com/D149436
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.
This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.
Differential Revision: https://phabricator.services.mozilla.com/D149436
Several widget contracts use different implementations in the parent and
content processes. Since the static registration system builds its hashtable
at compile time rather than runtime, it doesn't support different contract IDs
per process. It could make the decision at lookup time, but given how rarely
it's needed, I don't think it would be worth the complexity.
This patch updates the widget components that need different implementations
in the parent and content process to register separate contracts for each
implementation, and a third stub contract which forwards to the appropriate
implementation depending on which process it's used in. The implementation
entries restrict their usage to the process they are meant to be used in.
Differential Revision: https://phabricator.services.mozilla.com/D149436
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
This removes HTMLMenuItemElement and all the code and tests preffed off
by dom.menuitem.enabled.
The HTML parser changes are the result of applying the previous patch.
Differential Revision: https://phabricator.services.mozilla.com/D149979
Actually, GeckoView registers both desktop and mobile actor for `<select>`
element. It is unnecessary to use desktop's `<select>` actor.
But, if GeckoView doesn't register desktop's `<select>` actor,
`layout/forms/test/test_select_reframe.html` will be failure since GV doesn't
handle `mozhidedropdown` that is a event when the control is unbinded from
layout tree.
So we need to handle this for this situation that is one of dismissed cases.
Differential Revision: https://phabricator.services.mozilla.com/D149526
`android.location.Location.getTime()` will return the acquired location time
that depends on location service. But `maximumAge` will be calculated by
current time (`PR_Now()`). So if the acquired time is old time,
`nsGeolocationRequest::SendLocation` won't send the location due to too old
(`isTooOld=true` in `nsGeolocationRequest::SendLocation`).
Like other platforms, we should pass PR_Now as the location time instead.
Also, GVE sometimes hits debug assertion since heading and/or speed aren't
expected value, so this patch fixes this situation.
Differential Revision: https://phabricator.services.mozilla.com/D148452
I think this sub-heading is a weird artifact of the migration from md to rst.
It creates a double menu that is not needed.
Before:
```
- Contributing to GeckoView
- Contributor Site
- GeckoView Contributor guide
- GeckoView for Gecko engineers
- ...
- Using GeckoView
- Usage Documentation
- Getting Started with GeckoView
- Interacting with Web Content
- ...
```
After
```
- Contributing to GeckoView
- GeckoView Contributor guide
- GeckoView for Gecko engineers
- ...
- Using GeckoView
- Getting Started with GeckoView
- Interacting with Web Content
- ...
```
Differential Revision: https://phabricator.services.mozilla.com/D148214
This is part 1 of the bug, it addresses the crush itself, and the weird case of BuildConfig.DEBUG being true in release builds (due to an external to gv bug). There will be a follow up, in a separate bug, to address the actual flow (Web Extensions opening web pages in popups and how we want to handle that).
Differential Revision: https://phabricator.services.mozilla.com/D147456
In bug 1762424 we introduced a rendering path on Android using the
SurfaceControl API, in order to work around a bug preventing recovery
from a GPU process crash. However, the initial implementation caused
this bug: repeatedly sending the same SurfaceControl objects over AIDL
to the GPU process resulted in them being leaked, eventually causing
severe display issues. Not only were we duplicating the SurfaceControl
for each widget, but each time a widget was resized too.
This patch reworks our usage of the SurfaceControl API to avoid ever
having to send them cross-process. Instead, we create a single child
SurfaceControl object for each SurfaceControl that is attached to a
widget. (Typically there will be a single one shared between all
widgets, changing only when the app is paused and resumed, which is
much fewer than one per widget per resize.)
In the parent process we obtain the Surfaces that will be rendered in
to from the child SurfaceControls, and only send those Surfaces to the
GPU process. Thankfully unlike SurfaceControls, sending Surfaces
cross-process does not cause leaks. When the GPU process dies we
simply destroy all of the child SurfaceControls, and recreate them
again on-demand.
Differential Revision: https://phabricator.services.mozilla.com/D147437
Adds a GeckoView save to PDF API that can be used to save the current session’s page content to a PDF. The API returns a Java InputStream that can be used by the consumer to process the PDF.
Differential Revision: https://phabricator.services.mozilla.com/D146245
This is part 1 of the bug, it addresses the crush itself, and the weird case of BuildConfig.DEBUG being `true` in release builds (due to an external to gv bug).
There will be a follow up, in a separate bug, to address the actual flow (Web Extensions opening web pages in popups and how we want to handle that).
Differential Revision: https://phabricator.services.mozilla.com/D147456
This is a non-null field in the WebNotification standard as well as what we get from JS,
so we should be consistent with this behaviour in the Java land as well.
Differential Revision: https://phabricator.services.mozilla.com/D147238
Added thread safety tests for GeckoInputStream.java and removed Gecko
thread assertion on `appendBuffer` in GeckoInputStream.
Differential Revision: https://phabricator.services.mozilla.com/D147114
We used to get screen bounds from the gecko layer and needed to strip
the screen offsets for parent-relative offsets. It is now the opposite,
the bounds we get from gecko do not have the screen offsets of the top
View.
Differential Revision: https://phabricator.services.mozilla.com/D146508
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.
Differential Revision: https://phabricator.services.mozilla.com/D145351
This patch includes only the subset of D145687 changes related to the reworked JSONSchema data, plus some minor changes to Schemas.jsm to take the new
JSONSchema type ("PrivilegedPermissions") and the new custom JSONSchema keyword (the boolean "privileged" property used to identify manifest fields
only allowed in privileged extensions).
Besides the changes to the schema data, this patch is not expected to introduce any difference in behavior and so it could also land on its own
if needed (and the rest of the changes landed separately).
Differential Revision: https://phabricator.services.mozilla.com/D146800
For desktop this should basically have no impact (maybe impacts tab
warming, but if we wanted we could set the priority hint from the tab
switcher the same way we set renderLayers), but Fenix always has
renderLayers as true, effectively, so we were never de-prioritizing the
background tab processes.
Differential Revision: https://phabricator.services.mozilla.com/D145351
The android autofill framework requests a virtual structure for the webpage in
onProvideAutofillVirtualStructure and then at a later time will call autofill
when the user selects a value in the autofill app.
These method calls happen on the GeckoView, but our data is stored in the
GeckoSession (or rather, in the window that the GeckoSession represents).
Because of the asynchronicity of this process, we're not guaranteed that the
app hasn't switched the sesssion behind us in between the
onProvideAutofillVirtualStructure and autofill call, so we need to keep a
reference to the current autofill session when onProvide is called so that
we're sure that we are autofilling the right session.
We use a WeakReference to avoid keeping a window alive more than necessary, as
if the window is unloaded, there is no point in autofilling anyway.
Differential Revision: https://phabricator.services.mozilla.com/D146724
This patch includes only the subset of D145687 changes related to the reworked JSONSchema data, plus some minor changes to Schemas.jsm to take the new
JSONSchema type ("PrivilegedPermissions") and the new custom JSONSchema keyword (the boolean "privileged" property used to identify manifest fields
only allowed in privileged extensions).
Besides the changes to the schema data, this patch is not expected to introduce any difference in behavior and so it could also land on its own
if needed (and the rest of the changes landed separately).
Differential Revision: https://phabricator.services.mozilla.com/D146800
GeckoView is still using the deleted gl.msaa-level setting. As the rest of the engine does not use it,
modifying it basically became a noop. Replacing it by webgl.msaa-samples does the trick and allows
GeckoView clients to modify the antialiasing settings in WebGL.
Differential Revision: https://phabricator.services.mozilla.com/D146322
This is a kind of bug 1263887 for GeckoView.
We should update the prompt when child nodes in `<select>` element is modified.
I add `PromptInstanceDelegate.onPromptUpdate` to update the prompt's content.
Browser application should implement it if <select> element is updated during
showing the prompt.
Differential Revision: https://phabricator.services.mozilla.com/D144538
With Fission, `pageshow` and `pagehide` are not guaranteed to happen in order,
e.g. we might get the following order of events:
pageshow -- navigate to example.org
pageshow -- navigate to google.com
pagehide -- example.org is now hidden
which would break the previous assumption that we could rely on the order of
show and hide events.
To handle that, we keep track of the most-recent-added session and we assume
that that is the session bening displayed.
In the future, we might consider keeping state of all sessions until a
`pagehide` event for the specific session arrives.
Differential Revision: https://phabricator.services.mozilla.com/D143961
Before this patch, the autofill tree was mutable, which makes it hard to follow
updates and reason about state.
This change makes the autofill tree immutable and adds a separate `HashMap` to
track mutable values like `value`, `callback`.
This change also modifies the way we track nodes internally, using exclusevely
the UUID of the node rather then the int autofill ID which is now only used at
the boundary of the Autofill API.
We also simplify the API by only providing the necessary information about the
node rather than the entire tree structure.
Differential Revision: https://phabricator.services.mozilla.com/D143960
This is a minor API fix wherby we call `onSessionStart`, `onNodeAdd` instead of
having a single `onAutofill` call that passes in the type of call. This aligns
the API with all our other delegates.
Note that because this API is normally implemented inside GeckoView itself,
we dont expect any action on embedders for this change.
Differential Revision: https://phabricator.services.mozilla.com/D143959
The test failure in the bug is failing because the eventDispatcher in the actor
was previously only available in the top-level-frame.
In addition to adjusting for ActorDispatcher, this patch also makes every actor
handle its own frame (rather than handling all the in-process children) which
simplifies the code a bit.
We also modify the test to use a third-party iframe so that the OOP iframe case
is covered.
Differential Revision: https://phabricator.services.mozilla.com/D141647
ActorDispatcher does not support receiving multiple callbacks for one message
so we need to change the strategy a little bit.
We need to centralize handling actions are each sequential ID is incremented
independently for each child, so it won't work for iframes.
To avoid this problem in the future, the sequential ID is no just a
randomly-generated UUID.
We also do all the checking on the parent process, so we don't need to check in
the child again whether we got a message that was out-of-date.
Differential Revision: https://phabricator.services.mozilla.com/D141645
The existing EventDispatcher messaging infrastracture uses cpmm (content
process message manager) which is deprecated and will be removed for Fission.
The current behavior with fission is that cpmm is available only on in-frame
frames, so on any oop frame we're not able to send or receive eventDispatcher
messages.
To allow OOP frames actors to send messages, this patch implements a new type
of dispatcher, called ChildActorDispatcher which routes messages through the
actor messaging system.
We then catch these messages on the parent actor side and send them to Java.
To be able to reroute messages from the Parent actor we need to make sure that
each actor that we define extends GeckoViewActorParent, so we define an actor
parent for each missing child actor.
In the future we could consider moving GeckoViewActorParent to a native
implementation for performance reasons.
Differential Revision: https://phabricator.services.mozilla.com/D139073
With Fission, `pageshow` and `pagehide` are not guaranteed to happen in order,
e.g. we might get the following order of events:
pageshow -- navigate to example.org
pageshow -- navigate to google.com
pagehide -- example.org is now hidden
which would break the previous assumption that we could rely on the order of
show and hide events.
To handle that, we keep track of the most-recent-added session and we assume
that that is the session bening displayed.
In the future, we might consider keeping state of all sessions until a
`pagehide` event for the specific session arrives.
Differential Revision: https://phabricator.services.mozilla.com/D143961
Before this patch, the autofill tree was mutable, which makes it hard to follow
updates and reason about state.
This change makes the autofill tree immutable and adds a separate `HashMap` to
track mutable values like `value`, `callback`.
This change also modifies the way we track nodes internally, using exclusevely
the UUID of the node rather then the int autofill ID which is now only used at
the boundary of the Autofill API.
We also simplify the API by only providing the necessary information about the
node rather than the entire tree structure.
Differential Revision: https://phabricator.services.mozilla.com/D143960
This is a minor API fix wherby we call `onSessionStart`, `onNodeAdd` instead of
having a single `onAutofill` call that passes in the type of call. This aligns
the API with all our other delegates.
Note that because this API is normally implemented inside GeckoView itself,
we dont expect any action on embedders for this change.
Differential Revision: https://phabricator.services.mozilla.com/D143959
The test failure in the bug is failing because the eventDispatcher in the actor
was previously only available in the top-level-frame.
In addition to adjusting for ActorDispatcher, this patch also makes every actor
handle its own frame (rather than handling all the in-process children) which
simplifies the code a bit.
We also modify the test to use a third-party iframe so that the OOP iframe case
is covered.
Differential Revision: https://phabricator.services.mozilla.com/D141647
ActorDispatcher does not support receiving multiple callbacks for one message
so we need to change the strategy a little bit.
We need to centralize handling actions are each sequential ID is incremented
independently for each child, so it won't work for iframes.
To avoid this problem in the future, the sequential ID is no just a
randomly-generated UUID.
We also do all the checking on the parent process, so we don't need to check in
the child again whether we got a message that was out-of-date.
Differential Revision: https://phabricator.services.mozilla.com/D141645
The existing EventDispatcher messaging infrastracture uses cpmm (content
process message manager) which is deprecated and will be removed for Fission.
The current behavior with fission is that cpmm is available only on in-frame
frames, so on any oop frame we're not able to send or receive eventDispatcher
messages.
To allow OOP frames actors to send messages, this patch implements a new type
of dispatcher, called ChildActorDispatcher which routes messages through the
actor messaging system.
We then catch these messages on the parent actor side and send them to Java.
To be able to reroute messages from the Parent actor we need to make sure that
each actor that we define extends GeckoViewActorParent, so we define an actor
parent for each missing child actor.
In the future we could consider moving GeckoViewActorParent to a native
implementation for performance reasons.
Differential Revision: https://phabricator.services.mozilla.com/D139073
This allows us to replace a number of magic numbers in the
WebRequestError code with automatically generated constants which are
guaranteed to be kept up to date.
This build script is able to run early enough during the build step as
generated files which take a `.jinja` file as an argument are hard-coded
to be run during the pre-export phase for Android builds. As it is just
as simple python script with no other dependencies, this shouldn't
impact geckoview build performance even when using build artifacts.
Differential Revision: https://phabricator.services.mozilla.com/D146356
This occurs since newer GBoard's behaviour seems to be changed.
When `GeckoEditable` receives text change from Gecko, it is possible to remove
composing state if composition is started from first character.
If Gecko's text change by IME, we shouldn't reset text state in `onTextChange`.
`mCausedOnlyByComposition` means that this change is by IME.
Differential Revision: https://phabricator.services.mozilla.com/D146159