mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1885294 - P1. Change message prefix used in AutoComplete.mjs from FormAutoComplete
to AutoComplete
r=credential-management-reviewers,jneuberger
Differential Revision: https://phabricator.services.mozilla.com/D204599
This commit is contained in:
parent
483571a1b2
commit
192b1e23cf
@ -595,7 +595,7 @@ function waitPopupStateInChild(bc, messageName) {
|
||||
async function openPopupOn(browser, selector) {
|
||||
let childNotifiedPromise = waitPopupStateInChild(
|
||||
browser,
|
||||
"FormAutoComplete:PopupOpened"
|
||||
"AutoComplete:PopupOpened"
|
||||
);
|
||||
await SimpleTest.promiseFocus(browser);
|
||||
|
||||
@ -613,7 +613,7 @@ async function openPopupOn(browser, selector) {
|
||||
async function openPopupOnSubframe(browser, frameBrowsingContext, selector) {
|
||||
let childNotifiedPromise = waitPopupStateInChild(
|
||||
frameBrowsingContext,
|
||||
"FormAutoComplete:PopupOpened"
|
||||
"AutoComplete:PopupOpened"
|
||||
);
|
||||
|
||||
await SimpleTest.promiseFocus(browser);
|
||||
@ -637,7 +637,7 @@ async function closePopup(browser) {
|
||||
|
||||
let childNotifiedPromise = waitPopupStateInChild(
|
||||
browser,
|
||||
"FormAutoComplete:PopupClosed"
|
||||
"AutoComplete:PopupClosed"
|
||||
);
|
||||
let popupClosePromise = BrowserTestUtils.waitForPopupEvent(
|
||||
browser.autoCompletePopup,
|
||||
@ -655,7 +655,7 @@ async function closePopup(browser) {
|
||||
async function closePopupForSubframe(browser, frameBrowsingContext) {
|
||||
let childNotifiedPromise = waitPopupStateInChild(
|
||||
browser,
|
||||
"FormAutoComplete:PopupClosed"
|
||||
"AutoComplete:PopupClosed"
|
||||
);
|
||||
|
||||
let popupClosePromise = BrowserTestUtils.waitForPopupEvent(
|
||||
|
@ -33,7 +33,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
|
||||
receiveMessage(message) {
|
||||
switch (message.name) {
|
||||
case "FormAutoComplete:HandleEnter": {
|
||||
case "AutoComplete:HandleEnter": {
|
||||
this.selectedIndex = message.data.selectedIndex;
|
||||
|
||||
let controller = Cc[
|
||||
@ -43,22 +43,22 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:PopupClosed": {
|
||||
case "AutoComplete:PopupClosed": {
|
||||
this._popupOpen = false;
|
||||
this.notifyListeners(message.name, message.data);
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:PopupOpened": {
|
||||
case "AutoComplete:PopupOpened": {
|
||||
this._popupOpen = true;
|
||||
this.notifyListeners(message.name, message.data);
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:Focus": {
|
||||
case "AutoComplete:Focus": {
|
||||
// XXX See bug 1582722
|
||||
// Before bug 1573836, the messages here didn't match
|
||||
// ("FormAutoComplete:Focus" versus "FormAutoComplete:RequestFocus")
|
||||
// ("AutoComplete:Focus" versus "AutoComplete:RequestFocus")
|
||||
// so this was never called. However this._input is actually a
|
||||
// nsIAutoCompleteInput, which doesn't have a focus() method, so it
|
||||
// wouldn't have worked anyway. So for now, I have just disabled this.
|
||||
@ -87,7 +87,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
}
|
||||
|
||||
set selectedIndex(index) {
|
||||
this.sendAsyncMessage("FormAutoComplete:SetSelectedIndex", { index });
|
||||
this.sendAsyncMessage("AutoComplete:SetSelectedIndex", { index });
|
||||
}
|
||||
|
||||
get selectedIndex() {
|
||||
@ -98,7 +98,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
// selectedIndex is trivial to catch (e.g. moving the mouse over the
|
||||
// list).
|
||||
let selectedIndexResult = Services.cpmm.sendSyncMessage(
|
||||
"FormAutoComplete:GetSelectedIndex",
|
||||
"AutoComplete:GetSelectedIndex",
|
||||
{
|
||||
browsingContext: this.browsingContext,
|
||||
}
|
||||
@ -131,7 +131,7 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
);
|
||||
let inputElementIdentifier = lazy.ContentDOMReference.get(element);
|
||||
|
||||
this.sendAsyncMessage("FormAutoComplete:MaybeOpenPopup", {
|
||||
this.sendAsyncMessage("AutoComplete:MaybeOpenPopup", {
|
||||
results,
|
||||
rect,
|
||||
dir,
|
||||
@ -148,18 +148,18 @@ export class AutoCompleteChild extends JSWindowActorChild {
|
||||
// up in a state where the content thinks that a popup
|
||||
// is open when it isn't (or soon won't be).
|
||||
this._popupOpen = false;
|
||||
this.sendAsyncMessage("FormAutoComplete:ClosePopup", {});
|
||||
this.sendAsyncMessage("AutoComplete:ClosePopup", {});
|
||||
}
|
||||
|
||||
invalidate() {
|
||||
if (this._popupOpen) {
|
||||
let results = this.getResultsFromController(this._input);
|
||||
this.sendAsyncMessage("FormAutoComplete:Invalidate", { results });
|
||||
this.sendAsyncMessage("AutoComplete:Invalidate", { results });
|
||||
}
|
||||
}
|
||||
|
||||
selectBy(reverse, page) {
|
||||
Services.cpmm.sendSyncMessage("FormAutoComplete:SelectBy", {
|
||||
Services.cpmm.sendSyncMessage("AutoComplete:SelectBy", {
|
||||
browsingContext: this.browsingContext,
|
||||
reverse,
|
||||
page,
|
||||
|
@ -41,21 +41,18 @@ function compareContext(message) {
|
||||
// The browsingContext within the message data is either the one that has
|
||||
// the active autocomplete popup or the top-level of the one that has
|
||||
// the active autocomplete popup.
|
||||
Services.ppmm.addMessageListener(
|
||||
"FormAutoComplete:GetSelectedIndex",
|
||||
message => {
|
||||
if (compareContext(message)) {
|
||||
let actor = currentActor;
|
||||
if (actor && actor.openedPopup) {
|
||||
return actor.openedPopup.selectedIndex;
|
||||
}
|
||||
Services.ppmm.addMessageListener("AutoComplete:GetSelectedIndex", message => {
|
||||
if (compareContext(message)) {
|
||||
let actor = currentActor;
|
||||
if (actor && actor.openedPopup) {
|
||||
return actor.openedPopup.selectedIndex;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
);
|
||||
|
||||
Services.ppmm.addMessageListener("FormAutoComplete:SelectBy", message => {
|
||||
return -1;
|
||||
});
|
||||
|
||||
Services.ppmm.addMessageListener("AutoComplete:SelectBy", message => {
|
||||
if (compareContext(message)) {
|
||||
let actor = currentActor;
|
||||
if (actor && actor.openedPopup) {
|
||||
@ -174,7 +171,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
handleEvent(evt) {
|
||||
switch (evt.type) {
|
||||
case "popupshowing": {
|
||||
this.sendAsyncMessage("FormAutoComplete:PopupOpened", {});
|
||||
this.sendAsyncMessage("AutoComplete:PopupOpened", {});
|
||||
break;
|
||||
}
|
||||
|
||||
@ -188,7 +185,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
selectedIndex != -1
|
||||
? AutoCompleteResultView.getStyleAt(selectedIndex)
|
||||
: "";
|
||||
this.sendAsyncMessage("FormAutoComplete:PopupClosed", {
|
||||
this.sendAsyncMessage("AutoComplete:PopupClosed", {
|
||||
selectedRowComment,
|
||||
selectedRowStyle,
|
||||
});
|
||||
@ -397,7 +394,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
}
|
||||
|
||||
switch (message.name) {
|
||||
case "FormAutoComplete:SetSelectedIndex": {
|
||||
case "AutoComplete:SetSelectedIndex": {
|
||||
let { index } = message.data;
|
||||
if (this.openedPopup) {
|
||||
this.openedPopup.selectedIndex = index;
|
||||
@ -405,7 +402,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:MaybeOpenPopup": {
|
||||
case "AutoComplete:MaybeOpenPopup": {
|
||||
let { results, rect, dir, inputElementIdentifier, formOrigin } =
|
||||
message.data;
|
||||
if (lazy.DELEGATE_AUTOCOMPLETE) {
|
||||
@ -422,13 +419,13 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:Invalidate": {
|
||||
case "AutoComplete:Invalidate": {
|
||||
let { results } = message.data;
|
||||
this.invalidate(results);
|
||||
break;
|
||||
}
|
||||
|
||||
case "FormAutoComplete:ClosePopup": {
|
||||
case "AutoComplete:ClosePopup": {
|
||||
if (lazy.DELEGATE_AUTOCOMPLETE) {
|
||||
lazy.GeckoViewAutocomplete.delegateDismiss();
|
||||
break;
|
||||
@ -489,7 +486,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
*/
|
||||
handleEnter(aIsPopupSelection) {
|
||||
if (this.openedPopup) {
|
||||
this.sendAsyncMessage("FormAutoComplete:HandleEnter", {
|
||||
this.sendAsyncMessage("AutoComplete:HandleEnter", {
|
||||
selectedIndex: this.openedPopup.selectedIndex,
|
||||
isPopupSelection: aIsPopupSelection,
|
||||
});
|
||||
@ -507,7 +504,7 @@ export class AutoCompleteParent extends JSWindowActorParent {
|
||||
// disabled.
|
||||
/*
|
||||
if (this.openedPopup) {
|
||||
this.sendAsyncMessage("FormAutoComplete:Focus");
|
||||
this.sendAsyncMessage("AutoComplete:Focus");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ export class FormAutofillChild extends JSWindowActorChild {
|
||||
const { chromeEventHandler } = docShell;
|
||||
|
||||
switch (messageName) {
|
||||
case "FormAutoComplete:PopupClosed": {
|
||||
case "AutoComplete:PopupClosed": {
|
||||
this.onPopupClosed(data.selectedRowStyle);
|
||||
Services.tm.dispatchToMainThread(() => {
|
||||
chromeEventHandler.removeEventListener("keydown", this, true);
|
||||
@ -148,7 +148,7 @@ export class FormAutofillChild extends JSWindowActorChild {
|
||||
|
||||
break;
|
||||
}
|
||||
case "FormAutoComplete:PopupOpened": {
|
||||
case "AutoComplete:PopupOpened": {
|
||||
this.onPopupOpened();
|
||||
chromeEventHandler.addEventListener("keydown", this, true);
|
||||
break;
|
||||
|
@ -127,8 +127,8 @@ let JSWINDOWACTORS = {
|
||||
esModuleURI: "resource://gre/actors/AutoCompleteParent.sys.mjs",
|
||||
// These two messages are also used, but are currently synchronous calls
|
||||
// through the per-process message manager.
|
||||
// "FormAutoComplete:GetSelectedIndex",
|
||||
// "FormAutoComplete:SelectBy"
|
||||
// "AutoComplete:GetSelectedIndex",
|
||||
// "AutoComplete:SelectBy"
|
||||
},
|
||||
|
||||
child: {
|
||||
|
Loading…
Reference in New Issue
Block a user