| /* |
| * 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 |
| ] interface Document : Node { |
| |
| // DOM Level 1 Core |
| readonly attribute DocumentType doctype; |
| readonly attribute DOMImplementation implementation; |
| readonly attribute Element documentElement; |
| |
| [ReturnNewObject, DeliverCustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement([TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString tagName); |
| DocumentFragment createDocumentFragment(); |
| [ReturnNewObject, PerWorldBindings] Text createTextNode([Optional=DefaultIsUndefined] DOMString data); |
| [ReturnNewObject] Comment createComment([Optional=DefaultIsUndefined] DOMString data); |
| [ReturnNewObject, RaisesException] CDATASection createCDATASection([Optional=DefaultIsUndefined] DOMString data); |
| [ReturnNewObject, RaisesException] ProcessingInstruction createProcessingInstruction([Optional=DefaultIsUndefined] DOMString target, |
| [Optional=DefaultIsUndefined] DOMString data); |
| [ReturnNewObject, RaisesException] Attr createAttribute([Optional=DefaultIsUndefined] DOMString name); |
| [ReturnNewObject, RaisesException] EntityReference createEntityReference([Optional=DefaultIsUndefined] DOMString name); |
| [PerWorldBindings] NodeList getElementsByTagName([Optional=DefaultIsUndefined] DOMString tagname); |
| |
| // Introduced in DOM Level 2: |
| |
| [ReturnNewObject, DeliverCustomElementCallbacks, RaisesException] Node importNode([Optional=DefaultIsUndefined] Node importedNode, |
| [Optional] boolean deep); |
| [ReturnNewObject, DeliverCustomElementCallbacks, RaisesException] Element createElementNS([TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, |
| [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName); |
| [ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, |
| [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName); |
| NodeList getElementsByTagNameNS([TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI, |
| [Optional=DefaultIsUndefined] DOMString localName); |
| [PerWorldBindings] Element getElementById([Optional=DefaultIsUndefined] 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([Optional=DefaultIsUndefined] Node source); |
| |
| [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI; |
| |
| // DOM Level 2 Events (DocumentEvents interface) |
| |
| [RaisesException] Event createEvent([Optional=DefaultIsUndefined] DOMString eventType); |
| |
| // DOM Level 2 Tranversal and Range (DocumentRange interface) |
| |
| Range createRange(); |
| |
| // DOM Level 2 Tranversal and Range (DocumentTraversal interface) |
| |
| [RaisesException] NodeIterator createNodeIterator([Optional=DefaultIsUndefined] Node root, |
| [Optional=DefaultIsUndefined] unsigned long whatToShow, |
| [Optional=DefaultIsUndefined] NodeFilter filter, |
| [Optional=DefaultIsUndefined] boolean expandEntityReferences); |
| [RaisesException] TreeWalker createTreeWalker([Optional=DefaultIsUndefined] Node root, |
| [Optional=DefaultIsUndefined] unsigned long whatToShow, |
| [Optional=DefaultIsUndefined] NodeFilter filter, |
| [Optional=DefaultIsUndefined] 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([Optional=DefaultIsUndefined] Element element, |
| [Optional=DefaultIsUndefined] DOMString pseudoElement); |
| |
| // DOM Level 3 XPath (XPathEvaluator interface) |
| [RaisesException] XPathExpression createExpression([Optional=DefaultIsUndefined] DOMString expression, |
| [Optional=DefaultIsUndefined] XPathNSResolver resolver); |
| XPathNSResolver createNSResolver(Node nodeResolver); |
| [Custom, RaisesException] XPathResult evaluate([Optional=DefaultIsUndefined] DOMString expression, |
| [Optional=DefaultIsUndefined] Node contextNode, |
| [Optional=DefaultIsUndefined] XPathNSResolver resolver, |
| [Optional=DefaultIsUndefined] unsigned short type, |
| [Optional=DefaultIsUndefined] XPathResult inResult); |
| |
| // Common extensions |
| [DeliverCustomElementCallbacks] |
| boolean execCommand([Optional=DefaultIsUndefined] DOMString command, |
| [Optional=DefaultIsUndefined] boolean userInterface, |
| [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString value); |
| |
| boolean queryCommandEnabled([Optional=DefaultIsUndefined] DOMString command); |
| boolean queryCommandIndeterm([Optional=DefaultIsUndefined] DOMString command); |
| boolean queryCommandState([Optional=DefaultIsUndefined] DOMString command); |
| boolean queryCommandSupported([Optional=DefaultIsUndefined] DOMString command); |
| DOMString queryCommandValue([Optional=DefaultIsUndefined] 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([Optional=DefaultIsUndefined] DOMString elementName); |
| |
| #if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA |
| NodeList getItems([TreatNullAs=NullString, TreatUndefinedAs=NullString, Optional=DefaultIsUndefined] DOMString typeNames); |
| #endif |
| |
| [Custom] 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([Optional=DefaultIsUndefined] long x, |
| [Optional=DefaultIsUndefined] long y); |
| Range caretRangeFromPoint([Optional=DefaultIsUndefined] long x, |
| [Optional=DefaultIsUndefined] 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([Optional=DefaultIsUndefined] DOMString tagname); |
| |
| readonly attribute DOMString compatMode; |
| |
| // NodeSelector - Selector API |
| [RaisesException] Element querySelector(DOMString selectors); |
| [RaisesException] NodeList querySelectorAll(DOMString selectors); |
| |
| // Mozilla version |
| [EnabledAtRuntime] readonly attribute boolean webkitIsFullScreen; |
| [EnabledAtRuntime] readonly attribute boolean webkitFullScreenKeyboardInputAllowed; |
| [EnabledAtRuntime] readonly attribute Element webkitCurrentFullScreenElement; |
| [EnabledAtRuntime] void webkitCancelFullScreen(); |
| |
| // W3C version |
| [EnabledAtRuntime] readonly attribute boolean webkitFullscreenEnabled; |
| [EnabledAtRuntime] readonly attribute Element webkitFullscreenElement; |
| [EnabledAtRuntime] void webkitExitFullscreen(); |
| |
| void webkitExitPointerLock(); |
| readonly attribute Element webkitPointerLockElement; |
| |
| [Conditional=CSS_REGIONS, EnabledAtRuntime=cssRegions] DOMNamedFlowCollection webkitGetNamedFlows(); |
| |
| [Conditional=FONT_LOAD_EVENTS, 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,Conditional=TOUCH_EVENTS,EnabledAtRuntime=touch] attribute EventListener ontouchstart; |
| [NotEnumerable,Conditional=TOUCH_EVENTS,EnabledAtRuntime=touch] attribute EventListener ontouchmove; |
| [NotEnumerable,Conditional=TOUCH_EVENTS,EnabledAtRuntime=touch] attribute EventListener ontouchend; |
| [NotEnumerable,Conditional=TOUCH_EVENTS,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; |
| |
| #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS |
| [ReturnNewObject, EnabledAtRuntime=touch, RaisesException] Touch createTouch([Optional=DefaultIsUndefined] DOMWindow window, |
| [Optional=DefaultIsUndefined] EventTarget target, |
| [Optional=DefaultIsUndefined] long identifier, |
| [Optional=DefaultIsUndefined] long pageX, |
| [Optional=DefaultIsUndefined] long pageY, |
| [Optional=DefaultIsUndefined] long screenX, |
| [Optional=DefaultIsUndefined] long screenY, |
| [Optional=DefaultIsUndefined] long webkitRadiusX, |
| [Optional=DefaultIsUndefined] long webkitRadiusY, |
| [Optional=DefaultIsUndefined] float webkitRotationAngle, |
| [Optional=DefaultIsUndefined] float webkitForce); |
| [ReturnNewObject, EnabledAtRuntime=touch, Custom, RaisesException] TouchList createTouchList(); |
| #endif |
| |
| #if defined(ENABLE_CUSTOM_ELEMENTS) && ENABLE_CUSTOM_ELEMENTS |
| [EnabledAtRuntime=customDOMElements, Conditional=CUSTOM_ELEMENTS, ImplementedAs=registerElement, CallWith=ScriptState, DeliverCustomElementCallbacks, RaisesException] CustomElementConstructor webkitRegister(DOMString name, [Optional] Dictionary options); |
| [ReturnNewObject, DeliverCustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension); |
| [ReturnNewObject, DeliverCustomElementCallbacks, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName, |
| [TreatNullAs=NullString] DOMString typeExtension); |
| #endif |
| |
| // 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; |
| |
| }; |
| |