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