2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / WebCore / dom / Element.idl
blobae2c1b8f9dacbbfa7b9c42feedd879a7c0ec518c
1 /*
2 * Copyright (C) 2006, 2007 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 GenerateConstructor,
25 GenerateNativeConverter,
26 InlineGetOwnPropertySlot,
27 InterfaceUUID=FEFE9C21-E58C-4b5b-821A-61A514613763,
28 ImplementationUUID=12E5B08E-A680-4baf-9D1E-108AEF7ABBFB
29 ] Element : EventTargetNode {
31 // DOM Level 1 Core
33 readonly attribute [ConvertNullStringTo=Null] DOMString tagName;
35 [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name);
36 [OldStyleObjC, Custom] void setAttribute(in DOMString name,
37 in DOMString value)
38 raises(DOMException);
39 void removeAttribute(in DOMString name)
40 raises(DOMException);
41 Attr getAttributeNode(in DOMString name);
42 [Custom] Attr setAttributeNode(in Attr newAttr)
43 raises(DOMException);
44 Attr removeAttributeNode(in Attr oldAttr)
45 raises(DOMException);
46 NodeList getElementsByTagName(in DOMString name);
48 // DOM Level 2 Core
50 [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
51 in DOMString localName);
52 [OldStyleObjC, Custom] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
53 in DOMString qualifiedName,
54 in DOMString value)
55 raises(DOMException);
56 [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
57 in DOMString localName)
58 raises(DOMException);
59 [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI,
60 in DOMString localName);
61 [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI,
62 in DOMString localName);
63 [Custom] Attr setAttributeNodeNS(in Attr newAttr)
64 raises(DOMException);
65 boolean hasAttribute(in DOMString name);
66 [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
67 in DOMString localName);
69 #if !defined(LANGUAGE_COM)
70 readonly attribute CSSStyleDeclaration style;
71 #endif
73 // Common extensions
75 readonly attribute long offsetLeft;
76 readonly attribute long offsetTop;
77 readonly attribute long offsetWidth;
78 readonly attribute long offsetHeight;
79 readonly attribute Element offsetParent;
80 readonly attribute long clientLeft;
81 readonly attribute long clientTop;
82 readonly attribute long clientWidth;
83 readonly attribute long clientHeight;
84 attribute long scrollLeft;
85 attribute long scrollTop;
86 readonly attribute long scrollWidth;
87 readonly attribute long scrollHeight;
89 void focus();
90 void blur();
91 void scrollIntoView(in [Optional] boolean alignWithTop);
93 // IE extensions
95 boolean contains(in Element element);
97 // WebKit extensions
99 void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
100 void scrollByLines(in long lines);
101 void scrollByPages(in long pages);
103 // HTML 5
104 NodeList getElementsByClassName(in DOMString name);
106 // NodeSelector - Selector API
107 Element querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
108 raises(DOMException);
109 NodeList querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
110 raises(DOMException);
112 // ElementTraversal API
113 #if !defined(LANGUAGE_COM)
114 readonly attribute Element firstElementChild;
115 readonly attribute Element lastElementChild;
116 readonly attribute Element previousElementSibling;
117 readonly attribute Element nextElementSibling;
118 readonly attribute unsigned long childElementCount;
119 #endif
121 #if defined(LANGUAGE_OBJECTIVE_C)
122 // Objective-C extensions
123 readonly attribute DOMString innerText;
124 #endif