1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/MessageEvent.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * For more information on this interface, please see 1.10 + * http://www.whatwg.org/specs/web-apps/current-work/#messageevent 1.11 + */ 1.12 + 1.13 +interface WindowProxy; 1.14 + 1.15 +[Constructor(DOMString type, optional MessageEventInit eventInitDict)] 1.16 +interface MessageEvent : Event { 1.17 + /** 1.18 + * Custom data associated with this event. 1.19 + */ 1.20 + [GetterThrows] 1.21 + readonly attribute any data; 1.22 + 1.23 + /** 1.24 + * The origin of the site from which this event originated, which is the 1.25 + * scheme, ":", and if the URI has a host, "//" followed by the 1.26 + * host, and if the port is not the default for the given scheme, 1.27 + * ":" followed by that port. This value does not have a trailing slash. 1.28 + */ 1.29 + readonly attribute DOMString origin; 1.30 + 1.31 + /** 1.32 + * The last event ID string of the event source, for server-sent DOM events; this 1.33 + * value is the empty string for cross-origin messaging. 1.34 + */ 1.35 + readonly attribute DOMString lastEventId; 1.36 + 1.37 + /** 1.38 + * The window or the port which originated this event. 1.39 + */ 1.40 + readonly attribute (WindowProxy or MessagePort)? source; 1.41 + 1.42 + /** 1.43 + * Initializes this event with the given data, in a manner analogous to 1.44 + * the similarly-named method on the nsIDOMEvent interface, also setting the 1.45 + * data, origin, source, and lastEventId attributes of this appropriately. 1.46 + */ 1.47 + readonly attribute MessagePortList? ports; 1.48 +}; 1.49 + 1.50 +dictionary MessageEventInit : EventInit { 1.51 + any data; 1.52 + DOMString origin; 1.53 + DOMString lastEventId; 1.54 + (WindowProxy or MessagePort)? source = null; 1.55 + sequence<MessagePort>? ports; 1.56 +};