blob: 985097cf8da1337a49fcb80b5eca95369a04818a [file] [log] [blame]
/*
* 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.
*/
[
CustomToV8
] interface Document : Node {
// DOM Level 1 Core
readonly attribute DocumentType doctype;
readonly attribute DOMImplementation implementation;
readonly attribute Element documentElement;
[DeliverCustomElementCallbacks, 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] CDATASection createCDATASection([Default=Undefined] optional DOMString data);
[RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
[Default=Undefined] optional DOMString data);
[RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
[RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
[PerWorldBindings] NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);
// Introduced in DOM Level 2:
[DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
optional boolean deep);
[DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
[TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
[RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
[TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
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] readonly attribute DOMString inputEncoding;
[TreatReturnedNullStringAs=Null] readonly attribute DOMString xmlEncoding;
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlVersion;
[SetterRaisesException] attribute boolean xmlStandalone;
[RaisesException] 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 Tranversal and Range (DocumentRange interface)
Range createRange();
// DOM Level 2 Tranversal and Range (DocumentTraversal interface)
[RaisesException] NodeIterator createNodeIterator([Default=Undefined] optional Node root,
[Default=Undefined] optional unsigned long whatToShow,
[Default=Undefined] optional NodeFilter filter,
[Default=Undefined] optional boolean expandEntityReferences);
[RaisesException] TreeWalker createTreeWalker([Default=Undefined] optional Node root,
[Default=Undefined] optional unsigned long whatToShow,
[Default=Undefined] optional NodeFilter filter,
[Default=Undefined] optional boolean expandEntityReferences);
// 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)
CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
[Default=Undefined] optional DOMString pseudoElement);
// DOM Level 3 XPath (XPathEvaluator interface)
[RaisesException] XPathExpression createExpression([Default=Undefined] optional DOMString expression,
[Default=Undefined] optional XPathNSResolver resolver);
XPathNSResolver createNSResolver(Node nodeResolver);
[Custom, RaisesException] XPathResult evaluate([Default=Undefined] optional DOMString expression,
[Default=Undefined] optional Node contextNode,
[Default=Undefined] optional XPathNSResolver resolver,
[Default=Undefined] optional unsigned short type,
[Default=Undefined] optional XPathResult inResult);
// Common extensions
[DeliverCustomElementCallbacks]
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] 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] 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, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] 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
DOMSelection 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);
// Mozilla version
[EnabledAtRuntime=fullscreen] readonly attribute boolean webkitIsFullScreen;
[EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
[EnabledAtRuntime=fullscreen] readonly attribute Element webkitCurrentFullScreenElement;
[EnabledAtRuntime=fullscreen] void webkitCancelFullScreen();
// W3C version
[EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullscreenEnabled;
[EnabledAtRuntime=fullscreen] readonly attribute Element webkitFullscreenElement;
[EnabledAtRuntime=fullscreen] void webkitExitFullscreen();
void webkitExitPointerLock();
readonly attribute Element webkitPointerLockElement;
[EnabledAtRuntime=cssRegions] DOMNamedFlowCollection webkitGetNamedFlows();
[EnabledAtRuntime=fontLoadEvents] readonly attribute FontLoader fontloader;
// 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,EnabledAtRuntime=touch] attribute EventListener ontouchstart;
[NotEnumerable,EnabledAtRuntime=touch] attribute EventListener ontouchmove;
[NotEnumerable,EnabledAtRuntime=touch] attribute EventListener ontouchend;
[NotEnumerable,EnabledAtRuntime=touch] attribute EventListener ontouchcancel;
[NotEnumerable] attribute EventListener onwebkitfullscreenchange;
[NotEnumerable] attribute EventListener onwebkitfullscreenerror;
[NotEnumerable] attribute EventListener onwebkitpointerlockchange;
[NotEnumerable] attribute EventListener onwebkitpointerlockerror;
[NotEnumerable, EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute EventListener onsecuritypolicyviolation;
[EnabledAtRuntime=touch, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow 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();
[EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, DeliverCustomElementCallbacks, RaisesException] CustomElementConstructor webkitRegister(DOMString name, optional Dictionary options);
[DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension);
[DeliverCustomElementCallbacks, 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 DOMSecurityPolicy securityPolicy;
};