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
|
/*
* Copyright (C) 2006, 2007, 2011, 2015 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.
*/
[
Constructor,
ConstructorCallWith=Document,
CustomToJSObject,
ExportMacro=WEBCORE_EXPORT,
JSCustomHeader,
JSCustomMarkFunction,
JSGenerateToNativeObject,
] interface Document : Node {
readonly attribute DocumentType? doctype;
readonly attribute DOMImplementation implementation;
[DOMJIT=Getter] readonly attribute Element? documentElement;
[NewObject, MayThrowException, ImplementedAs=createElementForBindings] Element createElement(DOMString tagName);
[NewObject] DocumentFragment createDocumentFragment();
[NewObject] Text createTextNode(DOMString data);
[NewObject] Comment createComment(DOMString data);
[NewObject, MayThrowException] CDATASection createCDATASection(DOMString data);
[NewObject, MayThrowException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[NewObject, MayThrowException] Attr createAttribute(DOMString name);
HTMLCollection getElementsByTagName(DOMString tagname);
[CEReactions, MayThrowException, NewObject] Node importNode(Node importedNode, optional boolean deep = false);
[NewObject, MayThrowException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
[NewObject, MayThrowException] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
[ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString inputEncoding;
readonly attribute DOMString? xmlEncoding;
[SetterMayThrowException] attribute DOMString? xmlVersion;
attribute boolean xmlStandalone;
[CEReactions, MayThrowException] Node adoptNode(Node source);
[ImplementedAs=urlForBindings] readonly attribute USVString documentURI;
[MayThrowException, NewObject] Event createEvent(DOMString eventType);
[NewObject] Range createRange();
[NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
readonly attribute DOMWindow defaultView;
readonly attribute StyleSheetList styleSheets;
// FIXME: Using "undefined" as default parameter value is wrong.
CSSStyleDeclaration getOverrideStyle(optional Element? element = null, optional DOMString pseudoElement = "undefined");
readonly attribute DOMString contentType;
// FIXME: Using "undefined" as default parameter value is wrong.
[MayThrowException] XPathExpression createExpression(optional DOMString expression = "undefined", optional XPathNSResolver? resolver);
XPathNSResolver createNSResolver(Node? nodeResolver);
// FIXME: Using "undefined" as default parameter value is wrong.
[MayThrowException] XPathResult evaluate(optional DOMString expression = "undefined", optional Node? contextNode, optional XPathNSResolver? resolver, optional unsigned short type = 0, optional XPathResult? inResult);
// FIXME: The default value for the last parameter should be the empty string.
[CEReactions] boolean execCommand(DOMString command, optional boolean userInterface = false, optional DOMString? value = null);
boolean queryCommandEnabled(DOMString command);
boolean queryCommandIndeterm(DOMString command);
boolean queryCommandState(DOMString command);
boolean queryCommandSupported(DOMString command);
DOMString queryCommandValue(DOMString command);
[CEReactions] attribute DOMString title;
attribute DOMString dir;
attribute DOMString designMode;
readonly attribute USVString referrer;
[SetterMayThrowException] attribute USVString domain;
[ImplementedAs=urlForBindings] readonly attribute USVString URL;
[GetterMayThrowException, SetterMayThrowException] attribute USVString cookie;
[CEReactions, DOMJIT=Getter, ImplementedAs=bodyOrFrameset, SetterMayThrowException] 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 HTMLCollection embeds;
readonly attribute HTMLCollection plugins;
readonly attribute HTMLCollection scripts;
readonly attribute DOMString lastModified;
NodeList getElementsByName([AtomicString] DOMString elementName);
[PutForwards=href, Unforgeable] readonly attribute Location? location;
[ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString charset;
readonly attribute DOMString readyState;
Range caretRangeFromPoint(optional long x = 0, optional long y = 0);
// Mozilla extensions
DOMSelection getSelection();
[ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString characterSet;
readonly attribute DOMString? preferredStylesheetSet;
attribute DOMString? selectedStylesheetSet;
// FIXME: This is not standard and has been dropped from Blink already.
[Custom] (CanvasRenderingContext2D or WebGLRenderingContextBase) getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
HTMLCollection getElementsByClassName(DOMString classNames);
boolean hasFocus();
readonly attribute DOMString compatMode;
#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
// Mozilla version
readonly attribute boolean webkitIsFullScreen;
readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
[ImplementedAs=webkitCurrentFullScreenElementForBindings] readonly attribute Element webkitCurrentFullScreenElement;
void webkitCancelFullScreen();
// W3C version
readonly attribute boolean webkitFullscreenEnabled;
[ImplementedAs=webkitFullscreenElementForBindings] readonly attribute Element? webkitFullscreenElement;
void webkitExitFullscreen();
#endif
[Conditional=POINTER_LOCK] void exitPointerLock();
[Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
readonly attribute FontFaceSet fonts;
#if defined(ENABLE_IOS_TOUCH_EVENTS) && ENABLE_IOS_TOUCH_EVENTS
#include <WebKitAdditions/DocumentIOS.idl>
#elif defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
[NewObject] Touch createTouch(optional DOMWindow? window = null, optional EventTarget? target = null,
optional long identifier = 0,
optional long pageX = 0, optional long pageY = 0, optional long screenX = 0, optional long screenY = 0,
optional long webkitRadiusX = 0, optional long webkitRadiusY = 0,
optional unrestricted float webkitRotationAngle = NaN, optional unrestricted float webkitForce = NaN);
[NewObject, Custom] TouchList createTouchList(Touch... touches);
#endif
// Page visibility API.
readonly attribute VisibilityState visibilityState;
readonly attribute boolean hidden;
attribute EventHandler onvisibilitychange;
// currentscript API: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-currentscript
readonly attribute HTMLScriptElement? currentScript;
// http://www.w3.org/TR/2014/WD-dom-20140204/#dom-document-origin
readonly attribute USVString origin;
// http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement
readonly attribute Element? scrollingElement;
// Unique to Element and Document
// FIXME: Should these be exposed on Window as well (and therefore moved to GlobalEventHandlers.idl)?
[NotEnumerable] attribute EventHandler onbeforecopy;
[NotEnumerable] attribute EventHandler onbeforecut;
[NotEnumerable] attribute EventHandler onbeforeinput;
[NotEnumerable] attribute EventHandler onbeforepaste;
[NotEnumerable] attribute EventHandler oncopy;
[NotEnumerable] attribute EventHandler oncut;
[NotEnumerable] attribute EventHandler onpaste;
[NotEnumerable] attribute EventHandler onselectstart;
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenchange;
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenerror;
// Unique to Document and HTMLBodyElement
[NotEnumerable] attribute EventHandler onselectionchange;
// Unique to Document
[LenientThis] attribute EventHandler onreadystatechange;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockchange;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockerror;
};
enum VisibilityState {
"hidden",
"visible",
"prerender"
};
Document implements ParentNode;
Document implements NonElementParentNode;
Document implements DocumentOrShadowRoot;
Document implements GlobalEventHandlers;
|