darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 1 | /* |
weinig | 3843e43 | 2007-06-07 04:28:36 +0000 | [diff] [blame] | 2 | * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
weinig | a8192c0 | 2006-08-28 03:33:34 +0000 | [diff] [blame] | 3 | * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 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 |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 19 | */ |
| 20 | |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 21 | module core { |
mjs | 0497311 | 2006-02-24 07:16:15 +0000 | [diff] [blame] | 22 | |
weinig | b2ec73c | 2007-10-31 01:02:47 +0000 | [diff] [blame] | 23 | interface [ |
| 24 | GenerateConstructor, |
| 25 | GenerateNativeConverter, |
weinig@apple.com | c2fb321 | 2008-05-26 20:41:08 +0000 | [diff] [blame] | 26 | InlineGetOwnPropertySlot, |
weinig | b2ec73c | 2007-10-31 01:02:47 +0000 | [diff] [blame] | 27 | InterfaceUUID=FEFE9C21-E58C-4b5b-821A-61A514613763, |
| 28 | ImplementationUUID=12E5B08E-A680-4baf-9D1E-108AEF7ABBFB |
| 29 | ] Element : EventTargetNode { |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 30 | |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 31 | // DOM Level 1 Core |
darin | 248fb4b | 2006-03-14 22:58:25 +0000 | [diff] [blame] | 32 | |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 33 | readonly attribute [ConvertNullStringTo=Null] DOMString tagName; |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 34 | |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 35 | [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name); |
weinig | 63192cb | 2007-08-10 18:10:42 +0000 | [diff] [blame] | 36 | [OldStyleObjC, Custom] void setAttribute(in DOMString name, |
| 37 | in DOMString value) |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 38 | raises(DOMException); |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 39 | void removeAttribute(in DOMString name) |
darin | 942dc76 | 2006-03-16 09:28:01 +0000 | [diff] [blame] | 40 | raises(DOMException); |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 41 | Attr getAttributeNode(in DOMString name); |
weinig | 63192cb | 2007-08-10 18:10:42 +0000 | [diff] [blame] | 42 | [Custom] Attr setAttributeNode(in Attr newAttr) |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 43 | raises(DOMException); |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 44 | Attr removeAttributeNode(in Attr oldAttr) |
darin | 942dc76 | 2006-03-16 09:28:01 +0000 | [diff] [blame] | 45 | raises(DOMException); |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 46 | NodeList getElementsByTagName(in DOMString name); |
darin | 248fb4b | 2006-03-14 22:58:25 +0000 | [diff] [blame] | 47 | |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 48 | // DOM Level 2 Core |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 49 | |
thatcher | 12854cc | 2006-09-03 20:38:00 +0000 | [diff] [blame] | 50 | [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 51 | in DOMString localName); |
weinig | 63192cb | 2007-08-10 18:10:42 +0000 | [diff] [blame] | 52 | [OldStyleObjC, Custom] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
| 53 | in DOMString qualifiedName, |
| 54 | in DOMString value) |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 55 | raises(DOMException); |
thatcher | 12854cc | 2006-09-03 20:38:00 +0000 | [diff] [blame] | 56 | [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 57 | in DOMString localName) |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 58 | raises(DOMException); |
thatcher | 12854cc | 2006-09-03 20:38:00 +0000 | [diff] [blame] | 59 | [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI, |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 60 | in DOMString localName); |
thatcher | 12854cc | 2006-09-03 20:38:00 +0000 | [diff] [blame] | 61 | [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 62 | in DOMString localName); |
weinig | 63192cb | 2007-08-10 18:10:42 +0000 | [diff] [blame] | 63 | [Custom] Attr setAttributeNodeNS(in Attr newAttr) |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 64 | raises(DOMException); |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 65 | boolean hasAttribute(in DOMString name); |
thatcher | 12854cc | 2006-09-03 20:38:00 +0000 | [diff] [blame] | 66 | [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI, |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 67 | in DOMString localName); |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 68 | |
weinig | b2ec73c | 2007-10-31 01:02:47 +0000 | [diff] [blame] | 69 | #if !defined(LANGUAGE_COM) |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 70 | readonly attribute CSSStyleDeclaration style; |
weinig | b2ec73c | 2007-10-31 01:02:47 +0000 | [diff] [blame] | 71 | #endif |
darin | 8d1badc | 2006-03-06 16:50:13 +0000 | [diff] [blame] | 72 | |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 73 | // Common extensions |
| 74 | |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 75 | readonly attribute long offsetLeft; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 76 | readonly attribute long offsetTop; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 77 | readonly attribute long offsetWidth; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 78 | readonly attribute long offsetHeight; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 79 | readonly attribute Element offsetParent; |
hyatt | b0aa815 | 2006-09-10 04:55:03 +0000 | [diff] [blame] | 80 | readonly attribute long clientLeft; |
hyatt | b0aa815 | 2006-09-10 04:55:03 +0000 | [diff] [blame] | 81 | readonly attribute long clientTop; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 82 | readonly attribute long clientWidth; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 83 | readonly attribute long clientHeight; |
weinig | 100b4c6 | 2006-09-11 17:11:59 +0000 | [diff] [blame] | 84 | attribute long scrollLeft; |
| 85 | attribute long scrollTop; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 86 | readonly attribute long scrollWidth; |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 87 | readonly attribute long scrollHeight; |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 88 | |
| 89 | void focus(); |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 90 | void blur(); |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 91 | void scrollIntoView(in [Optional] boolean alignWithTop); |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 92 | |
| 93 | // IE extensions |
darin | 8c3ba96 | 2006-03-31 18:51:40 +0000 | [diff] [blame] | 94 | |
thatcher | 7da1ad9 | 2006-09-05 02:45:57 +0000 | [diff] [blame] | 95 | boolean contains(in Element element); |
darin | 8c3ba96 | 2006-03-31 18:51:40 +0000 | [diff] [blame] | 96 | |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 97 | // WebKit extensions |
| 98 | |
darin | 527e3c4 | 2006-08-31 00:20:18 +0000 | [diff] [blame] | 99 | void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded); |
thatcher | 7da1ad9 | 2006-09-05 02:45:57 +0000 | [diff] [blame] | 100 | void scrollByLines(in long lines); |
thatcher | 7da1ad9 | 2006-09-05 02:45:57 +0000 | [diff] [blame] | 101 | void scrollByPages(in long pages); |
mjs | 74dd822 | 2006-04-07 08:31:17 +0000 | [diff] [blame] | 102 | |
weinig@apple.com | 1bed3cb | 2007-12-14 21:48:20 +0000 | [diff] [blame] | 103 | // HTML 5 |
| 104 | NodeList getElementsByClassName(in DOMString name); |
| 105 | |
weinig@apple.com | 4c74be0 | 2008-07-07 21:29:56 +0000 | [diff] [blame] | 106 | // NodeSelector - Selector API |
weinig@apple.com | dc9a520 | 2008-07-11 07:34:45 +0000 | [diff] [blame] | 107 | #if defined(LANGUAGE_JAVASCRIPT) |
| 108 | [Custom] Element querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver) |
dsmith@webkit.org | ac7f8e1 | 2007-12-26 00:46:46 +0000 | [diff] [blame] | 109 | raises(DOMException); |
weinig@apple.com | dc9a520 | 2008-07-11 07:34:45 +0000 | [diff] [blame] | 110 | [Custom] NodeList querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver) |
dsmith@webkit.org | ac7f8e1 | 2007-12-26 00:46:46 +0000 | [diff] [blame] | 111 | raises(DOMException); |
weinig@apple.com | dc9a520 | 2008-07-11 07:34:45 +0000 | [diff] [blame] | 112 | #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.org | ac7f8e1 | 2007-12-26 00:46:46 +0000 | [diff] [blame] | 119 | |
darin@apple.com | 5a7a34d | 2008-06-08 20:30:50 +0000 | [diff] [blame] | 120 | // ElementTraversal API |
darin@apple.com | 67d03f1 | 2008-06-13 03:10:54 +0000 | [diff] [blame] | 121 | #if !defined(LANGUAGE_COM) |
darin@apple.com | 5a7a34d | 2008-06-08 20:30:50 +0000 | [diff] [blame] | 122 | 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.com | 67d03f1 | 2008-06-13 03:10:54 +0000 | [diff] [blame] | 127 | #endif |
darin@apple.com | 5a7a34d | 2008-06-08 20:30:50 +0000 | [diff] [blame] | 128 | |
rwlbuis | 60bf7509 | 2006-12-10 18:16:47 +0000 | [diff] [blame] | 129 | #if defined(LANGUAGE_OBJECTIVE_C) |
| 130 | // Objective-C extensions |
| 131 | readonly attribute DOMString innerText; |
darin@apple.com | c38c072 | 2008-01-01 01:37:55 +0000 | [diff] [blame] | 132 | #endif |
rwlbuis | 60bf7509 | 2006-12-10 18:16:47 +0000 | [diff] [blame] | 133 | |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 134 | }; |
mjs | 0497311 | 2006-02-24 07:16:15 +0000 | [diff] [blame] | 135 | |
andersca | 3bd28d1 | 2006-02-08 11:48:10 +0000 | [diff] [blame] | 136 | } |