1/* 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21module core { 22 23 interface [ 24 CustomMarkFunction, 25 CustomPushEventHandlerScope, 26 CustomToJS, 27 GenerateConstructor, 28 GenerateNativeConverter, 29 InlineGetOwnPropertySlot, 30 Polymorphic, 31 InterfaceUUID=84BA0D7A-7E3E-4a7b-B6FB-7653E8FB54ED, 32 ImplementationUUID=81B47FDB-94B0-40fd-8E0C-FB2A6E53CC04 33 ] Node 34#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 35 : Object, EventTarget 36#endif /* defined(LANGUAGE_OBJECTIVE_C) */ 37 { 38 // NodeType 39 const unsigned short ELEMENT_NODE = 1; 40 const unsigned short ATTRIBUTE_NODE = 2; 41 const unsigned short TEXT_NODE = 3; 42 const unsigned short CDATA_SECTION_NODE = 4; 43 const unsigned short ENTITY_REFERENCE_NODE = 5; 44 const unsigned short ENTITY_NODE = 6; 45 const unsigned short PROCESSING_INSTRUCTION_NODE = 7; 46 const unsigned short COMMENT_NODE = 8; 47 const unsigned short DOCUMENT_NODE = 9; 48 const unsigned short DOCUMENT_TYPE_NODE = 10; 49 const unsigned short DOCUMENT_FRAGMENT_NODE = 11; 50 const unsigned short NOTATION_NODE = 12; 51 52 readonly attribute [ConvertNullStringTo=Null] DOMString nodeName; 53 54 // FIXME: the spec says this can also raise on retrieval. 55 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString nodeValue 56 setter raises(DOMException); 57 58 readonly attribute unsigned short nodeType; 59 readonly attribute Node parentNode; 60 readonly attribute NodeList childNodes; 61 readonly attribute Node firstChild; 62 readonly attribute Node lastChild; 63 readonly attribute Node previousSibling; 64 readonly attribute Node nextSibling; 65 readonly attribute NamedNodeMap attributes; 66 readonly attribute Document ownerDocument; 67 68 [OldStyleObjC, Custom] Node insertBefore(in [Return] Node newChild, 69 in Node refChild) 70 raises(DOMException); 71 [OldStyleObjC, Custom] Node replaceChild(in Node newChild, 72 in [Return] Node oldChild) 73 raises(DOMExceptionJSC); 74 [Custom] Node removeChild(in [Return] Node oldChild) 75 raises(DOMException); 76 [Custom] Node appendChild(in [Return] Node newChild) 77 raises(DOMException); 78 79 boolean hasChildNodes(); 80 Node cloneNode(in boolean deep); 81 void normalize(); 82 83 // Introduced in DOM Level 2: 84 85 [OldStyleObjC] boolean isSupported(in DOMString feature, 86 in [ConvertNullToNullString] DOMString version); 87 88 readonly attribute [ConvertNullStringTo=Null] DOMString namespaceURI; 89 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString prefix 90 setter raises(DOMException); 91 readonly attribute [ConvertNullStringTo=Null] DOMString localName; 92 93 boolean hasAttributes(); 94 95 // Introduced in DOM Level 3: 96 97 readonly attribute [ConvertNullStringTo=Null] DOMString baseURI; 98 99 // FIXME: the spec says this can also raise on retrieval. 100 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString textContent 101 setter raises(DOMException); 102 103 boolean isSameNode(in Node other); 104 boolean isEqualNode(in Node other); 105 [ConvertNullStringTo=Null] DOMString lookupPrefix(in [ConvertNullToNullString] DOMString namespaceURI); 106 boolean isDefaultNamespace(in [ConvertNullToNullString] DOMString namespaceURI); 107 [ConvertNullStringTo=Null] DOMString lookupNamespaceURI(in [ConvertNullToNullString] DOMString prefix); 108 109 // DocumentPosition 110 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01; 111 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02; 112 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04; 113 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08; 114 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10; 115 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; 116 117 unsigned short compareDocumentPosition(in Node other); 118 119#if 0 120 DOMObject getFeature(in DOMString feature, 121 in DOMString version); 122 DOMUserData setUserData(in DOMString key, 123 in DOMUserData data, 124 in UserDataHandler handler); 125 DOMUserData getUserData(in DOMString key); 126#endif /* 0 */ 127 128 // IE extensions 129 readonly attribute Element parentElement; 130 131#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 132 // Objective-C extensions 133 readonly attribute boolean isContentEditable; 134#endif /* defined(LANGUAGE_OBJECTIVE_C) */ 135 136#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C 137#if !defined(LANGUAGE_COM) || !LANGUAGE_COM 138 [Custom] void addEventListener(in DOMString type, 139 in EventListener listener, 140 in boolean useCapture); 141 [Custom] void removeEventListener(in DOMString type, 142 in EventListener listener, 143 in boolean useCapture); 144 boolean dispatchEvent(in Event event) 145 raises(EventException); 146#endif 147#endif 148 }; 149 150} 151