Bug 811646 - Split big base installer download into multiple HTTP range requests...
[gecko.git] / dom / webidl / Element.webidl
blob05898bcfbe2f4ca7d9057033a3a1a0da1aa19764
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  * http://dom.spec.whatwg.org/#element and
8  * http://domparsing.spec.whatwg.org/ and
9  * http://dev.w3.org/csswg/cssom-view/ and
10  * http://www.w3.org/TR/selectors-api/
11  *
12  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
13  * liability, trademark and document use rules apply.
14  */
16 interface Attr;
17 interface NamedNodeMap;
19 interface Element : Node {
21   We haven't moved these from Node to Element like the spec wants.
23   [Throws]
24   readonly attribute DOMString? namespaceURI;
25   readonly attribute DOMString? prefix;
26   readonly attribute DOMString localName;
28   readonly attribute DOMString tagName;
30            attribute DOMString id;
32   FIXME Bug 810677 Move className from HTMLElement to Element
33            attribute DOMString className;
35   readonly attribute DOMTokenList classList;
37   //readonly attribute Attr[] attributes;
38   DOMString? getAttribute(DOMString name);
39   DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
40   [Throws]
41   void setAttribute(DOMString name, DOMString value);
42   [Throws]
43   void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
44   [Throws]
45   void removeAttribute(DOMString name);
46   [Throws]
47   void removeAttributeNS(DOMString? namespace, DOMString localName);
48   boolean hasAttribute(DOMString name);
49   boolean hasAttributeNS(DOMString? namespace, DOMString localName);
51   HTMLCollection getElementsByTagName(DOMString localName);
52   [Throws]
53   HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
54   HTMLCollection getElementsByClassName(DOMString classNames);
56   readonly attribute HTMLCollection children;
57   readonly attribute Element? firstElementChild;
58   readonly attribute Element? lastElementChild;
59   readonly attribute Element? previousElementSibling;
60   readonly attribute Element? nextElementSibling;
61   readonly attribute unsigned long childElementCount;
63   // NEW
65   FIXME We haven't implemented these yet.
67   void prepend((Node or DOMString)... nodes);
68   void append((Node or DOMString)... nodes);
69   void before((Node or DOMString)... nodes);
70   void after((Node or DOMString)... nodes);
71   void replace((Node or DOMString)... nodes);
72   void remove();
75   // Mozilla specific stuff
77   // Selectors API
78   /**
79    * Returns whether this element would be selected by the given selector
80    * string.
81    *
82    * See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
83    */
84   [Throws]
85   boolean mozMatchesSelector(DOMString selector);
87   // Proprietary extensions
88   /**
89    * Set this during a mousedown event to grab and retarget all mouse events
90    * to this element until the mouse button is released or releaseCapture is
91    * called. If retargetToElement is true, then all events are targetted at
92    * this element. If false, events can also fire at descendants of this
93    * element.
94    * 
95    */
96   void setCapture(optional boolean retargetToElement = false);
98   /**
99    * If this element has captured the mouse, release the capture. If another
100    * element has captured the mouse, this method has no effect.
101    */
102   void releaseCapture();
104   // Mozilla extensions
105   /**
106    * Requests that this element be made the full-screen element, as per the DOM
107    * full-screen api.
108    *
109    * @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
110    */
111   void mozRequestFullScreen();
113   /**
114    * Requests that this element be made the pointer-locked element, as per the DOM
115    * pointer lock api.
116    *
117    * @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
118    */
119   void mozRequestPointerLock();
121   // Obsolete methods.
122   Attr getAttributeNode(DOMString name);
123   [Throws]
124   Attr setAttributeNode(Attr newAttr);
125   [Throws]
126   Attr removeAttributeNode(Attr oldAttr);
127   [Throws]
128   Attr getAttributeNodeNS(DOMString namespaceURI, DOMString localName);
129   [Throws]
130   Attr setAttributeNodeNS(Attr newAttr);
134 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
135 partial interface Element {
137   [Throws]
138   ClientRectList getClientRects();
139   ClientRect getBoundingClientRect();
141   // scrolling
142   void scrollIntoView(optional boolean top = true);
143            attribute long scrollTop;   // scroll on setting
144            attribute long scrollLeft;  // scroll on setting
145   readonly attribute long scrollWidth;
146   readonly attribute long scrollHeight;
148   readonly attribute long clientTop;
149   readonly attribute long clientLeft;
150   readonly attribute long clientWidth;
151   readonly attribute long clientHeight;
153   // Mozilla specific stuff
154   /* The maximum offset that the element can be scrolled to
155      (i.e., the value that scrollLeft/scrollTop would be clamped to if they were
156      set to arbitrarily large values. */
157   readonly attribute long scrollTopMax;
158   readonly attribute long scrollLeftMax;
162 enum insertAdjacentHTMLPosition {
163   "beforebegin",
164   "afterbegin",
165   "beforeend",
166   "afterend"
169 // http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
170 partial interface Element {
171   [Throws]
172   attribute DOMString innerHTML;
173   [Throws]
174   attribute DOMString outerHTML;
175   [Throws]
176   void insertAdjacentHTML(insertAdjacentHTMLPosition position, DOMString text);
179 // http://www.w3.org/TR/selectors-api/#interface-definitions
180 partial interface Element {
182   [Throws]
183   Element?  querySelector(DOMString selectors);
184   [Throws]
185   NodeList  querySelectorAll(DOMString selectors);