2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / WebCore / dom / Node.idl
blobf45eaa687d51bc1bc0cc3f3039ce5a796da478fb
1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
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.
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.
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.
21 module core {
23 interface [
24 CustomMarkFunction,
25 GenerateConstructor,
26 GenerateNativeConverter,
27 GenerateToJS,
28 InlineGetOwnPropertySlot,
29 ObjCCustomInternalImpl,
30 InterfaceUUID=84BA0D7A-7E3E-4a7b-B6FB-7653E8FB54ED,
31 ImplementationUUID=81B47FDB-94B0-40fd-8E0C-FB2A6E53CC04
32 ] Node
33 #if defined(LANGUAGE_OBJECTIVE_C)
34 : Object, EventTarget
35 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
37 // NodeType
38 const unsigned short ELEMENT_NODE = 1;
39 const unsigned short ATTRIBUTE_NODE = 2;
40 const unsigned short TEXT_NODE = 3;
41 const unsigned short CDATA_SECTION_NODE = 4;
42 const unsigned short ENTITY_REFERENCE_NODE = 5;
43 const unsigned short ENTITY_NODE = 6;
44 const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
45 const unsigned short COMMENT_NODE = 8;
46 const unsigned short DOCUMENT_NODE = 9;
47 const unsigned short DOCUMENT_TYPE_NODE = 10;
48 const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
49 const unsigned short NOTATION_NODE = 12;
51 readonly attribute [ConvertNullStringTo=Null] DOMString nodeName;
53 // FIXME: the spec says this can also raise on retrieval.
54 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString nodeValue
55 setter raises(DOMException);
57 readonly attribute unsigned short nodeType;
58 readonly attribute Node parentNode;
59 readonly attribute NodeList childNodes;
60 readonly attribute Node firstChild;
61 readonly attribute Node lastChild;
62 readonly attribute Node previousSibling;
63 readonly attribute Node nextSibling;
64 readonly attribute NamedNodeMap attributes;
65 readonly attribute Document ownerDocument;
67 [OldStyleObjC, Custom] Node insertBefore(in [Return] Node newChild,
68 in Node refChild)
69 raises(DOMException);
70 [OldStyleObjC, Custom] Node replaceChild(in Node newChild,
71 in [Return] Node oldChild)
72 raises(DOMException);
73 [Custom] Node removeChild(in [Return] Node oldChild)
74 raises(DOMException);
75 [Custom] Node appendChild(in [Return] Node newChild)
76 raises(DOMException);
78 boolean hasChildNodes();
79 Node cloneNode(in boolean deep);
80 void normalize();
82 // Introduced in DOM Level 2:
84 [OldStyleObjC] boolean isSupported(in DOMString feature,
85 in [ConvertNullToNullString] DOMString version);
87 readonly attribute [ConvertNullStringTo=Null] DOMString namespaceURI;
88 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString prefix
89 setter raises(DOMException);
90 readonly attribute [ConvertNullStringTo=Null] DOMString localName;
92 boolean hasAttributes();
94 // Introduced in DOM Level 3:
96 readonly attribute [ConvertNullStringTo=Null] DOMString baseURI;
98 // FIXME: the spec says this can also raise on retrieval.
99 attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString textContent
100 setter raises(DOMException);
102 boolean isSameNode(in Node other);
103 boolean isEqualNode(in Node other);
104 [ConvertNullStringTo=Null] DOMString lookupPrefix(in [ConvertNullToNullString] DOMString namespaceURI);
105 boolean isDefaultNamespace(in [ConvertNullToNullString] DOMString namespaceURI);
106 [ConvertNullStringTo=Null] DOMString lookupNamespaceURI(in [ConvertNullToNullString] DOMString prefix);
108 // DocumentPosition
109 const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
110 const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
111 const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
112 const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
113 const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
114 const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
116 unsigned short compareDocumentPosition(in Node other);
118 #if 0
119 DOMObject getFeature(in DOMString feature,
120 in DOMString version);
121 DOMUserData setUserData(in DOMString key,
122 in DOMUserData data,
123 in UserDataHandler handler);
124 DOMUserData getUserData(in DOMString key);
125 #endif /* 0 */
127 // IE extentions
128 readonly attribute Node parentElement;
130 #if defined(LANGUAGE_OBJECTIVE_C)
131 // Objective-C extensions
132 readonly attribute boolean isContentEditable;
133 #endif /* defined(LANGUAGE_OBJECTIVE_C) */