initial import
[vuplus_webkit] / Source / WebCore / dom / Element.idl
1 /*
2  * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3  * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 module core {
22
23     interface [
24         GenerateNativeConverter,
25         InlineGetOwnPropertySlot
26     ] Element : Node {
27
28         // DOM Level 1 Core
29
30         readonly attribute [ConvertNullStringTo=Null] DOMString tagName;
31
32         [ConvertNullStringTo=Null] DOMString getAttribute(in [Optional=CallWithDefaultValue] DOMString name);
33         [OldStyleObjC] void setAttribute(in [Optional=CallWithDefaultValue] DOMString name,
34                                          in [Optional=CallWithDefaultValue] DOMString value)
35             raises(DOMException);
36         void removeAttribute(in [Optional=CallWithDefaultValue] DOMString name)
37             raises(DOMException);
38         Attr getAttributeNode(in [Optional=CallWithDefaultValue] DOMString name);
39         Attr setAttributeNode(in [Optional=CallWithDefaultValue] Attr newAttr)
40             raises(DOMException);
41         Attr removeAttributeNode(in [Optional=CallWithDefaultValue] Attr oldAttr)
42             raises(DOMException);
43         NodeList getElementsByTagName(in [Optional=CallWithDefaultValue] DOMString name);
44
45         // DOM Level 2 Core
46
47         [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI,
48                                                 in [Optional=CallWithDefaultValue] DOMString localName);
49         [OldStyleObjC] void setAttributeNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI,
50                                            in [Optional=CallWithDefaultValue] DOMString qualifiedName, 
51                                            in [Optional=CallWithDefaultValue] DOMString value)
52             raises(DOMException);
53         [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
54                                               in DOMString localName)
55             raises(DOMException);
56         [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI,
57                                                        in [Optional=CallWithDefaultValue] DOMString localName);
58         [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI,
59                                                in [Optional=CallWithDefaultValue] DOMString localName);
60         Attr setAttributeNodeNS(in [Optional=CallWithDefaultValue] Attr newAttr)
61             raises(DOMException);
62         boolean hasAttribute(in DOMString name);
63         [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI,
64                                               in [Optional=CallWithDefaultValue] DOMString localName);
65
66         readonly attribute CSSStyleDeclaration style;
67
68         // Common extensions
69
70         readonly attribute long offsetLeft;
71         readonly attribute long offsetTop;
72         readonly attribute long offsetWidth;
73         readonly attribute long offsetHeight;
74         readonly attribute Element offsetParent;
75         readonly attribute long clientLeft;
76         readonly attribute long clientTop;
77         readonly attribute long clientWidth;
78         readonly attribute long clientHeight;
79                  attribute long scrollLeft;
80                  attribute long scrollTop;
81         readonly attribute long scrollWidth;
82         readonly attribute long scrollHeight;
83
84         void focus();
85         void blur();
86         void scrollIntoView(in [Optional] boolean alignWithTop);
87
88         // WebKit extensions
89
90         void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
91         void scrollByLines(in [Optional=CallWithDefaultValue] long lines);
92         void scrollByPages(in [Optional=CallWithDefaultValue] long pages);
93
94 #if defined(ENABLE_ANIMATION_API) && ENABLE_ANIMATION_API
95         WebKitAnimationList webkitGetAnimations();
96 #endif
97
98         // HTML 5
99         NodeList getElementsByClassName(in [Optional=CallWithDefaultValue] DOMString name);
100
101 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
102         readonly attribute DOMStringMap dataset;
103 #endif
104
105         // NodeSelector - Selector API
106         Element querySelector(in DOMString selectors)
107             raises(DOMException);
108         NodeList querySelectorAll(in DOMString selectors)
109             raises(DOMException);
110
111         // WebKit extension, pending specification.
112         boolean webkitMatchesSelector(in [Optional=CallWithDefaultValue] DOMString selectors)
113             raises(DOMException);
114
115         // ElementTraversal API
116         readonly attribute Element firstElementChild;
117         readonly attribute Element lastElementChild;
118         readonly attribute Element previousElementSibling;
119         readonly attribute Element nextElementSibling;
120         readonly attribute unsigned long childElementCount;
121
122 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
123         // CSSOM View Module API
124         ClientRectList getClientRects();
125         ClientRect getBoundingClientRect();
126 #endif
127
128 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
129         // Objective-C extensions
130         readonly attribute DOMString innerText;
131 #endif
132
133 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
134         const unsigned short ALLOW_KEYBOARD_INPUT = 1;
135         [EnabledAtRuntime] void webkitRequestFullScreen(in [Optional=CallWithDefaultValue] unsigned short flags);
136 #endif
137
138 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
139         // Event handler DOM attributes
140         attribute [DontEnum] EventListener onabort;
141         attribute [DontEnum] EventListener onblur;
142         attribute [DontEnum] EventListener onchange;
143         attribute [DontEnum] EventListener onclick;
144         attribute [DontEnum] EventListener oncontextmenu;
145         attribute [DontEnum] EventListener ondblclick;
146         attribute [DontEnum] EventListener ondrag;
147         attribute [DontEnum] EventListener ondragend;
148         attribute [DontEnum] EventListener ondragenter;
149         attribute [DontEnum] EventListener ondragleave;
150         attribute [DontEnum] EventListener ondragover;
151         attribute [DontEnum] EventListener ondragstart;
152         attribute [DontEnum] EventListener ondrop;
153         attribute [DontEnum] EventListener onerror;
154         attribute [DontEnum] EventListener onfocus;
155         attribute [DontEnum] EventListener oninput;
156         attribute [DontEnum] EventListener oninvalid;
157         attribute [DontEnum] EventListener onkeydown;
158         attribute [DontEnum] EventListener onkeypress;
159         attribute [DontEnum] EventListener onkeyup;
160         attribute [DontEnum] EventListener onload;
161         attribute [DontEnum] EventListener onmousedown;
162         attribute [DontEnum] EventListener onmousemove;
163         attribute [DontEnum] EventListener onmouseout;
164         attribute [DontEnum] EventListener onmouseover;
165         attribute [DontEnum] EventListener onmouseup;
166         attribute [DontEnum] EventListener onmousewheel;
167         attribute [DontEnum] EventListener onscroll;
168         attribute [DontEnum] EventListener onselect;
169         attribute [DontEnum] EventListener onsubmit;
170
171         // attribute [DontEnum] EventListener oncanplay;
172         // attribute [DontEnum] EventListener oncanplaythrough;
173         // attribute [DontEnum] EventListener ondurationchange;
174         // attribute [DontEnum] EventListener onemptied;
175         // attribute [DontEnum] EventListener onended;
176         // attribute [DontEnum] EventListener onloadeddata;
177         // attribute [DontEnum] EventListener onloadedmetadata;
178         // attribute [DontEnum] EventListener onloadstart;
179         // attribute [DontEnum] EventListener onpause;
180         // attribute [DontEnum] EventListener onplay;
181         // attribute [DontEnum] EventListener onplaying;
182         // attribute [DontEnum] EventListener onprogress;
183         // attribute [DontEnum] EventListener onratechange;
184         // attribute [DontEnum] EventListener onreadystatechange;
185         // attribute [DontEnum] EventListener onseeked;
186         // attribute [DontEnum] EventListener onseeking;
187         // attribute [DontEnum] EventListener onshow;
188         // attribute [DontEnum] EventListener onstalled;
189         // attribute [DontEnum] EventListener onsuspend;
190         // attribute [DontEnum] EventListener ontimeupdate;
191         // attribute [DontEnum] EventListener onvolumechange;
192         // attribute [DontEnum] EventListener onwaiting;
193
194         // WebKit extensions
195         attribute [DontEnum] EventListener onbeforecut;
196         attribute [DontEnum] EventListener oncut;
197         attribute [DontEnum] EventListener onbeforecopy;
198         attribute [DontEnum] EventListener oncopy;
199         attribute [DontEnum] EventListener onbeforepaste;
200         attribute [DontEnum] EventListener onpaste;
201         attribute [DontEnum] EventListener onreset;
202         attribute [DontEnum] EventListener onsearch;
203         attribute [DontEnum] EventListener onselectstart;
204         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart;
205         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove;
206         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
207         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
208         attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange;
209 #endif
210     };
211
212 }