|
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 [GenerateConstructor, GenerateToJS, CustomMarkFunction] Document : EventTargetNode { |
|
24 |
|
25 // DOM Level 1 Core |
|
26 |
|
27 readonly attribute DocumentType doctype; |
|
28 readonly attribute DOMImplementation implementation; |
|
29 readonly attribute Element documentElement; |
|
30 |
|
31 Element createElement(in DOMString tagName) |
|
32 raises (DOMException); |
|
33 DocumentFragment createDocumentFragment(); |
|
34 Text createTextNode(in DOMString data); |
|
35 Comment createComment(in DOMString data); |
|
36 CDATASection createCDATASection(in DOMString data) |
|
37 raises(DOMException); |
|
38 [OldStyleObjC] ProcessingInstruction createProcessingInstruction(in DOMString target, |
|
39 in DOMString data) |
|
40 raises (DOMException); |
|
41 Attr createAttribute(in DOMString name) |
|
42 raises (DOMException); |
|
43 EntityReference createEntityReference(in DOMString name) |
|
44 raises(DOMException); |
|
45 NodeList getElementsByTagName(in DOMString tagname); |
|
46 |
|
47 // Introduced in DOM Level 2: |
|
48 |
|
49 [OldStyleObjC] Node importNode(in Node importedNode, |
|
50 in boolean deep) |
|
51 raises (DOMException); |
|
52 [OldStyleObjC] Element createElementNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
53 in DOMString qualifiedName) |
|
54 raises (DOMException); |
|
55 [OldStyleObjC] Attr createAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
56 in DOMString qualifiedName) |
|
57 raises (DOMException); |
|
58 [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
59 in DOMString localName); |
|
60 Element getElementById(in DOMString elementId); |
|
61 |
|
62 // DOM Level 3 Core |
|
63 |
|
64 readonly attribute [ConvertNullStringTo=Null] DOMString inputEncoding; |
|
65 |
|
66 readonly attribute [ConvertNullStringTo=Null] DOMString xmlEncoding; |
|
67 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString xmlVersion |
|
68 setter raises (DOMException); |
|
69 attribute boolean xmlStandalone |
|
70 setter raises (DOMException); |
|
71 |
|
72 Node adoptNode(in Node source) |
|
73 raises (DOMException); |
|
74 |
|
75 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString documentURI; |
|
76 |
|
77 // DOM Level 2 Events (DocumentEvents interface) |
|
78 |
|
79 Event createEvent(in DOMString eventType) |
|
80 raises(DOMException); |
|
81 |
|
82 // DOM Level 2 Tranversal and Range (DocumentRange interface) |
|
83 |
|
84 Range createRange(); |
|
85 |
|
86 // DOM Level 2 Tranversal and Range (DocumentTraversal interface) |
|
87 |
|
88 #if !defined(LANGUAGE_OBJECTIVE_C) |
|
89 NodeIterator createNodeIterator(in Node root, |
|
90 in unsigned long whatToShow, |
|
91 in NodeFilter filter, |
|
92 in boolean entityReferenceExpansion) |
|
93 raises(DOMException); |
|
94 TreeWalker createTreeWalker(in Node root, |
|
95 in unsigned long whatToShow, |
|
96 in NodeFilter filter, |
|
97 in boolean entityReferenceExpansion) |
|
98 raises(DOMException); |
|
99 #endif |
|
100 |
|
101 // DOM Level 2 Abstract Views (DocumentView interface) |
|
102 |
|
103 readonly attribute DOMWindow defaultView; |
|
104 |
|
105 // DOM Level 2 Style (DocumentStyle interface) |
|
106 |
|
107 readonly attribute StyleSheetList styleSheets; |
|
108 |
|
109 // DOM Level 2 Style (DocumentCSS interface) |
|
110 |
|
111 [OldStyleObjC] CSSStyleDeclaration getOverrideStyle(in Element element, |
|
112 in DOMString pseudoElement); |
|
113 |
|
114 #ifdef ENABLE_XPATH |
|
115 // DOM Level 3 XPath (XPathEvaluator interface) |
|
116 [OldStyleObjC] XPathExpression createExpression(in DOMString expression, |
|
117 in XPathNSResolver resolver) |
|
118 raises(DOMException); |
|
119 XPathNSResolver createNSResolver(in Node nodeResolver); |
|
120 [OldStyleObjC] XPathResult evaluate(in DOMString expression, |
|
121 in Node contextNode, |
|
122 in XPathNSResolver resolver, |
|
123 in unsigned short type, |
|
124 in XPathResult inResult) |
|
125 raises(DOMException); |
|
126 #endif |
|
127 |
|
128 // Common extensions |
|
129 |
|
130 boolean execCommand(in DOMString command, |
|
131 in boolean userInterface, |
|
132 in [ConvertUndefinedOrNullToNullString] DOMString value); |
|
133 |
|
134 #if defined(LANGUAGE_OBJECTIVE_C) |
|
135 // FIXME: remove the these two versions once [Optional] is implemented for Objective-C. |
|
136 boolean execCommand(in DOMString command, |
|
137 in boolean userInterface); |
|
138 boolean execCommand(in DOMString command); |
|
139 #endif |
|
140 |
|
141 boolean queryCommandEnabled(in DOMString command); |
|
142 boolean queryCommandIndeterm(in DOMString command); |
|
143 boolean queryCommandState(in DOMString command); |
|
144 boolean queryCommandSupported(in DOMString command); |
|
145 [ConvertNullStringTo=False] DOMString queryCommandValue(in DOMString command); |
|
146 |
|
147 // IE extensions |
|
148 |
|
149 #if !defined(LANGUAGE_OBJECTIVE_C) |
|
150 readonly attribute DOMString URL; |
|
151 #endif |
|
152 attribute [ConvertNullStringTo=Undefined, ConvertNullToNullString] DOMString charset; |
|
153 readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset; |
|
154 readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState; |
|
155 |
|
156 Element elementFromPoint(in long x, in long y); |
|
157 |
|
158 // Mozilla extensions |
|
159 |
|
160 readonly attribute [ConvertNullStringTo=Null] DOMString characterSet; |
|
161 |
|
162 // WebKit extensions |
|
163 |
|
164 readonly attribute [ConvertNullStringTo=Null] DOMString preferredStylesheetSet; |
|
165 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectedStylesheetSet; |
|
166 |
|
167 #if !defined(LANGUAGE_JAVASCRIPT) |
|
168 CSSStyleDeclaration createCSSStyleDeclaration(); |
|
169 #endif |
|
170 |
|
171 #if defined(LANGUAGE_OBJECTIVE_C) |
|
172 // DOM Level 2 Style Interface |
|
173 [OldStyleObjC, UsesView] CSSStyleDeclaration getComputedStyle(in Element element, |
|
174 in DOMString pseudoElement); |
|
175 |
|
176 // WebKit extension |
|
177 // FIXME: remove the first version once [Optional] is implemented for Objective-C. |
|
178 [UsesView] CSSRuleList getMatchedCSSRules(in Element element, |
|
179 in DOMString pseudoElement); |
|
180 [UsesView] CSSRuleList getMatchedCSSRules(in Element element, |
|
181 in DOMString pseudoElement, |
|
182 in [Optional] boolean authorOnly); |
|
183 #endif |
|
184 |
|
185 }; |
|
186 |
|
187 } |