/* * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. * Copyright (C) 2006, 2007 Samuel Weinig * * 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. */ module core { interface [ CustomToJS, GenerateNativeConverter, InlineGetOwnPropertySlot ] Document : Node { // DOM Level 1 Core readonly attribute DocumentType doctype; readonly attribute DOMImplementation implementation; readonly attribute Element documentElement; [ReturnsNew] Element createElement(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString tagName) raises (DOMException); DocumentFragment createDocumentFragment(); [ReturnsNew] Text createTextNode(in [Optional=CallWithDefaultValue] DOMString data); [ReturnsNew] Comment createComment(in [Optional=CallWithDefaultValue] DOMString data); [ReturnsNew] CDATASection createCDATASection(in [Optional=CallWithDefaultValue] DOMString data) raises(DOMException); [OldStyleObjC, ReturnsNew] ProcessingInstruction createProcessingInstruction(in [Optional=CallWithDefaultValue] DOMString target, in [Optional=CallWithDefaultValue] DOMString data) raises (DOMException); [ReturnsNew] Attr createAttribute(in [Optional=CallWithDefaultValue] DOMString name) raises (DOMException); [ReturnsNew] EntityReference createEntityReference(in [Optional=CallWithDefaultValue] DOMString name) raises(DOMException); NodeList getElementsByTagName(in [Optional=CallWithDefaultValue] DOMString tagname); // Introduced in DOM Level 2: [OldStyleObjC, ReturnsNew] Node importNode(in [Optional=CallWithDefaultValue] Node importedNode, in [Optional=CallWithDefaultValue] boolean deep) raises (DOMException); [OldStyleObjC, ReturnsNew] Element createElementNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI, in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString qualifiedName) raises (DOMException); [OldStyleObjC, ReturnsNew] Attr createAttributeNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI, in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString qualifiedName) raises (DOMException); [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString,Optional=CallWithDefaultValue] DOMString namespaceURI, in [Optional=CallWithDefaultValue] DOMString localName); Element getElementById(in [Optional=CallWithDefaultValue] DOMString elementId); // DOM Level 3 Core readonly attribute [ConvertNullStringTo=Null] DOMString inputEncoding; readonly attribute [ConvertNullStringTo=Null] DOMString xmlEncoding; attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString xmlVersion setter raises (DOMException); attribute boolean xmlStandalone setter raises (DOMException); Node adoptNode(in [Optional=CallWithDefaultValue] Node source) raises (DOMException); attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString documentURI; // DOM Level 2 Events (DocumentEvents interface) Event createEvent(in [Optional=CallWithDefaultValue] DOMString eventType) raises(DOMException); // DOM Level 2 Tranversal and Range (DocumentRange interface) Range createRange(); // DOM Level 2 Tranversal and Range (DocumentTraversal interface) [OldStyleObjC] NodeIterator createNodeIterator(in [Optional=CallWithDefaultValue] Node root, in [Optional=CallWithDefaultValue] unsigned long whatToShow, in [Optional=CallWithDefaultValue] NodeFilter filter, in [Optional=CallWithDefaultValue] boolean expandEntityReferences) raises(DOMException); [OldStyleObjC] TreeWalker createTreeWalker(in [Optional=CallWithDefaultValue] Node root, in [Optional=CallWithDefaultValue] unsigned long whatToShow, in [Optional=CallWithDefaultValue] NodeFilter filter, in [Optional=CallWithDefaultValue] 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) [OldStyleObjC] CSSStyleDeclaration getOverrideStyle(in [Optional=CallWithDefaultValue] Element element, in [Optional=CallWithDefaultValue] DOMString pseudoElement); #if defined(ENABLE_XPATH) && ENABLE_XPATH // DOM Level 3 XPath (XPathEvaluator interface) [OldStyleObjC] XPathExpression createExpression(in [Optional=CallWithDefaultValue] DOMString expression, in [Optional=CallWithDefaultValue] XPathNSResolver resolver) raises(DOMException); XPathNSResolver createNSResolver(in Node nodeResolver); [OldStyleObjC, V8Custom] XPathResult evaluate(in [Optional=CallWithDefaultValue] DOMString expression, in [Optional=CallWithDefaultValue] Node contextNode, in [Optional=CallWithDefaultValue] XPathNSResolver resolver, in [Optional=CallWithDefaultValue] unsigned short type, in [Optional=CallWithDefaultValue] XPathResult inResult) raises(DOMException); #endif // ENABLE_XPATH // Common extensions boolean execCommand(in [Optional=CallWithDefaultValue] DOMString command, in [Optional=CallWithDefaultValue] boolean userInterface, in [ConvertUndefinedOrNullToNullString,Optional=CallWithDefaultValue] 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=CallWithDefaultValue] DOMString command); boolean queryCommandIndeterm(in [Optional=CallWithDefaultValue] DOMString command); boolean queryCommandState(in [Optional=CallWithDefaultValue] DOMString command); boolean queryCommandSupported(in [Optional=CallWithDefaultValue] DOMString command); [ConvertNullStringTo=False] DOMString queryCommandValue(in [Optional=CallWithDefaultValue] DOMString command); // Moved down from HTMLDocument attribute [ConvertNullToNullString] DOMString title; readonly attribute DOMString referrer; #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT attribute [ConvertNullToNullString] DOMString domain setter raises (DOMException); #else readonly attribute DOMString domain; #endif readonly attribute DOMString URL; attribute [ConvertNullToNullString] DOMString cookie setter raises (DOMException), getter raises (DOMException); // FIXME: the DOM spec does NOT have this attribute // raising an exception. 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=CallWithDefaultValue] DOMString elementName); #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT attribute [Custom] Location location; #endif // IE extensions attribute [ConvertNullStringTo=Undefined, ConvertNullToNullString] DOMString charset; readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset; readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState; Element elementFromPoint(in [Optional=CallWithDefaultValue] long x, in [Optional=CallWithDefaultValue] long y); Range caretRangeFromPoint(in [Optional=CallWithDefaultValue] long x, in [Optional=CallWithDefaultValue] long y); // Mozilla extensions #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT DOMSelection getSelection(); #endif readonly attribute [ConvertNullStringTo=Null] DOMString characterSet; // WebKit extensions readonly attribute [ConvertNullStringTo=Null] DOMString preferredStylesheetSet; attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString selectedStylesheetSet; #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT CSSStyleDeclaration createCSSStyleDeclaration(); #endif #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C // DOM Level 2 Style Interface [OldStyleObjC, UsesView] CSSStyleDeclaration getComputedStyle(in Element element, in DOMString pseudoElement); // WebKit extension // FIXME: remove the first version once [Optional] is implemented for Objective-C. [UsesView] CSSRuleList getMatchedCSSRules(in Element element, in DOMString pseudoElement); [UsesView] 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 [V8Custom] DOMObject getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height); #endif #endif // HTML 5 NodeList getElementsByClassName(in [Optional=CallWithDefaultValue] 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 readonly attribute [EnabledAtRuntime] boolean webkitIsFullScreen; readonly attribute [EnabledAtRuntime] boolean webkitFullScreenKeyboardInputAllowed; readonly attribute [EnabledAtRuntime] Element webkitCurrentFullScreenElement; [EnabledAtRuntime] void webkitCancelFullScreen(); #endif #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C // Event handler DOM attributes attribute [DontEnum] EventListener onabort; attribute [DontEnum] EventListener onblur; attribute [DontEnum] EventListener onchange; attribute [DontEnum] EventListener onclick; attribute [DontEnum] EventListener oncontextmenu; attribute [DontEnum] EventListener ondblclick; attribute [DontEnum] EventListener ondrag; attribute [DontEnum] EventListener ondragend; attribute [DontEnum] EventListener ondragenter; attribute [DontEnum] EventListener ondragleave; attribute [DontEnum] EventListener ondragover; attribute [DontEnum] EventListener ondragstart; attribute [DontEnum] EventListener ondrop; attribute [DontEnum] EventListener onerror; attribute [DontEnum] EventListener onfocus; attribute [DontEnum] EventListener oninput; attribute [DontEnum] EventListener oninvalid; attribute [DontEnum] EventListener onkeydown; attribute [DontEnum] EventListener onkeypress; attribute [DontEnum] EventListener onkeyup; attribute [DontEnum] EventListener onload; attribute [DontEnum] EventListener onmousedown; attribute [DontEnum] EventListener onmousemove; attribute [DontEnum] EventListener onmouseout; attribute [DontEnum] EventListener onmouseover; attribute [DontEnum] EventListener onmouseup; attribute [DontEnum] EventListener onmousewheel; attribute [DontEnum] EventListener onreadystatechange; attribute [DontEnum] EventListener onscroll; attribute [DontEnum] EventListener onselect; attribute [DontEnum] EventListener onsubmit; // attribute [DontEnum] EventListener oncanplay; // attribute [DontEnum] EventListener oncanplaythrough; // attribute [DontEnum] EventListener ondurationchange; // attribute [DontEnum] EventListener onemptied; // attribute [DontEnum] EventListener onended; // attribute [DontEnum] EventListener onloadeddata; // attribute [DontEnum] EventListener onloadedmetadata; // attribute [DontEnum] EventListener onloadstart; // attribute [DontEnum] EventListener onpause; // attribute [DontEnum] EventListener onplay; // attribute [DontEnum] EventListener onplaying; // attribute [DontEnum] EventListener onprogress; // attribute [DontEnum] EventListener onratechange; // attribute [DontEnum] EventListener onseeked; // attribute [DontEnum] EventListener onseeking; // attribute [DontEnum] EventListener onshow; // attribute [DontEnum] EventListener onstalled; // attribute [DontEnum] EventListener onsuspend; // attribute [DontEnum] EventListener ontimeupdate; // attribute [DontEnum] EventListener onvolumechange; // attribute [DontEnum] EventListener onwaiting; // WebKit extensions attribute [DontEnum] EventListener onbeforecut; attribute [DontEnum] EventListener oncut; attribute [DontEnum] EventListener onbeforecopy; attribute [DontEnum] EventListener oncopy; attribute [DontEnum] EventListener onbeforepaste; attribute [DontEnum] EventListener onpaste; attribute [DontEnum] EventListener onreset; attribute [DontEnum] EventListener onsearch; attribute [DontEnum] EventListener onselectstart; attribute [DontEnum] EventListener onselectionchange; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel; attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange; #endif #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS [ReturnsNew, EnabledAtRuntime] Touch createTouch(in [Optional=CallWithDefaultValue] DOMWindow window, in [Optional=CallWithDefaultValue] EventTarget target, in [Optional=CallWithDefaultValue] long identifier, in [Optional=CallWithDefaultValue] long pageX, in [Optional=CallWithDefaultValue] long pageY, in [Optional=CallWithDefaultValue] long screenX, in [Optional=CallWithDefaultValue] long screenY, in [Optional=CallWithDefaultValue] long webkitRadiusX, in [Optional=CallWithDefaultValue] long webkitRadiusY, in [Optional=CallWithDefaultValue] float webkitRotationAngle, in [Optional=CallWithDefaultValue] float webkitForce) raises (DOMException); [ReturnsNew, EnabledAtRuntime, 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. readonly attribute [Conditional=PAGE_VISIBILITY_API] DOMString webkitVisibilityState; readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitHidden; }; }