Bug 634435: Add a property to expose the current pushState-state. r=jlebar a=beltzner
[mozilla-central.git] / dom / interfaces / core / nsIDOMNSDocument.idl
blob861440217fc55ad7f6201ef00e1068cff9db30a7
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2000
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Vidur Apparao <vidur@netscape.com> (original author)
24 * Johnny Stenback <jst@netscape.com>
25 * Robert Sayre <sayrer@gmail.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
41 #include "domstubs.idl"
43 interface nsIBoxObject;
44 interface nsIDOMLocation;
45 interface nsIVariant;
47 [scriptable, uuid(92f2c6f8-3668-4a47-8251-2a900afe11fa)]
48 interface nsIDOMNSDocument : nsISupports
50 readonly attribute DOMString characterSet;
51 attribute DOMString dir;
53 readonly attribute nsIDOMLocation location;
55 attribute DOMString title;
57 readonly attribute DOMString contentType;
58 readonly attribute DOMString readyState;
59 readonly attribute DOMString lastModified;
60 readonly attribute DOMString referrer;
62 boolean hasFocus();
64 readonly attribute nsIDOMElement activeElement;
66 readonly attribute nsIDOMElement currentScript;
69 * Retrieve elements matching all classes listed in a
70 * space-separated string.
72 * See <http://whatwg.org/specs/web-apps/current-work/>
74 nsIDOMNodeList getElementsByClassName(in DOMString classes);
76 /**
77 * Returns the element from the caller's document at the given point,
78 * relative to the upper-left-most point in the (possibly scrolled)
79 * window or frame.
81 * If the element at the given point belongs to another document (such as
82 * an iframe's subdocument), the element in the calling document's DOM
83 * (e.g. the iframe) is returned. If the element at the given point is
84 * anonymous or XBL generated content, such as a textbox's scrollbars, then
85 * the first non-anonymous parent element (that is, the textbox) is returned.
87 * This method returns null if either coordinate is negative, or if the
88 * specified point lies outside the visible bounds of the document.
90 * Callers from XUL documents should wait until the onload event has fired
91 * before calling this method.
93 * See <http://www.w3.org/TR/cssom-view/#the-documentview-interface>
95 nsIDOMElement elementFromPoint(in float x, in float y);
97 /**
98 * Release the current mouse capture if it is on an element within this
99 * document.
101 void releaseCapture();
104 * Use the given DOM element as the source image of target |-moz-element()|.
106 * This function introduces a new special ID (called "image element ID"),
107 * which is only used by |-moz-element()|, and associates it with the given
108 * DOM element. Image elements ID's have the higher precedence than general
109 * HTML id's, so if |document.mozSetImageElement(<id>, <element>)| is called,
110 * |-moz-element(#<id>)| uses |<element>| as the source image even if there
111 * is another element with id attribute = |<id>|. To unregister an image
112 * element ID |<id>|, call |document.mozSetImageElement(<id>, null)|.
114 * Example:
115 * <script>
116 * canvas = document.createElement("canvas");
117 * canvas.setAttribute("width", 100);
118 * canvas.setAttribute("height", 100);
119 * // draw to canvas
120 * document.mozSetImageElement("canvasbg", canvas);
121 * </script>
122 * <div style="background-image: -moz-element(#canvasbg);"></div>
124 * @param aImageElementId an image element ID to associate with
125 * |aImageElement|
126 * @param aImageElement a DOM element to be used as the source image of
127 * |-moz-element(#aImageElementId)|. If this is null, the function will
128 * unregister the image element ID |aImageElementId|.
130 void mozSetImageElement(in DOMString aImageElementId,
131 in nsIDOMElement aImageElement);
134 [scriptable, uuid(fee67aed-3b94-4136-ad7d-fb88ef23f45f)]
135 interface nsIDOMNSDocument_MOZILLA_2_0_BRANCH : nsISupports
137 readonly attribute nsIVariant mozCurrentStateObject;