summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Document.idl
blob: ddc25f3c5ef27de5e7c55faa6e9ceab6c4b82c9e (plain)
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
232
233
234
235
236
/*
 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
 * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
 *
 * 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.
 */

module core {

    interface [
        GenerateConstructor,
        GenerateToJS,
        CustomMarkFunction,
        InterfaceUUID=48BB95FC-2D08-4c54-BE65-7558736A4CAE,
        ImplementationUUID=FF5CBE81-F817-429c-A6C2-0CCCD2328062
    ] Document : EventTargetNode {

        // DOM Level 1 Core
        readonly attribute DocumentType doctype;
        readonly attribute DOMImplementation implementation;
        readonly attribute Element documentElement;

        Element            createElement(in DOMString tagName)
            raises (DOMException);
        DocumentFragment   createDocumentFragment();
        Text               createTextNode(in DOMString data);
        Comment            createComment(in DOMString data);
        CDATASection       createCDATASection(in DOMString data)
            raises(DOMException);
        [OldStyleObjC] ProcessingInstruction createProcessingInstruction(in DOMString target,
                                                                         in DOMString data)
            raises (DOMException);
        Attr               createAttribute(in DOMString name)
            raises (DOMException);
        EntityReference    createEntityReference(in DOMString name)
            raises(DOMException);
        NodeList           getElementsByTagName(in DOMString tagname);

        // Introduced in DOM Level 2:

        [OldStyleObjC] Node importNode(in Node importedNode,
                                       in boolean deep)
            raises (DOMException);
        [OldStyleObjC] Element createElementNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                               in DOMString qualifiedName)
            raises (DOMException);
        [OldStyleObjC] Attr createAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                              in DOMString qualifiedName)
            raises (DOMException);
        [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                                       in DOMString localName);
        Element            getElementById(in DOMString elementId);

        // DOM Level 3 Core

        readonly attribute [ConvertNullStringTo=Null] DOMString inputEncoding;

        readonly attribute [ConvertNullStringTo=Null] DOMString xmlEncoding;
                 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString xmlVersion
                    setter raises (DOMException);
                 attribute boolean xmlStandalone
                    setter raises (DOMException);

        Node               adoptNode(in Node source)
            raises (DOMException);

                 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString documentURI;

#if !defined(LANGUAGE_COM)
        // DOM Level 2 Events (DocumentEvents interface)

        Event              createEvent(in DOMString eventType)
            raises(DOMException);

        // DOM Level 2 Tranversal and Range (DocumentRange interface)

        Range              createRange();

        // DOM Level 2 Tranversal and Range (DocumentTraversal interface)

#if !defined(LANGUAGE_OBJECTIVE_C)
        NodeIterator       createNodeIterator(in Node root,
                                              in unsigned long whatToShow,
                                              in NodeFilter filter,
                                              in boolean entityReferenceExpansion)
            raises(DOMException);
        TreeWalker         createTreeWalker(in Node root,
                                            in unsigned long whatToShow,
                                            in NodeFilter filter,
                                            in boolean entityReferenceExpansion)
            raises(DOMException);
#endif // !defined(LANGUAGE_OBJECTIVE_C)

        // DOM Level 2 Abstract Views (DocumentView interface)

        readonly attribute DOMWindow defaultView;

        // DOM Level 2 Style (DocumentStyle interface)

        readonly attribute StyleSheetList styleSheets;

        // DOM Level 2 Style (DocumentCSS interface)

        [OldStyleObjC] CSSStyleDeclaration getOverrideStyle(in Element element,
                                                            in DOMString pseudoElement);
#ifdef ENABLE_XPATH
        // DOM Level 3 XPath (XPathEvaluator interface)
        [OldStyleObjC] XPathExpression createExpression(in DOMString expression,
                                                        in XPathNSResolver resolver)
            raises(DOMException);
        XPathNSResolver    createNSResolver(in Node nodeResolver);
        [OldStyleObjC] XPathResult evaluate(in DOMString expression,
                                            in Node contextNode,
                                            in XPathNSResolver resolver,
                                            in unsigned short type,
                                            in XPathResult inResult)
            raises(DOMException);
