Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / toolkit / actors / InlineSpellCheckerParent.sys.mjs
blobff5f55724e7d7602042cff7740bfce788abb2f32
1 /* -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- */
2 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 export class InlineSpellCheckerParent extends JSWindowActorParent {
8   selectDictionaries({ localeCodes }) {
9     this.sendAsyncMessage("InlineSpellChecker:selectDictionaries", {
10       localeCodes,
11     });
12   }
14   replaceMisspelling({ suggestion }) {
15     this.sendAsyncMessage("InlineSpellChecker:replaceMisspelling", {
16       suggestion,
17     });
18   }
20   toggleEnabled() {
21     this.sendAsyncMessage("InlineSpellChecker:toggleEnabled", {});
22   }
24   recheckSpelling() {
25     this.sendAsyncMessage("InlineSpellChecker:recheck", {});
26   }
28   uninit() {
29     // This method gets called by InlineSpellChecker when the context menu
30     // goes away and the InlineSpellChecker instance is still alive.
31     // Stop referencing it and tidy the child end of us.
32     this.sendAsyncMessage("InlineSpellChecker:uninit", {});
33   }
35   _destructionObservers = new Set();
36   registerDestructionObserver(obj) {
37     this._destructionObservers.add(obj);
38   }
40   unregisterDestructionObserver(obj) {
41     this._destructionObservers.delete(obj);
42   }
44   didDestroy() {
45     for (let obs of this._destructionObservers) {
46       obs.actorDestroyed(this);
47     }
48     this._destructionObservers = null;
49   }