OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> | 3 * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 [ | 23 [ |
24 SpecialWrapFor=HTMLDocument|SVGDocument | 24 SpecialWrapFor=HTMLDocument|SVGDocument |
25 ] interface Document : Node { | 25 ] interface Document : Node { |
26 | 26 |
27 // DOM Level 1 Core | 27 // DOM Level 1 Core |
28 readonly attribute DocumentType doctype; | 28 readonly attribute DocumentType doctype; |
29 readonly attribute DOMImplementation implementation; | 29 readonly attribute DOMImplementation implementation; |
30 readonly attribute Element documentElement; | 30 readonly attribute Element documentElement; |
31 | 31 |
32 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=AccessForIsolated
Worlds, RaisesException] Element createElement([TreatNullAs=NullString,Default=U
ndefined] optional DOMString tagName); | 32 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds
, RaisesException] Element createElement(DOMString tagName); |
33 DocumentFragment createDocumentFragment(); | 33 DocumentFragment createDocumentFragment(); |
34 [PerWorldBindings] Text createTextNode([Default=Undefined] optional DOMStrin
g data); | 34 [PerWorldBindings] Text createTextNode(DOMString data); |
35 Comment createComment([Default=Undefined] optional DOMString data); | 35 Comment createComment(DOMString data); |
36 [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createC
DATASection([Default=Undefined] optional DOMString data); // Removed from DOM4. | 36 [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createC
DATASection([Default=Undefined] optional DOMString data); // Removed from DOM4. |
37 [RaisesException] ProcessingInstruction createProcessingInstruction([Default
=Undefined] optional DOMString target, | 37 [RaisesException] ProcessingInstruction createProcessingInstruction(DOMStrin
g target, DOMString data); |
38
[Default=Undefined] optional DOMString data); | |
39 [RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute([D
efault=Undefined] optional DOMString name); // Removed from DOM4. | 38 [RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute([D
efault=Undefined] optional DOMString name); // Removed from DOM4. |
40 [PerWorldBindings] NodeList getElementsByTagName([Default=Undefine
d] optional DOMString tagname); | 39 [PerWorldBindings] NodeList getElementsByTagName(DOMString localName); |
41 | 40 |
42 // Introduced in DOM Level 2: | 41 // Introduced in DOM Level 2: |
43 | 42 |
44 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=AccessForIsolated
Worlds, RaisesException] Node importNode([Default=Undefined] optional Node impor
tedNode, | 43 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds
, RaisesException] Node importNode(Node node, optional boolean deep); |
45 optional boolean deep); | 44 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds
, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString na
mespaceURI, DOMString qualifiedName); |
46 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=AccessForIsolated
Worlds, RaisesException] Element createElementNS([TreatNullAs=NullString,Default
=Undefined] optional DOMString namespaceURI, | |
47 [TreatNullAs=NullString,Default=Undefined] optional
DOMString qualifiedName); | |
48 [RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeN
S([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, | 45 [RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeN
S([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, |
49
[TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
// Removed from DOM4. | 46
[TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
// Removed from DOM4. |
50 NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined]
optional DOMString namespaceURI, | 47 NodeList getElementsByTagNameNS([TreatNullAs=NullString] DOMString namespace
URI, DOMString localName); |
51 [Default=Undefined] optional
DOMString localName); | 48 [PerWorldBindings] Element getElementById(DOMString elementId); |
52 [PerWorldBindings] Element getElementById([Default=Undefined] opt
ional DOMString elementId); | |
53 | 49 |
54 // DOM Level 3 Core | 50 // DOM Level 3 Core |
55 | 51 |
56 [TreatReturnedNullStringAs=Null, MeasureAs=DocumentInputEncoding] readonly a
ttribute DOMString inputEncoding; // Removed from DOM4. | 52 [TreatReturnedNullStringAs=Null, MeasureAs=DocumentInputEncoding] readonly a
ttribute DOMString inputEncoding; // Removed from DOM4. |
57 | 53 |
58 [TreatReturnedNullStringAs=Null, MeasureAs=DocumentXMLEncoding] readonly att
ribute DOMString xmlEncoding; // Removed from DOM4. | 54 [TreatReturnedNullStringAs=Null, MeasureAs=DocumentXMLEncoding] readonly att
ribute DOMString xmlEncoding; // Removed from DOM4. |
59 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesExcepti
on, MeasureAs=DocumentXMLVersion] attribute DOMString xmlVersion; // Removed fro
m DOM4. | 55 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Set
ter, MeasureAs=DocumentXMLVersion] attribute DOMString xmlVersion; // Removed fr
om DOM4. |
60 [SetterRaisesException, MeasureAs=DocumentXMLStandalone] attribute boolean x
mlStandalone; // Removed from DOM4. | 56 [RaisesException=Setter, MeasureAs=DocumentXMLStandalone] attribute boolean
xmlStandalone; // Removed from DOM4. |
61 | 57 |
62 [RaisesException, CustomElementCallbacks] Node adoptNode([Defa
ult=Undefined] optional Node source); | 58 [RaisesException, CustomElementCallbacks] Node adoptNode(Node node); |
63 | 59 |
64 [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI; | 60 [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI; |
65 | 61 |
66 // DOM Level 2 Events (DocumentEvents interface) | 62 // DOM Level 2 Events (DocumentEvents interface) |
67 | 63 |
68 [RaisesException] Event createEvent([Default=Undefined] optiona
l DOMString eventType); | 64 [RaisesException] Event createEvent(DOMString eventType); |
69 | 65 |
70 // DOM Level 2 Traversal and Range (DocumentRange interface) | 66 // DOM Level 2 Traversal and Range (DocumentRange interface) |
71 | 67 |
72 Range createRange(); | 68 Range createRange(); |
73 | 69 |
74 // DOM Level 2 Traversal and Range (DocumentTraversal interface) | 70 // DOM Level 2 Traversal and Range (DocumentTraversal interface) |
75 // In DOM4, the fourth argument |expandEntityReferences| is removed. | 71 |
76 // Historically, this argument was never implemented and has been ignored. | |
77 // We still receive the argument to keep compatibility, but don't do anythin
g if it's specified. | |
78 [RaisesException] NodeIterator createNodeIterator(Node root, | 72 [RaisesException] NodeIterator createNodeIterator(Node root, |
79 optional unsigned long wha
tToShow, | 73 optional unsigned long wha
tToShow, |
80 optional NodeFilter filter
, | 74 optional NodeFilter filter
); |
81 optional boolean expandEnt
ityReferences); | |
82 [RaisesException] TreeWalker createTreeWalker(Node root, | 75 [RaisesException] TreeWalker createTreeWalker(Node root, |
83 optional unsigned long whatToS
how, | 76 optional unsigned long whatToS
how, |
84 optional NodeFilter filter, | 77 optional NodeFilter filter); |
85 optional boolean expandEntityR
eferences); | |
86 | 78 |
87 // DOM Level 2 Abstract Views (DocumentView interface) | 79 // DOM Level 2 Abstract Views (DocumentView interface) |
88 | 80 |
89 [ImplementedAs=domWindow] readonly attribute Window defaultView; | 81 [ImplementedAs=domWindow] readonly attribute Window defaultView; |
90 | 82 |
91 // DOM Level 2 Style (DocumentStyle interface) | 83 // DOM Level 2 Style (DocumentStyle interface) |
92 | 84 |
93 readonly attribute StyleSheetList styleSheets; | 85 readonly attribute StyleSheetList styleSheets; |
94 | 86 |
95 // DOM Level 2 Style (DocumentCSS interface) | 87 // DOM Level 2 Style (DocumentCSS interface) |
(...skipping 10 matching lines...) Expand all Loading... |
106 boolean queryCommandEnabled([Default=Undefined] optional DOMStrin
g command); | 98 boolean queryCommandEnabled([Default=Undefined] optional DOMStrin
g command); |
107 boolean queryCommandIndeterm([Default=Undefined] optional DOMStri
ng command); | 99 boolean queryCommandIndeterm([Default=Undefined] optional DOMStri
ng command); |
108 boolean queryCommandState([Default=Undefined] optional DOMString
command); | 100 boolean queryCommandState([Default=Undefined] optional DOMString
command); |
109 boolean queryCommandSupported([Default=Undefined] optional DOMStr
ing command); | 101 boolean queryCommandSupported([Default=Undefined] optional DOMStr
ing command); |
110 DOMString queryCommandValue([Default=Undefined] optional DOMString
command); | 102 DOMString queryCommandValue([Default=Undefined] optional DOMString
command); |
111 | 103 |
112 // Moved down from HTMLDocument | 104 // Moved down from HTMLDocument |
113 | 105 |
114 [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMStrin
g title; | 106 [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMStrin
g title; |
115 readonly attribute DOMString referrer; | 107 readonly attribute DOMString referrer; |
116 [TreatNullAs=NullString, SetterRaisesException] attribute DOMString
domain; | 108 [TreatNullAs=NullString, RaisesException=Setter] attribute DOMStrin
g domain; |
117 readonly attribute DOMString URL; | 109 readonly attribute DOMString URL; |
118 | 110 |
119 [TreatNullAs=NullString, GetterRaisesException, SetterRaisesExcepti
on] attribute DOMString cookie; | 111 [TreatNullAs=NullString, RaisesException] attribute DOMString cooki
e; |
120 | 112 |
121 [SetterRaisesException, CustomElementCallbacks] attribute HTMLEleme
nt body; | 113 [RaisesException=Setter, CustomElementCallbacks] attribute HTMLElem
ent body; |
122 | 114 |
123 readonly attribute HTMLHeadElement head; | 115 readonly attribute HTMLHeadElement head; |
124 readonly attribute HTMLCollection images; | 116 readonly attribute HTMLCollection images; |
125 readonly attribute HTMLCollection applets; | 117 readonly attribute HTMLCollection applets; |
126 readonly attribute HTMLCollection links; | 118 readonly attribute HTMLCollection links; |
127 readonly attribute HTMLCollection forms; | 119 readonly attribute HTMLCollection forms; |
128 readonly attribute HTMLCollection anchors; | 120 readonly attribute HTMLCollection anchors; |
129 readonly attribute DOMString lastModified; | 121 readonly attribute DOMString lastModified; |
130 | 122 |
131 [PerWorldBindings] NodeList getElementsByName([Default=Undefined] optional D
OMString elementName); | 123 [PerWorldBindings] NodeList getElementsByName([Default=Undefined] optional D
OMString elementName); |
132 | 124 |
133 [PerWorldBindings, ActivityLogging=AccessForIsolatedWorlds, PutForwards=href
] readonly attribute Location location; | 125 [PerWorldBindings, ActivityLogging=ForIsolatedWorlds, PutForwards=href] read
only attribute Location location; |
134 | 126 |
135 // IE extensions | 127 // IE extensions |
136 [MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined, TreatNullAs
=NullString] attribute DOMString charset; | 128 [MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined, TreatNullAs
=NullString] attribute DOMString charset; |
137 [MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined] readonly at
tribute DOMString defaultCharset; | 129 [MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined] readonly at
tribute DOMString defaultCharset; |
138 [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyStat
e; | 130 [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyStat
e; |
139 | 131 |
140 Element elementFromPoint([Default=Undefined] optional long x, | 132 Element elementFromPoint([Default=Undefined] optional long x, |
141 [Default=Undefined] optional long y); | 133 [Default=Undefined] optional long y); |
142 Range caretRangeFromPoint([Default=Undefined] optional long x, | 134 Range caretRangeFromPoint([Default=Undefined] optional long x, |
143 [Default=Undefined] optional long y); | 135 [Default=Undefined] optional long y); |
144 | 136 |
145 // Mozilla extensions | 137 // Mozilla extensions |
146 Selection getSelection(); | 138 Selection getSelection(); |
147 [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet; | 139 [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet; |
148 | 140 |
149 // WebKit extensions | 141 // WebKit extensions |
150 | 142 |
151 [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStyle
sheetSet; | 143 [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStyle
sheetSet; |
152 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute
DOMString selectedStylesheetSet; | 144 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute
DOMString selectedStylesheetSet; |
153 | 145 |
154 CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString na
me, long width, long height); | 146 CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString na
me, long width, long height); |
155 | 147 |
156 // HTML 5 | 148 // HTML 5 |
157 NodeList getElementsByClassName([Default=Undefined] optional DOMString tagna
me); | 149 NodeList getElementsByClassName(DOMString classNames); |
158 | 150 |
159 readonly attribute DOMString compatMode; | 151 readonly attribute DOMString compatMode; |
160 | 152 |
161 // NodeSelector - Selector API | 153 // NodeSelector - Selector API |
162 [RaisesException] Element querySelector(DOMString selectors); | 154 [RaisesException] Element querySelector(DOMString selectors); |
163 [RaisesException] NodeList querySelectorAll(DOMString selectors); | 155 [RaisesException] NodeList querySelectorAll(DOMString selectors); |
164 | 156 |
165 void webkitExitPointerLock(); | 157 void webkitExitPointerLock(); |
166 readonly attribute Element webkitPointerLockElement; | 158 readonly attribute Element webkitPointerLockElement; |
167 | 159 |
(...skipping 12 matching lines...) Expand all Loading... |
180 attribute EventHandler onselectionchange; | 172 attribute EventHandler onselectionchange; |
181 attribute EventHandler onselectstart; | 173 attribute EventHandler onselectstart; |
182 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | 174 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
183 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | 175 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; |
184 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | 176 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; |
185 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | 177 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; |
186 attribute EventHandler onwebkitfullscreenchange; | 178 attribute EventHandler onwebkitfullscreenchange; |
187 attribute EventHandler onwebkitfullscreenerror; | 179 attribute EventHandler onwebkitfullscreenerror; |
188 attribute EventHandler onwebkitpointerlockchange; | 180 attribute EventHandler onwebkitpointerlockchange; |
189 attribute EventHandler onwebkitpointerlockerror; | 181 attribute EventHandler onwebkitpointerlockerror; |
190 [ActivityLogging=SetterForAllWorlds] attribute EventHandler onwheel; | 182 [PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute EventH
andler onwheel; |
191 | 183 |
192 [RuntimeEnabled=Touch] Touch createTouch([Default=Undefined] optional Window
window, | 184 [RuntimeEnabled=Touch] Touch createTouch([Default=Undefined] optional Window
window, |
193 [Default=Undefined] optional Even
tTarget target, | 185 [Default=Undefined] optional Even
tTarget target, |
194 [Default=Undefined] optional long
identifier, | 186 [Default=Undefined] optional long
identifier, |
195 [Default=Undefined] optional long
pageX, | 187 [Default=Undefined] optional long
pageX, |
196 [Default=Undefined] optional long
pageY, | 188 [Default=Undefined] optional long
pageY, |
197 [Default=Undefined] optional long
screenX, | 189 [Default=Undefined] optional long
screenX, |
198 [Default=Undefined] optional long
screenY, | 190 [Default=Undefined] optional long
screenY, |
199 [Default=Undefined] optional long
webkitRadiusX, | 191 [Default=Undefined] optional long
webkitRadiusX, |
200 [Default=Undefined] optional long
webkitRadiusY, | 192 [Default=Undefined] optional long
webkitRadiusY, |
201 [Default=Undefined] optional floa
t webkitRotationAngle, | 193 [Default=Undefined] optional floa
t webkitRotationAngle, |
202 [Default=Undefined] optional floa
t webkitForce); | 194 [Default=Undefined] optional floa
t webkitForce); |
203 [RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches); | 195 [RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches); |
204 | 196 |
205 [DeprecateAs=PrefixedDocumentRegister, RuntimeEnabled=CustomElements, Implem
entedAs=registerElement, CallWith=ScriptState, CustomElementCallbacks, RaisesExc
eption] CustomElementConstructor webkitRegister(DOMString name, optional Diction
ary options); | 197 [DeprecateAs=PrefixedDocumentRegister, RuntimeEnabled=CustomElements, Implem
entedAs=registerElement, CallWith=ScriptState, CustomElementCallbacks, RaisesExc
eption] CustomElementConstructor webkitRegister(DOMString name, optional Diction
ary options); |
206 [RuntimeEnabled=CustomElements, ImplementedAs=registerElement, CallWith=Scri
ptState, CustomElementCallbacks, RaisesException] CustomElementConstructor regis
ter(DOMString name, optional Dictionary options); | 198 [RuntimeEnabled=CustomElements, ImplementedAs=registerElement, CallWith=Scri
ptState, CustomElementCallbacks, RaisesException] CustomElementConstructor regis
ter(DOMString name, optional Dictionary options); |
207 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=AccessForIsolated
Worlds, RaisesException] Element createElement(DOMString localName, [TreatNullAs
=NullString] DOMString typeExtension); | 199 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds
, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullS
tring] DOMString typeExtension); |
208 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=AccessForIsolated
Worlds, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMStr
ing namespaceURI, DOMString qualifiedName, | 200 [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds
, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString na
mespaceURI, DOMString qualifiedName, |
209 [TreatNullAs=NullString] DOMString typeExtension); | 201 [TreatNullAs=NullString] DOMString typeExtension); |
210 | 202 |
211 // Page visibility API. | 203 // Page visibility API. |
212 readonly attribute DOMString webkitVisibilityState; | 204 readonly attribute DOMString visibilityState; |
213 readonly attribute boolean webkitHidden; | 205 readonly attribute boolean hidden; |
| 206 |
| 207 // Deprecated prefixed page visibility API. |
| 208 // TODO(davidben): This is a property so attaching a deprecation warning res
ults in false positives when outputting |
| 209 // document in the console. It's possible http://crbug.com/43394 will resolv
e this. |
| 210 [MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly a
ttribute DOMString webkitVisibilityState; |
| 211 [MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute
boolean webkitHidden; |
214 | 212 |
215 // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-fi
le/tip/csp-specification.dev.html#script-interfaces | 213 // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-fi
le/tip/csp-specification.dev.html#script-interfaces |
216 [RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] readonly attribut
e SecurityPolicy securityPolicy; | 214 [RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] readonly attribut
e SecurityPolicy securityPolicy; |
217 | 215 |
218 readonly attribute HTMLScriptElement currentScript; | 216 readonly attribute HTMLScriptElement currentScript; |
219 }; | 217 }; |
220 | 218 |
221 Document implements GlobalEventHandlers; | 219 Document implements GlobalEventHandlers; |
222 Document implements ParentNode; | 220 Document implements ParentNode; |
OLD | NEW |