summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/core/dom/Document.idl
blob: c27623ad891e68e30f08f36f816b4744fb734e05 (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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
/*
 * Copyright (C) 2006, 2007, 2011 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.
 */

callback CustomElementConstructor = Element ();

[
    CustomToV8
] interface Document : Node {

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

    [CustomElementCallbacks=Enable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElement([TreatNullAs=NullString,Default=Undefined] optional DOMString tagName);
    DocumentFragment   createDocumentFragment();
    [PerWorldBindings] Text createTextNode([Default=Undefined] optional DOMString data);
    Comment createComment([Default=Undefined] optional DOMString data);
    [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection([Default=Undefined] optional DOMString data); // Removed from DOM4.
    [RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
                                                                                 [Default=Undefined] optional DOMString data);
    [RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute([Default=Undefined] optional DOMString name); // Removed from DOM4.
    [PerWorldBindings] NodeList           getElementsByTagName([Default=Undefined] optional DOMString tagname);

    // Introduced in DOM Level 2:

    [CustomElementCallbacks=Enable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
                    optional boolean deep);
    [CustomElementCallbacks=Enable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
    [RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                                  [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName); // Removed from DOM4.
     NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                   [Default=Undefined] optional DOMString localName);
    [PerWorldBindings] Element            getElementById([Default=Undefined] optional DOMString elementId);

    // DOM Level 3 Core

    [TreatReturnedNullStringAs=Null, MeasureAs=DocumentInputEncoding] readonly attribute DOMString inputEncoding; // Removed from DOM4.

    [TreatReturnedNullStringAs=Null, MeasureAs=DocumentXMLEncoding] readonly attribute DOMString xmlEncoding; // Removed from DOM4.
    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException, MeasureAs=DocumentXMLVersion] attribute DOMString xmlVersion; // Removed from DOM4.
    [SetterRaisesException, MeasureAs=DocumentXMLStandalone] attribute boolean xmlStandalone; // Removed from DOM4.

    [RaisesException, CustomElementCallbacks=Enable] Node               adoptNode([Default=Undefined] optional Node source);

    [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI;

    // DOM Level 2 Events (DocumentEvents interface)

    [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);

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

    Range              createRange();

    // DOM Level 2 Traversal and Range (DocumentTraversal interface)
    // In DOM4, the fourth argument |expandEntityReferences| is removed.
    // Historically, this argument was never implemented and has been ignored.
    // We still receive the argument to keep compatibility, but don't do anything if it's specified.
    [RaisesException] NodeIterator createNodeIterator(Node root,
                                                      optional unsigned long whatToShow,
                                                      optional NodeFilter filter,
                                                      optional boolean expandEntityReferences);
    [RaisesException] TreeWalker createTreeWalker(Node root,
                                                  optional unsigned long whatToShow,
                                                  optional NodeFilter filter,
                                                  optional boolean expandEntityReferences);

    // DOM Level 2 Abstract Views (DocumentView interface)

    readonly attribute Window defaultView;

    // DOM Level 2 Style (DocumentStyle interface)

    readonly attribute StyleSheetList styleSheets;

    // DOM Level 2 Style (DocumentCSS interface)

     CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
                                                        [Default=Undefined] optional DOMString pseudoElement);

    // Common extensions
    [CustomElementCallbacks=Enable]
    boolean            execCommand([Default=Undefined] optional DOMString command,
                                   [Default=Undefined] optional boolean userInterface,
                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString value);

    boolean            queryCommandEnabled([Default=Undefined] optional DOMString command);
    boolean            queryCommandIndeterm([Default=Undefined] optional DOMString command);
    boolean            queryCommandState([Default=Undefined] optional DOMString command);
    boolean            queryCommandSupported([Default=Undefined] optional DOMString command);
    DOMString          queryCommandValue([Default=Undefined] optional DOMString command);

    // Moved down from HTMLDocument

             [TreatNullAs=NullString, CustomElementCallbacks=Enable] attribute DOMString title;
    readonly attribute DOMString referrer;
             [TreatNullAs=NullString, SetterRaisesException] attribute DOMString domain;
    readonly attribute DOMString URL;

             [TreatNullAs=NullString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;

             [SetterRaisesException, CustomElementCallbacks=Enable] attribute HTMLElement body;

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

    [PerWorldBindings] NodeList getElementsByName([Default=Undefined] optional DOMString elementName);

    [Custom, Replaceable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] readonly attribute Location location;

    // IE extensions

             [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;

    Element            elementFromPoint([Default=Undefined] optional long x,
                                        [Default=Undefined] optional long y);
    Range              caretRangeFromPoint([Default=Undefined] optional long x,
                                           [Default=Undefined] optional long y);

    // Mozilla extensions
    Selection          getSelection();
    [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet;

    // WebKit extensions

    [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;

    CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);

    // HTML 5
    NodeList getElementsByClassName([Default=Undefined] optional DOMString tagname);

    readonly attribute DOMString compatMode;

    // NodeSelector - Selector API
    [RaisesException] Element querySelector(DOMString selectors);
    [RaisesException] NodeList querySelectorAll(DOMString selectors);

    void webkitExitPointerLock();
    readonly attribute Element webkitPointerLockElement;

    [EnabledAtRuntime=cssRegions] WebKitNamedFlowCollection webkitGetNamedFlows();

    [EnabledAtRuntime=fontLoadEvents] readonly attribute FontLoader fontloader;

    // Event handler DOM attributes
    [NotEnumerable] attribute EventHandler onabort;
    [NotEnumerable] attribute EventHandler onblur;
    [NotEnumerable] attribute EventHandler onchange;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onclick;
    [NotEnumerable] attribute EventHandler oncontextmenu;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondblclick;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondrag;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragend;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragenter;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragleave;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragover;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragstart;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondrop;
    [NotEnumerable] attribute EventHandler onerror;
    [NotEnumerable] attribute EventHandler onfocus;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler oninput;
    [NotEnumerable] attribute EventHandler oninvalid;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeydown;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeypress;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeyup;
    [NotEnumerable] attribute EventHandler onload;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousedown;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseenter;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseleave;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousemove;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseout;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseover;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseup;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousewheel;
    [NotEnumerable] attribute EventHandler onreadystatechange;
    [NotEnumerable] attribute EventHandler onscroll;
    [NotEnumerable] attribute EventHandler onselect;
    [NotEnumerable] attribute EventHandler onsubmit;

    // attribute [NotEnumerable] EventHandler oncanplay;
    // attribute [NotEnumerable] EventHandler oncanplaythrough;
    // attribute [NotEnumerable] EventHandler ondurationchange;
    // attribute [NotEnumerable] EventHandler onemptied;
    // attribute [NotEnumerable] EventHandler onended;
    // attribute [NotEnumerable] EventHandler onloadeddata;
    // attribute [NotEnumerable] EventHandler onloadedmetadata;
    // attribute [NotEnumerable] EventHandler onloadstart;
    // attribute [NotEnumerable] EventHandler onpause;
    // attribute [NotEnumerable] EventHandler onplay;
    // attribute [NotEnumerable] EventHandler onplaying;
    // attribute [NotEnumerable] EventHandler onprogress;
    // attribute [NotEnumerable] EventHandler onratechange;
    // attribute [NotEnumerable] EventHandler onseeked;
    // attribute [NotEnumerable] EventHandler onseeking;
    // attribute [NotEnumerable] EventHandler onshow;
    // attribute [NotEnumerable] EventHandler onstalled;
    // attribute [NotEnumerable] EventHandler onsuspend;
    // attribute [NotEnumerable] EventHandler ontimeupdate;
    // attribute [NotEnumerable] EventHandler onvolumechange;
    // attribute [NotEnumerable] EventHandler onwaiting;

    // WebKit extensions
    [NotEnumerable] attribute EventHandler onbeforecut;
    [NotEnumerable] attribute EventHandler oncut;
    [NotEnumerable] attribute EventHandler onbeforecopy;
    [NotEnumerable] attribute EventHandler oncopy;
    [NotEnumerable] attribute EventHandler onbeforepaste;
    [NotEnumerable] attribute EventHandler onpaste;
    [NotEnumerable] attribute EventHandler onreset;
    [NotEnumerable] attribute EventHandler onsearch;
    [NotEnumerable] attribute EventHandler onselectstart;
    [NotEnumerable] attribute EventHandler onselectionchange;
    [NotEnumerable,EnabledAtRuntime=touch] attribute EventHandler ontouchstart;
    [NotEnumerable,EnabledAtRuntime=touch] attribute EventHandler ontouchmove;
    [NotEnumerable,EnabledAtRuntime=touch] attribute EventHandler ontouchend;
    [NotEnumerable,EnabledAtRuntime=touch] attribute EventHandler ontouchcancel;
    [NotEnumerable] attribute EventHandler onwebkitfullscreenchange;
    [NotEnumerable] attribute EventHandler onwebkitfullscreenerror;
    [NotEnumerable] attribute EventHandler onwebkitpointerlockchange;
    [NotEnumerable] attribute EventHandler onwebkitpointerlockerror;
    [NotEnumerable, EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute EventHandler onsecuritypolicyviolation;

    [EnabledAtRuntime=touch] Touch createTouch([Default=Undefined] optional Window window,
                                               [Default=Undefined] optional EventTarget target,
                                               [Default=Undefined] optional long identifier,
                                               [Default=Undefined] optional long pageX,
                                               [Default=Undefined] optional long pageY,
                                               [Default=Undefined] optional long screenX,
                                               [Default=Undefined] optional long screenY,
                                               [Default=Undefined] optional long webkitRadiusX,
                                               [Default=Undefined] optional long webkitRadiusY,
                                               [Default=Undefined] optional float webkitRotationAngle,
                                               [Default=Undefined] optional float webkitForce);
    [EnabledAtRuntime=touch, Custom, RaisesException] TouchList createTouchList();

    [DeprecateAs=PrefixedDocumentRegister, EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, CustomElementCallbacks=Enable, RaisesException] CustomElementConstructor webkitRegister(DOMString name, optional Dictionary options);
    [EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, CustomElementCallbacks=Enable, RaisesException] CustomElementConstructor register(DOMString name, optional Dictionary options);
    [CustomElementCallbacks=Enable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension);
    [CustomElementCallbacks=Enable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName,
                            [TreatNullAs=NullString] DOMString typeExtension);

    // Page visibility API.
    readonly attribute DOMString webkitVisibilityState;
    readonly attribute boolean webkitHidden;

    // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces
    [EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] readonly attribute SecurityPolicy securityPolicy;

    readonly attribute HTMLScriptElement currentScript;
};

Document implements ParentNode;