Bug 1886904 - Use AppConstants instead of prefs to decide when to delegate autocomplete to GeckoView r=geckoview-reviewers,credential-management-reviewers,dimi,m_kato

Disabling this pref breaks autocomplete in GeckoView, it's not a useful configuration at all.

Differential Revision: https://phabricator.services.mozilla.com/D239273
This commit is contained in:
Gregory Pappas
2025-02-26 02:44:56 +00:00
parent d3459d0494
commit 9c70c467d2
3 changed files with 5 additions and 23 deletions

View File

@@ -399,9 +399,6 @@ pref("signon.firefoxRelay.feature", "not available");
pref("signon.showAutoCompleteFooter", true);
// Delegate autocomplete to GeckoView (bug 1618058)
pref("toolkit.autocomplete.delegate", true);
// Locked because any other value would break GeckoView
pref("toolkit.defaultChromeURI", "chrome://geckoview/content/geckoview.xhtml", locked);

View File

@@ -2,17 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"DELEGATE_AUTOCOMPLETE",
"toolkit.autocomplete.delegate",
false
);
ChromeUtils.defineESModuleGetters(lazy, {
GeckoViewAutocomplete: "resource://gre/modules/GeckoViewAutocomplete.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
@@ -378,7 +371,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
if (
!browser ||
(!lazy.DELEGATE_AUTOCOMPLETE && !browser.autoCompletePopup)
(!AppConstants.MOZ_GECKOVIEW && !browser.autoCompletePopup)
) {
// If there is no browser or popup, just make sure that the popup has been closed.
if (this.openedPopup) {
@@ -414,7 +407,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
case "AutoComplete:MaybeOpenPopup": {
let { results, rect, dir, inputElementIdentifier, formOrigin } =
message.data;
if (lazy.DELEGATE_AUTOCOMPLETE) {
if (AppConstants.MOZ_GECKOVIEW) {
lazy.GeckoViewAutocomplete.delegateSelection({
browsingContext: this.browsingContext,
options: results,
@@ -439,7 +432,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
}
case "AutoComplete:ClosePopup": {
if (lazy.DELEGATE_AUTOCOMPLETE) {
if (AppConstants.MOZ_GECKOVIEW) {
lazy.GeckoViewAutocomplete.delegateDismiss();
break;
}

View File

@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
const lazy = {};
@@ -26,13 +25,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
FORM_SUBMISSION_REASON: "resource://gre/actors/FormHandlerChild.sys.mjs",
});
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"DELEGATE_AUTOCOMPLETE",
"toolkit.autocomplete.delegate",
false
);
/**
* Handles content's interactions for the frame.
*/
@@ -413,7 +405,7 @@ export class FormAutofillChild extends JSWindowActorChild {
}
if (
lazy.DELEGATE_AUTOCOMPLETE ||
AppConstants.MOZ_GECKOVIEW ||
!lazy.FormAutofillContent.savedFieldNames
) {
this.debug("onFocusIn: savedFieldNames are not known yet");