1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/base/nsIDOMJSWindow.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,79 @@ 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 +#include "domstubs.idl" 1.10 + 1.11 +[scriptable, uuid(4237c376-d637-4b6e-9f8a-1da57e867834)] 1.12 +interface nsIDOMJSWindow : nsISupports 1.13 +{ 1.14 + void dump(in DOMString str); 1.15 + 1.16 + /** 1.17 + * These methods take typeless arguments and optional arguments, the 1.18 + * first argument is either a function or a string, the second 1.19 + * argument must be a number (ms) and the rest of the arguments (2 1.20 + * ... n) are passed to the callback function 1.21 + */ 1.22 + long setTimeout(); 1.23 + long setInterval(); 1.24 + 1.25 + /** 1.26 + * These methods take one optional argument that's the timer ID to 1.27 + * clear. Often in existing code these methods are passed undefined, 1.28 + * which is a nop so we need to support that as well. 1.29 + */ 1.30 + void clearTimeout([optional] in long handle); 1.31 + void clearInterval([optional] in long handle); 1.32 + 1.33 + /** 1.34 + * This method is here for backwards compatibility with 4.x only, 1.35 + * its implementation is a no-op 1.36 + */ 1.37 + void setResizable(in boolean resizable); 1.38 + 1.39 + /** 1.40 + * @deprecated These are old Netscape 4 methods. Do not use, 1.41 + * the implementation is no-op. 1.42 + */ 1.43 + void captureEvents(); 1.44 + void releaseEvents(); 1.45 + 1.46 + /** 1.47 + * This is the scriptable version of nsIDOMWindow::open() 1.48 + * that takes 3 optional arguments. Its binary name is OpenJS to 1.49 + * avoid colliding with nsIDOMWindow::open(), which has the 1.50 + * same signature. The reason we can't have that collision is that 1.51 + * the implementation needs to know whether it was called from JS or 1.52 + * not. 1.53 + * 1.54 + * IOW, DO NOT CALL THIS FROM C++ 1.55 + */ 1.56 + [binaryname(OpenJS)] nsIDOMWindow open([optional] in DOMString url, 1.57 + [optional] in DOMString name, 1.58 + [optional] in DOMString options); 1.59 + 1.60 + /** 1.61 + * This is the scriptable version of 1.62 + * nsIDOMWindow::openDialog() that takes 3 optional 1.63 + * arguments, plus any additional arguments are passed on as 1.64 + * arguments on the dialog's window object (window.arguments). 1.65 + */ 1.66 + nsIDOMWindow openDialog([optional] in DOMString url, 1.67 + [optional] in DOMString name, 1.68 + [optional] in DOMString options); 1.69 + 1.70 + /** 1.71 + * window.frames in Netscape 4.x and IE is just a reference to the 1.72 + * window itself (i.e. window.frames === window), but this doesn't 1.73 + * make sense from a generic API point of view so that's why this is 1.74 + * JS specific. 1.75 + * 1.76 + * This property is "replaceable" in JavaScript. 1.77 + */ 1.78 + readonly attribute nsIDOMWindow frames; 1.79 + 1.80 + [implicit_jscontext, binaryname(ScriptableContent)] 1.81 + readonly attribute jsval content; 1.82 +};