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
|
/*
* 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 ();
typedef (CanvasRenderingContext2D or WebGLRenderingContext) RenderingContext;
// http://www.w3.org/TR/page-visibility/#VisibilityState
enum VisibilityState { "hidden", "visible", "prerender", "unloaded" };
interface Document : Node {
// DOM Level 1 Core
readonly attribute DocumentType doctype;
readonly attribute DOMImplementation implementation;
readonly attribute Element documentElement;
[CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString tagName);
DocumentFragment createDocumentFragment();
Text createTextNode(DOMString data);
Comment createComment(DOMString data);
[RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection(DOMString data); // Removed from DOM4.
[RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute(DOMString name);
HTMLCollection getElementsByTagName(DOMString localName);
// Introduced in DOM Level 2:
[CustomElementCallbacks, RaisesException, TypeChecking=Interface] Node importNode(Node node, optional boolean deep = false);
[CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
[RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString? qualifiedName);
HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
[PerWorldBindings] Element getElementById(DOMString elementId);
// DOM Level 3 Core
[MeasureAs=DocumentInputEncoding, ImplementedAs=characterSet] readonly attribute DOMString? inputEncoding;
[MeasureAs=DocumentXMLEncoding] readonly attribute DOMString? xmlEncoding; // Removed from DOM4.
[RaisesException=Setter, MeasureAs=DocumentXMLVersion] attribute DOMString? xmlVersion; // Removed from DOM4.
[RaisesException=Setter, MeasureAs=DocumentXMLStandalone] attribute boolean xmlStandalone; // Removed from DOM4.
[RaisesException, CustomElementCallbacks, TypeChecking=Interface] Node adoptNode(Node node);
[ImplementedAs=url] readonly attribute DOMString? documentURI;
readonly attribute DOMString origin;
// DOM Level 2 Events (DocumentEvents interface)
[RaisesException] Event createEvent(DOMString eventType);
// DOM Level 2 Traversal and Range (DocumentRange interface)
Range createRange();
// DOM Level 2 Traversal and Range (DocumentTraversal interface)
[RaisesException, TypeChecking=Interface] NodeIterator createNodeIterator(Node root,
optional unsigned long whatToShow = 0xFFFFFFFF,
optional NodeFilter? filter = null);
[RaisesException, TypeChecking=Interface] TreeWalker createTreeWalker(Node root,
optional unsigned long whatToShow = 0xFFFFFFFF,
optional NodeFilter? filter = null);
// DOM Level 2 Abstract Views (DocumentView interface)
[ImplementedAs=domWindow] readonly attribute Window defaultView;
// DOM Level 2 Style (DocumentStyle interface)
readonly attribute StyleSheetList styleSheets;
// DOM Level 2 Style (DocumentCSS interface)
[MeasureAs=DocumentGetOverrideStyle] CSSStyleDeclaration getOverrideStyle();
// DOM 4
readonly attribute DOMString contentType;
// Common extensions
[CustomElementCallbacks]
boolean execCommand(DOMString command, optional boolean showUI = false, optional DOMString value = "");
boolean queryCommandEnabled(DOMString command);
boolean queryCommandIndeterm(DOMString command);
boolean queryCommandState(DOMString command);
boolean queryCommandSupported(DOMString command);
DOMString queryCommandValue(DOMString command);
// Moved down from HTMLDocument
[TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString dir;
[TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString designMode;
[TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString title;
readonly attribute DOMString referrer;
[TreatNullAs=NullString, RaisesException=Setter] attribute DOMString domain;
readonly attribute DOMString URL;
[TreatNullAs=NullString, RaisesException] attribute DOMString cookie;
[RaisesException=Setter, CustomElementCallbacks, PerWorldBindings, TypeChecking=Interface] attribute HTMLElement? body;
readonly attribute HTMLHeadElement head;
readonly attribute HTMLCollection images;
readonly attribute HTMLCollection applets;
readonly attribute HTMLCollection embeds;
[ImplementedAs=embeds] readonly attribute HTMLCollection plugins;
readonly attribute HTMLCollection links;
readonly attribute HTMLCollection forms;
readonly attribute HTMLCollection scripts;
readonly attribute HTMLCollection anchors;
readonly attribute DOMString lastModified;
[PerWorldBindings] NodeList getElementsByName(DOMString elementName);
[PutForwards=href] readonly attribute Location location;
// IE extensions
[MeasureAs=DocumentCharset, TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
[MeasureAs=DocumentDefaultCharset, TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
[TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
Element elementFromPoint(long x, long y);
[MeasureAs=DocumentCaretRangeFromPoint]
Range caretRangeFromPoint([Default=Undefined] optional long x,
[Default=Undefined] optional long y);
// Mozilla extensions
Selection getSelection();
readonly attribute DOMString? characterSet;
// WebKit extensions
readonly attribute DOMString? preferredStylesheetSet;
attribute DOMString? selectedStylesheetSet;
[MeasureAs=DocumentGetCSSCanvasContext] RenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
// HTML 5
HTMLCollection getElementsByClassName(DOMString classNames);
readonly attribute Element activeElement;
boolean hasFocus();
readonly attribute DOMString compatMode;
[MeasureAs=DocumentExitPointerLock] void exitPointerLock();
[MeasureAs=DocumentPointerLockElement] readonly attribute Element pointerLockElement;
// Event handler attributes
attribute EventHandler onbeforecopy;
attribute EventHandler onbeforecut;
attribute EventHandler onbeforepaste;
attribute EventHandler oncopy;
attribute EventHandler oncut;
attribute EventHandler onpaste;
attribute EventHandler onpointerlockchange;
attribute EventHandler onpointerlockerror;
attribute EventHandler onreadystatechange;
attribute EventHandler onsearch;
[RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute EventHandler onsecuritypolicyviolation;
attribute EventHandler onselectionchange;
attribute EventHandler onselectstart;
[RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
[RuntimeEnabled=Touch] attribute EventHandler ontouchend;
[RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
[RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
attribute EventHandler onwheel;
[RuntimeEnabled=Touch] Touch createTouch([Default=Undefined] optional Window window,
[Default=Undefined] optional EventTarget target,
[Default=Undefined] optional long identifier,
[Default=Undefined] optional double pageX,
[Default=Undefined] optional double pageY,
[Default=Undefined] optional double screenX,
[Default=Undefined] optional double screenY,
[Default=Undefined] optional double webkitRadiusX,
[Default=Undefined] optional double webkitRadiusY,
[Default=Undefined] optional float webkitRotationAngle,
[Default=Undefined] optional float webkitForce);
[RuntimeEnabled=Touch] TouchList createTouchList(Touch... touches);
[CallWith=ScriptState, CustomElementCallbacks, RaisesException, MeasureAs=DocumentRegisterElement] CustomElementConstructor registerElement(DOMString name, optional ElementRegistrationOptions options);
[CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, DOMString? typeExtension);
[CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString? typeExtension);
// Page visibility API.
readonly attribute VisibilityState visibilityState;
readonly attribute boolean hidden;
// Deprecated prefixed page visibility API.
// TODO(davidben): This is a property so attaching a deprecation warning results in false positives when outputting
// document in the console. It's possible http://crbug.com/43394 will resolve this.
[MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly attribute DOMString webkitVisibilityState;
[MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute boolean webkitHidden;
readonly attribute HTMLScriptElement currentScript;
};
Document implements GlobalEventHandlers;
Document implements ParentNode;
|