|
1 /* |
|
2 * Copyright (C) 2006, 2007 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 |
|
21 module core { |
|
22 |
|
23 interface [GenerateConstructor, GenerateNativeConverter] Element : EventTargetNode { |
|
24 |
|
25 // DOM Level 1 Core |
|
26 |
|
27 readonly attribute [ConvertNullStringTo=Null] DOMString tagName; |
|
28 |
|
29 [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name); |
|
30 [OldStyleObjC, Custom] void setAttribute(in DOMString name, |
|
31 in DOMString value) |
|
32 raises(DOMException); |
|
33 void removeAttribute(in DOMString name) |
|
34 raises(DOMException); |
|
35 Attr getAttributeNode(in DOMString name); |
|
36 [Custom] Attr setAttributeNode(in Attr newAttr) |
|
37 raises(DOMException); |
|
38 Attr removeAttributeNode(in Attr oldAttr) |
|
39 raises(DOMException); |
|
40 NodeList getElementsByTagName(in DOMString name); |
|
41 |
|
42 // DOM Level 2 Core |
|
43 |
|
44 [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
45 in DOMString localName); |
|
46 [OldStyleObjC, Custom] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
47 in DOMString qualifiedName, |
|
48 in DOMString value) |
|
49 raises(DOMException); |
|
50 [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
51 in DOMString localName) |
|
52 raises(DOMException); |
|
53 [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
54 in DOMString localName); |
|
55 [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
56 in DOMString localName); |
|
57 [Custom] Attr setAttributeNodeNS(in Attr newAttr) |
|
58 raises(DOMException); |
|
59 boolean hasAttribute(in DOMString name); |
|
60 [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
|
61 in DOMString localName); |
|
62 |
|
63 readonly attribute CSSStyleDeclaration style; |
|
64 |
|
65 // Common extensions |
|
66 |
|
67 readonly attribute long offsetLeft; |
|
68 readonly attribute long offsetTop; |
|
69 readonly attribute long offsetWidth; |
|
70 readonly attribute long offsetHeight; |
|
71 readonly attribute Element offsetParent; |
|
72 readonly attribute long clientLeft; |
|
73 readonly attribute long clientTop; |
|
74 readonly attribute long clientWidth; |
|
75 readonly attribute long clientHeight; |
|
76 attribute long scrollLeft; |
|
77 attribute long scrollTop; |
|
78 readonly attribute long scrollWidth; |
|
79 readonly attribute long scrollHeight; |
|
80 |
|
81 void focus(); |
|
82 void blur(); |
|
83 void scrollIntoView(in [Optional] boolean alignWithTop); |
|
84 |
|
85 // IE extensions |
|
86 |
|
87 Node insertAdjacentElement(in DOMString position, |
|
88 in Node element) |
|
89 raises(DOMException); |
|
90 boolean contains(in Element element); |
|
91 |
|
92 // WebKit extensions |
|
93 |
|
94 void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded); |
|
95 void scrollByLines(in long lines); |
|
96 void scrollByPages(in long pages); |
|
97 |
|
98 #if defined(LANGUAGE_OBJECTIVE_C) |
|
99 // Objective-C extensions |
|
100 readonly attribute DOMString innerText; |
|
101 #endif /* defined(LANGUAGE_OBJECTIVE_C) */ |
|
102 |
|
103 }; |
|
104 |
|
105 } |