Bug 1845599 - Skip tests for private identifiers in decorators; r=mgaudet
[gecko.git] / toolkit / actors / BrowserElementChild.sys.mjs
blob97e1327821085fcf18868cc9053a3fc1d2dfc175
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 export class BrowserElementChild extends JSWindowActorChild {
7   handleEvent(event) {
8     if (
9       event.type == "DOMWindowClose" &&
10       !this.manager.browsingContext.parent
11     ) {
12       this.sendAsyncMessage("DOMWindowClose", {});
13     }
14   }
16   receiveMessage(message) {
17     switch (message.name) {
18       case "EnterModalState": {
19         this.contentWindow.windowUtils.enterModalState();
20         break;
21       }
23       case "LeaveModalState": {
24         if (
25           !message.data.forceLeave &&
26           !this.contentWindow.windowUtils.isInModalState()
27         ) {
28           break;
29         }
30         this.contentWindow.windowUtils.leaveModalState();
31         break;
32       }
33     }
34   }