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 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
|
/*
* 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.
*/
[
CustomToJSObject,
JSGenerateToNativeObject,
JSInlineGetOwnPropertySlot
] interface Document : Node {
// DOM Level 1 Core
readonly attribute DocumentType doctype;
readonly attribute DOMImplementation implementation;
readonly attribute Element documentElement;
[ReturnNewObject] Element createElement(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString tagName)
raises (DOMException);
DocumentFragment createDocumentFragment();
[ReturnNewObject] Text createTextNode(in [Optional=DefaultIsUndefined] DOMString data);
[ReturnNewObject] Comment createComment(in [Optional=DefaultIsUndefined] DOMString data);
[ReturnNewObject] CDATASection createCDATASection(in [Optional=DefaultIsUndefined] DOMString data)
raises(DOMException);
[ObjCLegacyUnnamedParameters, ReturnNewObject] ProcessingInstruction createProcessingInstruction(in [Optional=DefaultIsUndefined] DOMString target,
in [Optional=DefaultIsUndefined] DOMString data)
raises (DOMException);
[ReturnNewObject] Attr createAttribute(in [Optional=DefaultIsUndefined] DOMString name)
raises (DOMException);
[ReturnNewObject] EntityReference createEntityReference(in [Optional=DefaultIsUndefined] DOMString name)
raises(DOMException);
NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString tagname);
// Introduced in DOM Level 2:
[ObjCLegacyUnnamedParameters, ReturnNewObject] Node importNode(in [Optional=DefaultIsUndefined] Node importedNode,
in [Optional] boolean deep)
raises (DOMException);
[ObjCLegacyUnnamedParameters, ReturnNewObject] Element createElementNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName)
raises (DOMException);
[ObjCLegacyUnnamedParameters, ReturnNewObject] Attr createAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName)
raises (DOMException);
[ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString localName);
Element getElementById(in [Optional=DefaultIsUndefined] DOMString elementId);
// DOM Level 3 Core
[TreatReturnedNullStringAs=Null] readonly attribute DOMString inputEncoding;
[TreatReturnedNullStringAs=Null] readonly attribute DOMString xmlEncoding;
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString xmlVersion
setter raises (DOMException);
attribute boolean xmlStandalone
setter raises (DOMException);
Node adoptNode(in [Optional=DefaultIsUndefined] Node source)
raises (DOMException);
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
// document.documentURI was writable in DOM3 Core, but is read-only in DOM4
// (see http://www.w3.org/TR/2011/WD-dom-20110915/#document). We need to keep
// the writable version around for Objective C clients, but are moving to
// read-only for other clients.
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString documentURI;
#else
[TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI;
#endif
// DOM Level 2 Events (DocumentEvents interface)
Event createEvent(in [Optional=DefaultIsUndefined] DOMString eventType)
raises(DOMException);
// DOM Level 2 Tranversal and Range (DocumentRange interface)
Range createRange();
// DOM Level 2 Tranversal and Range (DocumentTraversal interface)
[ObjCLegacyUnnamedParameters] NodeIterator createNodeIterator(in [Optional=DefaultIsUndefined] Node root,
in [Optional=DefaultIsUndefined] unsigned long whatToShow,
in [Optional=DefaultIsUndefined] NodeFilter filter,
in [Optional=DefaultIsUndefined] boolean expandEntityReferences)
raises(DOMException);
[ObjCLegacyUnnamedParameters] TreeWalker createTreeWalker(in [Optional=DefaultIsUndefined] Node root,
in [Optional=DefaultIsUndefined] unsigned long whatToShow,
in [Optional=DefaultIsUndefined] NodeFilter filter,
in [Optional=DefaultIsUndefined] boolean expandEntityReferences)
raises(DOMException);
// 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)
[ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle(in [Optional=DefaultIsUndefined] Element element,
in [Optional=DefaultIsUndefined] DOMString pseudoElement);
// DOM Level 3 XPath (XPathEvaluator interface)
[ObjCLegacyUnnamedParameters] XPathExpression createExpression(in [Optional=DefaultIsUndefined] DOMString expression,
in [Optional=DefaultIsUndefined] XPathNSResolver resolver)
raises(DOMException);
XPathNSResolver createNSResolver(in Node nodeResolver);
[ObjCLegacyUnnamedParameters, V8Custom] XPathResult evaluate(in [Optional=DefaultIsUndefined] DOMString expression,
in [Optional=DefaultIsUndefined] Node contextNode,
in [Optional=DefaultIsUndefined] XPathNSResolver resolver,
in [Optional=DefaultIsUndefined] unsigned short type,
in [Optional=DefaultIsUndefined] XPathResult inResult)
raises(DOMException);
// Common extensions
boolean execCommand(in [Optional=DefaultIsUndefined] DOMString command,
in [Optional=DefaultIsUndefined] boolean userInterface,
in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString value);
#if defined(LANGUAGE_OBJECTIVE_C) && 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 [Optional=DefaultIsUndefined] DOMString command);
boolean queryCommandIndeterm(in [Optional=DefaultIsUndefined] DOMString command);
boolean queryCommandState(in [Optional=DefaultIsUndefined] DOMString command);
boolean queryCommandSupported(in [Optional=DefaultIsUndefined] DOMString command);
DOMString queryCommandValue(in [Optional=DefaultIsUndefined] DOMString command);
// Moved down from HTMLDocument
[TreatNullAs=NullString] attribute DOMString title;
readonly attribute DOMString referrer;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[TreatNullAs=NullString] attribute DOMString domain
setter raises (DOMException);
#else
readonly attribute DOMString domain;
#endif
readonly attribute DOMString URL;
[TreatNullAs=NullString] attribute DOMString cookie
setter raises (DOMException),
getter raises (DOMException);
attribute HTMLElement body
setter raises (DOMException);
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;
NodeList getElementsByName(in [Optional=DefaultIsUndefined] DOMString elementName);
#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
NodeList getItems(in [TreatNullAs=NullString, TreatUndefinedAs=NullString, Optional=DefaultIsUndefined] DOMString typeNames);
#endif
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[Custom] attribute Location location;
#endif
// IE extensions
[TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
[TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
[TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
Element elementFromPoint(in [Optional=DefaultIsUndefined] long x,
in [Optional=DefaultIsUndefined] long y);
Range caretRangeFromPoint(in [Optional=DefaultIsUndefined] long x,
in [Optional=DefaultIsUndefined] long y);
// Mozilla extensions
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
DOMSelection getSelection();
#endif
[TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet;
// WebKit extensions
[TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;
#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
CSSStyleDeclaration createCSSStyleDeclaration();
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// DOM Level 2 Style Interface
[ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(in Element element,
in DOMString pseudoElement);
// WebKit extension
// FIXME: remove the first version once [Optional] is implemented for Objective-C.
[ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element,
in DOMString pseudoElement);
[ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element,
in DOMString pseudoElement,
in [Optional] boolean authorOnly);
#endif
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
CanvasRenderingContext getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
#endif
#endif
// HTML 5
NodeList getElementsByClassName(in [Optional=DefaultIsUndefined] DOMString tagname);
readonly attribute DOMString compatMode;
// NodeSelector - Selector API
Element querySelector(in DOMString selectors)
raises(DOMException);
NodeList querySelectorAll(in DOMString selectors)
raises(DOMException);
#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
// Mozilla version
[V8EnabledAtRuntime] readonly attribute boolean webkitIsFullScreen;
[V8EnabledAtRuntime] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
[V8EnabledAtRuntime] readonly attribute Element webkitCurrentFullScreenElement;
[V8EnabledAtRuntime] void webkitCancelFullScreen();
// W3C version
[V8EnabledAtRuntime] readonly attribute boolean webkitFullscreenEnabled;
[V8EnabledAtRuntime] readonly attribute Element webkitFullscreenElement;
[V8EnabledAtRuntime] void webkitExitFullscreen();
#endif
[Conditional=POINTER_LOCK] void webkitExitPointerLock();
[Conditional=POINTER_LOCK] readonly attribute Element webkitPointerLockElement;
[Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
// Event handler DOM attributes
[NotEnumerable] attribute EventListener onabort;
[NotEnumerable] attribute EventListener onblur;
[NotEnumerable] attribute EventListener onchange;
[NotEnumerable] attribute EventListener onclick;
[NotEnumerable] attribute EventListener oncontextmenu;
[NotEnumerable] attribute EventListener ondblclick;
[NotEnumerable] attribute EventListener ondrag;
[NotEnumerable] attribute EventListener ondragend;
[NotEnumerable] attribute EventListener ondragenter;
[NotEnumerable] attribute EventListener ondragleave;
[NotEnumerable] attribute EventListener ondragover;
[NotEnumerable] attribute EventListener ondragstart;
[NotEnumerable] attribute EventListener ondrop;
[NotEnumerable] attribute EventListener onerror;
[NotEnumerable] attribute EventListener onfocus;
[NotEnumerable] attribute EventListener oninput;
[NotEnumerable] attribute EventListener oninvalid;
[NotEnumerable] attribute EventListener onkeydown;
[NotEnumerable] attribute EventListener onkeypress;
[NotEnumerable] attribute EventListener onkeyup;
[NotEnumerable] attribute EventListener onload;
[NotEnumerable] attribute EventListener onmousedown;
[NotEnumerable] attribute EventListener onmousemove;
[NotEnumerable] attribute EventListener onmouseout;
[NotEnumerable] attribute EventListener onmouseover;
[NotEnumerable] attribute EventListener onmouseup;
[NotEnumerable] attribute EventListener onmousewheel;
[NotEnumerable] attribute EventListener onreadystatechange;
[NotEnumerable] attribute EventListener onscroll;
[NotEnumerable] attribute EventListener onselect;
[NotEnumerable] attribute EventListener onsubmit;
// attribute [NotEnumerable] EventListener oncanplay;
// attribute [NotEnumerable] EventListener oncanplaythrough;
// attribute [NotEnumerable] EventListener ondurationchange;
// attribute [NotEnumerable] EventListener onemptied;
// attribute [NotEnumerable] EventListener onended;
// attribute [NotEnumerable] EventListener onloadeddata;
// attribute [NotEnumerable] EventListener onloadedmetadata;
// attribute [NotEnumerable] EventListener onloadstart;
// attribute [NotEnumerable] EventListener onpause;
// attribute [NotEnumerable] EventListener onplay;
// attribute [NotEnumerable] EventListener onplaying;
// attribute [NotEnumerable] EventListener onprogress;
// attribute [NotEnumerable] EventListener onratechange;
// attribute [NotEnumerable] EventListener onseeked;
// attribute [NotEnumerable] EventListener onseeking;
// attribute [NotEnumerable] EventListener onshow;
// attribute [NotEnumerable] EventListener onstalled;
// attribute [NotEnumerable] EventListener onsuspend;
// attribute [NotEnumerable] EventListener ontimeupdate;
// attribute [NotEnumerable] EventListener onvolumechange;
// attribute [NotEnumerable] EventListener onwaiting;
// WebKit extensions
[NotEnumerable] attribute EventListener onbeforecut;
[NotEnumerable] attribute EventListener oncut;
[NotEnumerable] attribute EventListener onbeforecopy;
[NotEnumerable] attribute EventListener oncopy;
[NotEnumerable] attribute EventListener onbeforepaste;
[NotEnumerable] attribute EventListener onpaste;
[NotEnumerable] attribute EventListener onreset;
[NotEnumerable] attribute EventListener onsearch;
[NotEnumerable] attribute EventListener onselectstart;
[NotEnumerable] attribute EventListener onselectionchange;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel;
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange;
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockchange;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockerror;
#endif
#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
[ReturnNewObject, V8EnabledAtRuntime] Touch createTouch(in [Optional=DefaultIsUndefined] DOMWindow window,
in [Optional=DefaultIsUndefined] EventTarget target,
in [Optional=DefaultIsUndefined] long identifier,
in [Optional=DefaultIsUndefined] long pageX,
in [Optional=DefaultIsUndefined] long pageY,
in [Optional=DefaultIsUndefined] long screenX,
in [Optional=DefaultIsUndefined] long screenY,
in [Optional=DefaultIsUndefined] long webkitRadiusX,
in [Optional=DefaultIsUndefined] long webkitRadiusY,
in [Optional=DefaultIsUndefined] float webkitRotationAngle,
in [Optional=DefaultIsUndefined] float webkitForce)
raises (DOMException);
[ReturnNewObject, V8EnabledAtRuntime, Custom] TouchList createTouchList()
raises (DOMException);
#endif
#if defined(LANGUAGE_CPP) && LANGUAGE_CPP
// Extra WebCore methods exposed to allow compile-time casting in C++
boolean isHTMLDocument();
#endif
// Page visibility API.
[Conditional=PAGE_VISIBILITY_API] readonly attribute DOMString webkitVisibilityState;
[Conditional=PAGE_VISIBILITY_API] readonly attribute boolean webkitHidden;
// Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces
[Conditional=CSP_NEXT] readonly attribute DOMSecurityPolicy securityPolicy;
};
|