#endif // ENABLE_XPATH
#endif // !defined(LANGUAGE_COM)

        // Common extensions

        boolean            execCommand(in DOMString command,
                                       in boolean userInterface,
                                       in [ConvertUndefinedOrNullToNullString] DOMString value);

#if defined(LANGUAGE_OBJECTIVE_C)
        // FIXME: remove the these two versions once [Optional] is implemented for Objective-C.
        boolean            execCommand(in DOMString command,
                                       in boolean userInterface);
        boolean            execCommand(in DOMString command);
#endif

        boolean            queryCommandEnabled(in DOMString command);
        boolean            queryCommandIndeterm(in DOMString command);
        boolean            queryCommandState(in DOMString command);
        boolean            queryCommandSupported(in DOMString command);
        [ConvertNullStringTo=False] DOMString queryCommandValue(in DOMString command);

        // Moved down from HTMLDocument

                 attribute [ConvertNullToNullString] DOMString title;
        readonly attribute DOMString referrer;
#if defined(LANGUAGE_JAVASCRIPT)
                 attribute [ConvertNullToNullString] DOMString domain;
#else
        readonly attribute DOMString domain;
#endif
        readonly attribute DOMString URL;

        // FIXME: the DOM spec states that this attribute can 
        // raise an exception on setting.
                 attribute [ConvertNullToNullString] DOMString cookie
                     /*setter raises (DOMException)*/;

        // FIXME: the DOM spec does NOT have this attribute
        // raising an exception.
                 attribute HTMLElement body
                     setter raises (DOMException);

        readonly attribute HTMLCollection images;
        readonly attribute HTMLCollection applets;
        readonly attribute HTMLCollection links;
        readonly attribute HTMLCollection forms;
        readonly attribute HTMLCollection anchors;
        readonly attribute DOMString lastModified;

        NodeList getElementsByName(in DOMString elementName);

#if defined(LANGUAGE_JAVASCRIPT)
                 attribute [Custom] Location location;
#endif

        // IE extensions

                 attribute [ConvertNullStringTo=Undefined, ConvertNullToNullString] DOMString charset;
        readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset;
        readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState;

        Element            elementFromPoint(in long x, in long y);

        // Mozilla extensions
#if defined(LANGUAGE_JAVASCRIPT)
        DOMSelection       getSelection();
#endif
        readonly attribute [ConvertNullStringTo=Null] DOMString characterSet;

        // WebKit extensions

        readonly attribute [ConvertNullStringTo=Null] DOMString preferredStylesheetSet;
                 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectedStylesheetSet;

#if !defined(LANGUAGE_COM)
#if !defined(LANGUAGE_JAVASCRIPT)
        CSSStyleDeclaration createCSSStyleDeclaration();
#endif
#endif

#if defined(LANGUAGE_OBJECTIVE_C)
        // DOM Level 2 Style Interface
        [OldStyleObjC, UsesView] CSSStyleDeclaration getComputedStyle(in Element element,
                                                                      in DOMString pseudoElement);

        // WebKit extension
        // FIXME: remove the first version once [Optional] is implemented for Objective-C.
        [UsesView] CSSRuleList getMatchedCSSRules(in Element element,
                                                  in DOMString pseudoElement);
        [UsesView] CSSRuleList getMatchedCSSRules(in Element element,
                                                  in DOMString pseudoElement,
                                                  in [Optional] boolean authorOnly);
#endif

        // HTML 5
        NodeList            getElementsByClassName(in DOMString tagname);

        // DocumentSelector - Selector API
        Element             querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
            raises(DOMException);
        NodeList            querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
            raises(DOMException);
    };

}