1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/EventSource.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 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 + * The origin of this IDL file is 1.10 + * http://www.whatwg.org/specs/web-apps/current-work/ 1.11 + * 1.12 + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and 1.13 + * Opera Software ASA. You are granted a license to use, reproduce 1.14 + * and create derivative works of this document. 1.15 + */ 1.16 + 1.17 +[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), 1.18 + Func="mozilla::dom::EventSource::PrefEnabled"] 1.19 +interface EventSource : EventTarget { 1.20 + [Constant] 1.21 + readonly attribute DOMString url; 1.22 + [Constant] 1.23 + readonly attribute boolean withCredentials; 1.24 + 1.25 + // ready state 1.26 + const unsigned short CONNECTING = 0; 1.27 + const unsigned short OPEN = 1; 1.28 + const unsigned short CLOSED = 2; 1.29 + readonly attribute unsigned short readyState; 1.30 + 1.31 + // networking 1.32 + attribute EventHandler onopen; 1.33 + attribute EventHandler onmessage; 1.34 + attribute EventHandler onerror; 1.35 + void close(); 1.36 +}; 1.37 + 1.38 +dictionary EventSourceInit { 1.39 + boolean withCredentials = false; 1.40 +};