|
1 /* |
|
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
|
3 * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> |
|
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 CustomToJS, |
|
25 GenerateNativeConverter, |
|
26 CustomMarkFunction, |
|
27 InlineGetOwnPropertySlot |
|
28 ] Document : Node { |
|
29 |
|
30 // DOM Level 1 Core |
|
31 readonly attribute DocumentType doctype; |
|
32 readonly attribute [V8Custom] DOMImplementation implementation; |
|
33 readonly attribute Element documentElement; |
|
34 |
|
35 [ReturnsNew] Element createElement(in [ConvertNullToNullString] DOMString tagName) |
|
36 raises (DOMException); |
|
37 DocumentFragment createDocumentFragment(); |
|
38 [ReturnsNew] Text createTextNode(in DOMString data); |
|
39 [ReturnsNew] Comment createComment(in DOMString data); |
|
40 [ReturnsNew] CDATASection createCDATASection(in DOMString data) |
|
41 raises(DOMException); |
|
42 [OldStyleObjC, ReturnsNew] ProcessingInstruction createProcessingInstruction(in DOMString target, |
|
43 in DOMString data) |
|
44 raises (DOMException); |
|
45 [ReturnsNew] Attr createAttribute(in DOMString name) |
|
46 raises (DOMException); |
|
47 [ReturnsNew] EntityReference createEntityReference(in DOMString name) |
|
48 raises(DOMException); |
|
49 NodeList getElementsByTagName(in DOMString tagname); |
|
50 |
|
51 // Introduced in DOM Level 2: |
|
52 |
|
53 [OldStyleObjC, ReturnsNew] Node importNode(in Node importedNode, |
|
54 in boolean deep) |
|
55 raises (DOMException); |
|
56 [OldStyleObjC, ReturnsNew] Element createElementNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
57 in [ConvertNullToNullString] DOMString qualifiedName) |
|
58 raises (DOMException); |
|
59 [OldStyleObjC, ReturnsNew] Attr createAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
60 in [ConvertNullToNullString] DOMString qualifiedName) |
|
61 raises (DOMException); |
|
62 [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
63 in DOMString localName); |
|
64 Element getElementById(in DOMString elementId); |
|
65 |
|
66 // DOM Level 3 Core |
|
67 |
|
68 readonly attribute [ConvertNullStringTo=Null] DOMString inputEncoding; |
|
69 |
|
70 readonly attribute [ConvertNullStringTo=Null] DOMString xmlEncoding; |
|
71 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString xmlVersion |
|
72 setter raises (DOMException); |
|
73 attribute boolean xmlStandalone |
|
74 setter raises (DOMException); |
|
75 |
|
76 Node adoptNode(in Node source) |
|
77 raises (DOMException); |
|
78 |
|
79 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString documentURI; |
|
80 |
|
81 // DOM Level 2 Events (DocumentEvents interface) |
|
82 |
|
83 Event createEvent(in DOMString eventType) |
|
84 raises(DOMException); |
|
85 |
|
86 // DOM Level 2 Tranversal and Range (DocumentRange interface) |
|
87 |
|
88 Range createRange(); |
|
89 |
|
90 // DOM Level 2 Tranversal and Range (DocumentTraversal interface) |
|
91 |
|
92 [OldStyleObjC] NodeIterator createNodeIterator(in Node root, |
|
93 in unsigned long whatToShow, |
|
94 in NodeFilter filter, |
|
95 in boolean expandEntityReferences) |
|
96 raises(DOMException); |
|
97 [OldStyleObjC] TreeWalker createTreeWalker(in Node root, |
|
98 in unsigned long whatToShow, |
|
99 in NodeFilter filter, |
|
100 in boolean expandEntityReferences) |
|
101 raises(DOMException); |
|
102 |
|
103 // DOM Level 2 Abstract Views (DocumentView interface) |
|
104 |
|
105 readonly attribute DOMWindow defaultView; |
|
106 |
|
107 // DOM Level 2 Style (DocumentStyle interface) |
|
108 |
|
109 readonly attribute StyleSheetList styleSheets; |
|
110 |
|
111 // DOM Level 2 Style (DocumentCSS interface) |
|
112 |
|
113 [OldStyleObjC] CSSStyleDeclaration getOverrideStyle(in Element element, |
|
114 in DOMString pseudoElement); |
|
115 #if defined(ENABLE_XPATH) && ENABLE_XPATH |
|
116 // DOM Level 3 XPath (XPathEvaluator interface) |
|
117 [OldStyleObjC] XPathExpression createExpression(in DOMString expression, |
|
118 in XPathNSResolver resolver) |
|
119 raises(DOMException); |
|
120 XPathNSResolver createNSResolver(in Node nodeResolver); |
|
121 [OldStyleObjC, V8Custom] XPathResult evaluate(in DOMString expression, |
|
122 in Node contextNode, |
|
123 in XPathNSResolver resolver, |
|
124 in unsigned short type, |
|
125 in XPathResult inResult) |
|
126 raises(DOMException); |
|
127 #endif // ENABLE_XPATH |
|
128 |
|
129 // Common extensions |
|
130 |
|
131 boolean execCommand(in DOMString command, |
|
132 in boolean userInterface, |
|
133 in [ConvertUndefinedOrNullToNullString] DOMString value); |
|
134 |
|
135 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C |
|
136 // FIXME: remove the these two versions once [Optional] is implemented for Objective-C. |
|
137 boolean execCommand(in DOMString command, |
|
138 in boolean userInterface); |
|
139 boolean execCommand(in DOMString command); |
|
140 #endif |
|
141 |
|
142 boolean queryCommandEnabled(in DOMString command); |
|
143 boolean queryCommandIndeterm(in DOMString command); |
|
144 boolean queryCommandState(in DOMString command); |
|
145 boolean queryCommandSupported(in DOMString command); |
|
146 [ConvertNullStringTo=False] DOMString queryCommandValue(in DOMString command); |
|
147 |
|
148 // Moved down from HTMLDocument |
|
149 |
|
150 attribute [ConvertNullToNullString] DOMString title; |
|
151 readonly attribute DOMString referrer; |
|
152 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT |
|
153 attribute [ConvertNullToNullString] DOMString domain |
|
154 setter raises (DOMException); |
|
155 #else |
|
156 readonly attribute DOMString domain; |
|
157 #endif |
|
158 readonly attribute DOMString URL; |
|
159 |
|
160 attribute [ConvertNullToNullString] DOMString cookie |
|
161 setter raises (DOMException), |
|
162 getter raises (DOMException); |
|
163 |
|
164 // FIXME: the DOM spec does NOT have this attribute |
|
165 // raising an exception. |
|
166 attribute HTMLElement body |
|
167 setter raises (DOMException); |
|
168 |
|
169 readonly attribute HTMLHeadElement head; |
|
170 readonly attribute HTMLCollection images; |
|
171 readonly attribute HTMLCollection applets; |
|
172 readonly attribute HTMLCollection links; |
|
173 readonly attribute HTMLCollection forms; |
|
174 readonly attribute HTMLCollection anchors; |
|
175 readonly attribute DOMString lastModified; |
|
176 |
|
177 NodeList getElementsByName(in DOMString elementName); |
|
178 |
|
179 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT |
|
180 attribute [Custom] Location location; |
|
181 #endif |
|
182 |
|
183 // IE extensions |
|
184 |
|
185 attribute [ConvertNullStringTo=Undefined, ConvertNullToNullString] DOMString charset; |
|
186 readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset; |
|
187 readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState; |
|
188 |
|
189 |
|
190 NodeList nodesFromRect(in long x, in long y, |
|
191 in unsigned long hPadding, |
|
192 in unsigned long vPadding, |
|
193 in boolean ignoreClipping); |
|
194 Element elementFromPoint(in long x, in long y); |
|
195 Range caretRangeFromPoint(in long x, in long y); |
|
196 |
|
197 // Mozilla extensions |
|
198 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT |
|
199 DOMSelection getSelection(); |
|
200 #endif |
|
201 readonly attribute [ConvertNullStringTo=Null] DOMString characterSet; |
|
202 |
|
203 // WebKit extensions |
|
204 |
|
205 readonly attribute [ConvertNullStringTo=Null] DOMString preferredStylesheetSet; |
|
206 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectedStylesheetSet; |
|
207 |
|
208 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT |
|
209 CSSStyleDeclaration createCSSStyleDeclaration(); |
|
210 #endif |
|
211 |
|
212 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C |
|
213 // DOM Level 2 Style Interface |
|
214 [OldStyleObjC, UsesView] CSSStyleDeclaration getComputedStyle(in Element element, |
|
215 in DOMString pseudoElement); |
|
216 |
|
217 // WebKit extension |
|
218 // FIXME: remove the first version once [Optional] is implemented for Objective-C. |
|
219 [UsesView] CSSRuleList getMatchedCSSRules(in Element element, |
|
220 in DOMString pseudoElement); |
|
221 [UsesView] CSSRuleList getMatchedCSSRules(in Element element, |
|
222 in DOMString pseudoElement, |
|
223 in [Optional] boolean authorOnly); |
|
224 |
|
225 #endif |
|
226 |
|
227 #if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP |
|
228 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C |
|
229 [V8Custom] DOMObject getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height); |
|
230 #endif |
|
231 #endif |
|
232 |
|
233 // HTML 5 |
|
234 NodeList getElementsByClassName(in DOMString tagname); |
|
235 |
|
236 // NodeSelector - Selector API |
|
237 Element querySelector(in DOMString selectors) |
|
238 raises(DOMException); |
|
239 NodeList querySelectorAll(in DOMString selectors) |
|
240 raises(DOMException); |
|
241 |
|
242 #if defined(ENABLE_WML) && ENABLE_WML |
|
243 // Only used from within WML layout tests, WML doesn't have JS support at all. |
|
244 [DontEnum] void resetWMLPageState(); |
|
245 [DontEnum] void initializeWMLPageState(); |
|
246 #endif |
|
247 |
|
248 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C |
|
249 // Event handler DOM attributes |
|
250 attribute [DontEnum] EventListener onabort; |
|
251 attribute [DontEnum] EventListener onblur; |
|
252 attribute [DontEnum] EventListener onchange; |
|
253 attribute [DontEnum] EventListener onclick; |
|
254 attribute [DontEnum] EventListener oncontextmenu; |
|
255 attribute [DontEnum] EventListener ondblclick; |
|
256 attribute [DontEnum] EventListener ondrag; |
|
257 attribute [DontEnum] EventListener ondragend; |
|
258 attribute [DontEnum] EventListener ondragenter; |
|
259 attribute [DontEnum] EventListener ondragleave; |
|
260 attribute [DontEnum] EventListener ondragover; |
|
261 attribute [DontEnum] EventListener ondragstart; |
|
262 attribute [DontEnum] EventListener ondrop; |
|
263 attribute [DontEnum] EventListener onerror; |
|
264 attribute [DontEnum] EventListener onfocus; |
|
265 attribute [DontEnum] EventListener oninput; |
|
266 attribute [DontEnum] EventListener oninvalid; |
|
267 attribute [DontEnum] EventListener onkeydown; |
|
268 attribute [DontEnum] EventListener onkeypress; |
|
269 attribute [DontEnum] EventListener onkeyup; |
|
270 attribute [DontEnum] EventListener onload; |
|
271 attribute [DontEnum] EventListener onmousedown; |
|
272 attribute [DontEnum] EventListener onmousemove; |
|
273 attribute [DontEnum] EventListener onmouseout; |
|
274 attribute [DontEnum] EventListener onmouseover; |
|
275 attribute [DontEnum] EventListener onmouseup; |
|
276 attribute [DontEnum] EventListener onmousewheel; |
|
277 attribute [DontEnum] EventListener onscroll; |
|
278 attribute [DontEnum] EventListener onselect; |
|
279 attribute [DontEnum] EventListener onsubmit; |
|
280 |
|
281 // attribute [DontEnum] EventListener oncanplay; |
|
282 // attribute [DontEnum] EventListener oncanplaythrough; |
|
283 // attribute [DontEnum] EventListener ondurationchange; |
|
284 // attribute [DontEnum] EventListener onemptied; |
|
285 // attribute [DontEnum] EventListener onended; |
|
286 // attribute [DontEnum] EventListener onformchange; |
|
287 // attribute [DontEnum] EventListener onforminput; |
|
288 // attribute [DontEnum] EventListener onloadeddata; |
|
289 // attribute [DontEnum] EventListener onloadedmetadata; |
|
290 // attribute [DontEnum] EventListener onloadstart; |
|
291 // attribute [DontEnum] EventListener onpause; |
|
292 // attribute [DontEnum] EventListener onplay; |
|
293 // attribute [DontEnum] EventListener onplaying; |
|
294 // attribute [DontEnum] EventListener onprogress; |
|
295 // attribute [DontEnum] EventListener onratechange; |
|
296 // attribute [DontEnum] EventListener onreadystatechange; |
|
297 // attribute [DontEnum] EventListener onseeked; |
|
298 // attribute [DontEnum] EventListener onseeking; |
|
299 // attribute [DontEnum] EventListener onshow; |
|
300 // attribute [DontEnum] EventListener onstalled; |
|
301 // attribute [DontEnum] EventListener onsuspend; |
|
302 // attribute [DontEnum] EventListener ontimeupdate; |
|
303 // attribute [DontEnum] EventListener onvolumechange; |
|
304 // attribute [DontEnum] EventListener onwaiting; |
|
305 |
|
306 // WebKit extensions |
|
307 attribute [DontEnum] EventListener onbeforecut; |
|
308 attribute [DontEnum] EventListener oncut; |
|
309 attribute [DontEnum] EventListener onbeforecopy; |
|
310 attribute [DontEnum] EventListener oncopy; |
|
311 attribute [DontEnum] EventListener onbeforepaste; |
|
312 attribute [DontEnum] EventListener onpaste; |
|
313 attribute [DontEnum] EventListener onreset; |
|
314 attribute [DontEnum] EventListener onsearch; |
|
315 attribute [DontEnum] EventListener onselectstart; |
|
316 attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart; |
|
317 attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove; |
|
318 attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend; |
|
319 attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel; |
|
320 attribute [DontEnum,Conditional=TRANSFORMACTION_EVENTS,EnabledAtRuntime] EventListener ontransformactionstart; |
|
321 attribute [DontEnum,Conditional=TRANSFORMACTION_EVENTS,EnabledAtRuntime] EventListener ontransformactionupdate; |
|
322 attribute [DontEnum,Conditional=TRANSFORMACTION_EVENTS,EnabledAtRuntime] EventListener ontransformactionend; |
|
323 #endif |
|
324 |
|
325 #if defined(LANGUAGE_CPP) && LANGUAGE_CPP |
|
326 // Extra WebCore methods exposed to allow compile-time casting in C++ |
|
327 boolean isHTMLDocument(); |
|
328 #endif |
|
329 |
|
330 }; |
|
331 |
|
332 } |