1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * The origin of this IDL file is
7 * https://w3c.github.io/presentation-api/#interface-presentationconnectioncloseevent
8 */
9
10enum PresentationConnectionClosedReason
11{
12  // The communication encountered an unrecoverable error.
13  "error",
14
15  // |PresentationConnection.close()| is called by controlling browsing context
16  // or the receiving browsing context.
17  "closed",
18
19  // The connection is closed because the destination browsing context
20  // that owned the connection navigated or was discarded.
21  "wentaway"
22};
23
24[Constructor(DOMString type,
25             PresentationConnectionCloseEventInit eventInitDict),
26 Pref="dom.presentation.enabled"]
27interface PresentationConnectionCloseEvent : Event
28{
29  readonly attribute PresentationConnectionClosedReason reason;
30
31  // The message is a human readable description of
32  // how the communication channel encountered an error.
33  // It is empty when the closed reason is closed or wentaway.
34  readonly attribute DOMString message;
35};
36
37dictionary PresentationConnectionCloseEventInit : EventInit
38{
39  required PresentationConnectionClosedReason reason;
40  DOMString message = "";
41};
42