blob: 6e33081d8692f95e64923f497fadc146883d7130 [file] [log] [blame]
darin8d1badc2006-03-06 16:50:13 +00001/*
weinig3843e432007-06-07 04:28:36 +00002 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
weiniga8192c02006-08-28 03:33:34 +00003 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
darin8d1badc2006-03-06 16:50:13 +00004 *
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
ddkilzerc8eccec2007-09-26 02:29:57 +000017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
darin8d1badc2006-03-06 16:50:13 +000019 */
20
andersca3bd28d12006-02-08 11:48:10 +000021module core {
mjs04973112006-02-24 07:16:15 +000022
weinigb2ec73c2007-10-31 01:02:47 +000023 interface [
24 GenerateConstructor,
25 GenerateNativeConverter,
weinig@apple.comc2fb3212008-05-26 20:41:08 +000026 InlineGetOwnPropertySlot,
weinigb2ec73c2007-10-31 01:02:47 +000027 InterfaceUUID=FEFE9C21-E58C-4b5b-821A-61A514613763,
28 ImplementationUUID=12E5B08E-A680-4baf-9D1E-108AEF7ABBFB
29 ] Element : EventTargetNode {
darin8d1badc2006-03-06 16:50:13 +000030
mjs74dd8222006-04-07 08:31:17 +000031 // DOM Level 1 Core
darin248fb4b2006-03-14 22:58:25 +000032
mjs74dd8222006-04-07 08:31:17 +000033 readonly attribute [ConvertNullStringTo=Null] DOMString tagName;
darin8d1badc2006-03-06 16:50:13 +000034
andersca3bd28d12006-02-08 11:48:10 +000035 [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name);
weinig63192cb2007-08-10 18:10:42 +000036 [OldStyleObjC, Custom] void setAttribute(in DOMString name,
37 in DOMString value)
andersca3bd28d12006-02-08 11:48:10 +000038 raises(DOMException);
andersca3bd28d12006-02-08 11:48:10 +000039 void removeAttribute(in DOMString name)
darin942dc762006-03-16 09:28:01 +000040 raises(DOMException);
darin527e3c42006-08-31 00:20:18 +000041 Attr getAttributeNode(in DOMString name);
weinig63192cb2007-08-10 18:10:42 +000042 [Custom] Attr setAttributeNode(in Attr newAttr)
andersca3bd28d12006-02-08 11:48:10 +000043 raises(DOMException);
darin527e3c42006-08-31 00:20:18 +000044 Attr removeAttributeNode(in Attr oldAttr)
darin942dc762006-03-16 09:28:01 +000045 raises(DOMException);
darin527e3c42006-08-31 00:20:18 +000046 NodeList getElementsByTagName(in DOMString name);
darin248fb4b2006-03-14 22:58:25 +000047
mjs74dd8222006-04-07 08:31:17 +000048 // DOM Level 2 Core
darin8d1badc2006-03-06 16:50:13 +000049
thatcher12854cc2006-09-03 20:38:00 +000050 [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
weinig100b4c62006-09-11 17:11:59 +000051 in DOMString localName);
weinig63192cb2007-08-10 18:10:42 +000052 [OldStyleObjC, Custom] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
53 in DOMString qualifiedName,
54 in DOMString value)
andersca3bd28d12006-02-08 11:48:10 +000055 raises(DOMException);
thatcher12854cc2006-09-03 20:38:00 +000056 [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
weinig100b4c62006-09-11 17:11:59 +000057 in DOMString localName)
andersca3bd28d12006-02-08 11:48:10 +000058 raises(DOMException);
thatcher12854cc2006-09-03 20:38:00 +000059 [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI,
weinig100b4c62006-09-11 17:11:59 +000060 in DOMString localName);
thatcher12854cc2006-09-03 20:38:00 +000061 [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI,
weinig100b4c62006-09-11 17:11:59 +000062 in DOMString localName);
weinig63192cb2007-08-10 18:10:42 +000063 [Custom] Attr setAttributeNodeNS(in Attr newAttr)
andersca3bd28d12006-02-08 11:48:10 +000064 raises(DOMException);
mjs74dd8222006-04-07 08:31:17 +000065 boolean hasAttribute(in DOMString name);
thatcher12854cc2006-09-03 20:38:00 +000066 [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
weinig100b4c62006-09-11 17:11:59 +000067 in DOMString localName);
darin8d1badc2006-03-06 16:50:13 +000068
weinigb2ec73c2007-10-31 01:02:47 +000069#if !defined(LANGUAGE_COM)
darin527e3c42006-08-31 00:20:18 +000070 readonly attribute CSSStyleDeclaration style;
weinigb2ec73c2007-10-31 01:02:47 +000071#endif
darin8d1badc2006-03-06 16:50:13 +000072
mjs74dd8222006-04-07 08:31:17 +000073 // Common extensions
74
darin527e3c42006-08-31 00:20:18 +000075 readonly attribute long offsetLeft;
darin527e3c42006-08-31 00:20:18 +000076 readonly attribute long offsetTop;
darin527e3c42006-08-31 00:20:18 +000077 readonly attribute long offsetWidth;
darin527e3c42006-08-31 00:20:18 +000078 readonly attribute long offsetHeight;
darin527e3c42006-08-31 00:20:18 +000079 readonly attribute Element offsetParent;
hyattb0aa8152006-09-10 04:55:03 +000080 readonly attribute long clientLeft;
hyattb0aa8152006-09-10 04:55:03 +000081 readonly attribute long clientTop;
darin527e3c42006-08-31 00:20:18 +000082 readonly attribute long clientWidth;
darin527e3c42006-08-31 00:20:18 +000083 readonly attribute long clientHeight;
weinig100b4c62006-09-11 17:11:59 +000084 attribute long scrollLeft;
85 attribute long scrollTop;
darin527e3c42006-08-31 00:20:18 +000086 readonly attribute long scrollWidth;
darin527e3c42006-08-31 00:20:18 +000087 readonly attribute long scrollHeight;
mjs74dd8222006-04-07 08:31:17 +000088
89 void focus();
mjs74dd8222006-04-07 08:31:17 +000090 void blur();
darin527e3c42006-08-31 00:20:18 +000091 void scrollIntoView(in [Optional] boolean alignWithTop);
mjs74dd8222006-04-07 08:31:17 +000092
93 // IE extensions
darin8c3ba962006-03-31 18:51:40 +000094
thatcher7da1ad92006-09-05 02:45:57 +000095 boolean contains(in Element element);
darin8c3ba962006-03-31 18:51:40 +000096
mjs74dd8222006-04-07 08:31:17 +000097 // WebKit extensions
98
darin527e3c42006-08-31 00:20:18 +000099 void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
thatcher7da1ad92006-09-05 02:45:57 +0000100 void scrollByLines(in long lines);
thatcher7da1ad92006-09-05 02:45:57 +0000101 void scrollByPages(in long pages);
mjs74dd8222006-04-07 08:31:17 +0000102
weinig@apple.com1bed3cb2007-12-14 21:48:20 +0000103 // HTML 5
104 NodeList getElementsByClassName(in DOMString name);
105
weinig@apple.com4c74be02008-07-07 21:29:56 +0000106 // NodeSelector - Selector API
weinig@apple.comdc9a5202008-07-11 07:34:45 +0000107#if defined(LANGUAGE_JAVASCRIPT)
108 [Custom] Element querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver)
dsmith@webkit.orgac7f8e12007-12-26 00:46:46 +0000109 raises(DOMException);
weinig@apple.comdc9a5202008-07-11 07:34:45 +0000110 [Custom] NodeList querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver)
dsmith@webkit.orgac7f8e12007-12-26 00:46:46 +0000111 raises(DOMException);
weinig@apple.comdc9a5202008-07-11 07:34:45 +0000112#else
113 // FIXME: add support for NSResolver in languages other than JS
114 Element querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
115 raises(DOMException);
116 NodeList querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors)
117 raises(DOMException);
118#endif
dsmith@webkit.orgac7f8e12007-12-26 00:46:46 +0000119
darin@apple.com5a7a34d2008-06-08 20:30:50 +0000120 // ElementTraversal API
darin@apple.com67d03f12008-06-13 03:10:54 +0000121#if !defined(LANGUAGE_COM)
darin@apple.com5a7a34d2008-06-08 20:30:50 +0000122 readonly attribute Element firstElementChild;
123 readonly attribute Element lastElementChild;
124 readonly attribute Element previousElementSibling;
125 readonly attribute Element nextElementSibling;
126 readonly attribute unsigned long childElementCount;
darin@apple.com67d03f12008-06-13 03:10:54 +0000127#endif
darin@apple.com5a7a34d2008-06-08 20:30:50 +0000128
rwlbuis60bf75092006-12-10 18:16:47 +0000129#if defined(LANGUAGE_OBJECTIVE_C)
130 // Objective-C extensions
131 readonly attribute DOMString innerText;
darin@apple.comc38c0722008-01-01 01:37:55 +0000132#endif
rwlbuis60bf75092006-12-10 18:16:47 +0000133
andersca3bd28d12006-02-08 11:48:10 +0000134 };
mjs04973112006-02-24 07:16:15 +0000135
andersca3bd28d12006-02-08 11:48:10 +0000136}