OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 [ | 21 [ |
22 SpecialWrapFor=HTMLElement|SVGElement | 22 SpecialWrapFor=HTMLElement|SVGElement, |
23 ] interface Element : Node { | 23 ] interface Element : Node { |
24 | 24 |
25 // DOM Level 1 Core | 25 // DOM Level 1 Core |
26 | 26 |
27 [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMStr
ing tagName; | 27 [TreatReturnedNullStringAs=Null] readonly attribute DOMString tagName; |
28 | 28 |
29 [TreatReturnedNullStringAs=Null] DOMString getAttribute(DOMString name); | 29 [TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttribute(DOM
String name); |
30 [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name,
DOMString value); | 30 [RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttribute
(DOMString name, DOMString value); |
31 [CustomElementCallbacks] void removeAttribute(DOMString name); | 31 [CustomElementCallbacks] void removeAttribute(DOMString name); |
32 [MeasureAs=ElementGetAttributeNode] Attr getAttributeNode([Default=Undefined
] optional DOMString name); // Removed from DOM4. | 32 [MeasureAs=ElementGetAttributeNode] Attr getAttributeNode([Default=Undefined
] optional DOMString name); // Removed from DOM4. |
33 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode]
Attr setAttributeNode([Default=Undefined, StrictTypeChecking] optional Attr new
Attr); // Removed from DOM4. | 33 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode]
Attr setAttributeNode([Default=Undefined, TypeChecking=Nullable] optional Attr
newAttr); // Removed from DOM4. |
34 [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNo
de] Attr removeAttributeNode([Default=Undefined, StrictTypeChecking] optional At
tr oldAttr); // Removed from DOM4. | 34 [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNo
de] Attr removeAttributeNode([Default=Undefined, TypeChecking=Nullable] optional
Attr oldAttr); // Removed from DOM4. |
35 [PerWorldBindings] HTMLCollection getElementsByTagName(DOMString name); | 35 HTMLCollection getElementsByTagName(DOMString name); |
36 | 36 |
37 [PerWorldBindings] readonly attribute NamedNodeMap attributes; | 37 [PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute N
amedNodeMap attributes; |
38 [MeasureAs=HasAttributes] boolean hasAttributes(); | 38 [MeasureAs=HasAttributes] boolean hasAttributes(); |
39 | 39 |
40 // DOM Level 2 Core | 40 // DOM Level 2 Core |
41 | 41 |
42 DOMString getAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DO
MString localName); | 42 [TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttributeNS([
TreatNullAs=NullString] DOMString namespaceURI, DOMString localName); |
43 [RaisesException, CustomElementCallbacks] void setAttributeNS([TreatNullAs=N
ullString] DOMString namespaceURI, DOMString qualifiedName, DOMString value); | 43 [RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttribute
NS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName, DOM
String value); |
44 [CustomElementCallbacks] void removeAttributeNS([TreatNullAs=NullString] DOM
String namespaceURI, DOMString localName); | 44 [CustomElementCallbacks] void removeAttributeNS([TreatNullAs=NullString] DOM
String namespaceURI, DOMString localName); |
45 HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString] DOMString nam
espaceURI, DOMString localName); | 45 HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString] DOMString nam
espaceURI, DOMString localName); |
46 [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=N
ullString,Default=Undefined] optional DOMString namespaceURI, | 46 [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=N
ullString, Default=Undefined] optional DOMString namespaceURI, |
47 [Default=Undef
ined] optional DOMString localName); // Removed from DOM4. | 47 [Default=Undef
ined] optional DOMString localName); // Removed from DOM4. |
| 48 [RaisesException, CustomElementCallbacks, DeprecateAs=ElementSetAttributeNod
eNS] Attr setAttributeNodeNS([Default=Undefined, TypeChecking=Nullable] optional
Attr newAttr); // Removed from DOM4. |
48 boolean hasAttribute(DOMString name); | 49 boolean hasAttribute(DOMString name); |
49 boolean hasAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMS
tring localName); | 50 boolean hasAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMS
tring localName); |
50 | 51 |
51 [PerWorldBindings] readonly attribute CSSStyleDeclaration style; | 52 [PerWorldBindings] readonly attribute CSSStyleDeclaration style; |
52 | 53 |
53 // DOM4 | 54 // DOM4 |
54 [Reflect, PerWorldBindings] attribute DOMString id; | 55 [Reflect, DartNoAutoScope] attribute DOMString id; |
55 [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMStr
ing namespaceURI; | 56 [TreatReturnedNullStringAs=Null] readonly attribute DOMString namespaceURI; |
56 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, PerWorldBindings, R
aisesException=Setter] attribute DOMString prefix; | 57 [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Set
ter] attribute DOMString prefix; |
57 [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMStr
ing localName; | 58 [TreatReturnedNullStringAs=Null] readonly attribute DOMString localName; |
58 | 59 |
59 [RaisesException] boolean matches(DOMString selectors); | 60 [RaisesException] boolean matches(DOMString selectors); |
60 | 61 |
61 // Common extensions | 62 // Common extensions |
62 | 63 |
63 [PerWorldBindings] readonly attribute long offsetLeft; | 64 readonly attribute long offsetLeft; |
64 [PerWorldBindings] readonly attribute long offsetTop; | 65 readonly attribute long offsetTop; |
65 [PerWorldBindings] readonly attribute long offsetWidth; | 66 readonly attribute long offsetWidth; |
66 [PerWorldBindings] readonly attribute long offsetHeight; | 67 readonly attribute long offsetHeight; |
67 [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute
Element offsetParent; | 68 [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute
Element offsetParent; |
68 [PerWorldBindings] readonly attribute long clientLeft; | 69 readonly attribute long clientLeft; |
69 [PerWorldBindings] readonly attribute long clientTop; | 70 readonly attribute long clientTop; |
70 [PerWorldBindings] readonly attribute long clientWidth; | 71 readonly attribute long clientWidth; |
71 [PerWorldBindings] readonly attribute long clientHeight; | 72 readonly attribute long clientHeight; |
72 | 73 |
73 // FIXME: should be: | 74 // FIXME: should be: |
74 // [PerWorldBindings] attribute (Dictionary or long) scrollLeft; | 75 // attribute (Dictionary or double) scrollLeft; |
75 // [PerWorldBindings] attribute (Dictionary or long) scrollTop; | 76 // attribute (Dictionary or double) scrollTop; |
76 // http://crbug.com/240176 | 77 // http://crbug.com/240176 |
77 [PerWorldBindings, Custom=Setter] attribute long scrollLeft; | 78 [Custom=Setter] attribute long scrollLeft; |
78 [PerWorldBindings, Custom=Setter] attribute long scrollTop; | 79 [Custom=Setter] attribute long scrollTop; |
79 [PerWorldBindings] readonly attribute long scrollWidth; | 80 readonly attribute long scrollWidth; |
80 [PerWorldBindings] readonly attribute long scrollHeight; | 81 readonly attribute long scrollHeight; |
81 | 82 |
82 void focus(); | 83 void focus(); |
83 void blur(); | 84 void blur(); |
84 void scrollIntoView(optional boolean alignWithTop); | 85 void scrollIntoView(optional boolean alignWithTop); |
85 | 86 |
86 // WebKit extensions | 87 // WebKit extensions |
87 | 88 |
88 void scrollIntoViewIfNeeded(optional boolean centerIfNeeded); | 89 [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(option
al boolean centerIfNeeded); |
89 void scrollByLines([Default=Undefined] optional long lines); | 90 [MeasureAs=ElementScrollByLines] void scrollByLines([Default=Undefined] opti
onal long lines); |
90 void scrollByPages([Default=Undefined] optional long pages); | 91 [MeasureAs=ElementScrollByPages] void scrollByPages([Default=Undefined] opti
onal long pages); |
91 | 92 |
92 // HTML 5 | 93 // HTML 5 |
93 HTMLCollection getElementsByClassName(DOMString classNames); | 94 HTMLCollection getElementsByClassName(DOMString classNames); |
94 [TreatNullAs=NullString, CustomElementCallbacks, PerWorldBindings, ActivityL
ogging=SetterForIsolatedWorlds, RaisesException=Setter] attribute DOMString inne
rHTML; | 95 [TreatNullAs=NullString, CustomElementCallbacks, PerWorldBindings, LogActivi
ty=SetterOnly, RaisesException=Setter] attribute DOMString innerHTML; |
95 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString outerHTML; | 96 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString outerHTML; |
96 | 97 |
97 [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] E
lement insertAdjacentElement(DOMString where, Element element); | 98 [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] E
lement insertAdjacentElement(DOMString where, Element element); |
98 [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMS
tring where, DOMString text); | 99 [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMS
tring where, DOMString text); |
99 [CustomElementCallbacks, RaisesException] void insertAdjacentHTML(DOMString
where, DOMString html); | 100 [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void
insertAdjacentHTML(DOMString where, DOMString html); |
100 | 101 |
101 [Reflect=class, PerWorldBindings] attribute DOMString className; | 102 [Reflect=class] attribute DOMString className; |
102 [PerWorldBindings] readonly attribute DOMTokenList classList; | 103 [PerWorldBindings] readonly attribute DOMTokenList classList; |
103 | 104 |
104 [PerWorldBindings] readonly attribute DOMStringMap dataset; | 105 [PerWorldBindings] readonly attribute DOMStringMap dataset; |
105 | 106 |
106 // NodeSelector - Selector API | |
107 [RaisesException] Element querySelector(DOMString selectors); | |
108 [RaisesException] NodeList querySelectorAll(DOMString selectors); | |
109 | |
110 // WebKit extension | 107 // WebKit extension |
111 [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSel
ector] boolean webkitMatchesSelector(DOMString selectors); | 108 [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSel
ector] boolean webkitMatchesSelector(DOMString selectors); |
112 | 109 |
113 // Shadow DOM API | 110 // Shadow DOM API |
114 [RuntimeEnabled=ShadowDOM, RaisesException] ShadowRoot createShadowRoot(); | 111 [RaisesException, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadow
Root(); |
115 [RuntimeEnabled=ShadowDOM, PerWorldBindings] readonly attribute ShadowRoot s
hadowRoot; | 112 [PerWorldBindings] readonly attribute ShadowRoot shadowRoot; |
116 [RuntimeEnabled=ShadowDOM, PerWorldBindings] NodeList getDestinationInsertio
nPoints(); | 113 NodeList getDestinationInsertionPoints(); |
117 | |
118 // To-be-deprecated prefixed Shadow DOM API | |
119 [ImplementedAs=createShadowRoot, RaisesException, MeasureAs=ShadowDOMPrefixe
dCreateShadowRoot] ShadowRoot webkitCreateShadowRoot(); | |
120 [ImplementedAs=shadowRoot, PerWorldBindings, MeasureAs=ShadowDOMPrefixedShad
owRoot] readonly attribute ShadowRoot webkitShadowRoot; | |
121 | 114 |
122 // CSSOM View Module API | 115 // CSSOM View Module API |
123 ClientRectList getClientRects(); | 116 ClientRectList getClientRects(); |
124 ClientRect getBoundingClientRect(); | 117 ClientRect getBoundingClientRect(); |
125 | 118 |
126 // Mozilla version | 119 // Mozilla version |
127 const unsigned short ALLOW_KEYBOARD_INPUT = 1; | 120 const unsigned short ALLOW_KEYBOARD_INPUT = 1; |
128 [RuntimeEnabled=Fullscreen, PerWorldBindings, ActivityLogging=ForAllWorlds,
MeasureAs=PrefixedElementRequestFullScreen] void webkitRequestFullScreen([Defaul
t=Undefined] optional unsigned short flags); | 121 [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen] void
webkitRequestFullScreen([Default=Undefined] optional unsigned short flags); |
129 | 122 |
130 // W3C version | 123 // W3C version |
131 [RuntimeEnabled=Fullscreen, PerWorldBindings, ActivityLogging=ForAllWorlds,
MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen(); | 124 [LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void
webkitRequestFullscreen(); |
132 | 125 |
133 void webkitRequestPointerLock(); | 126 [MeasureAs=PrefixedElementRequestPointerLock] void webkitRequestPointerLock(
); |
| 127 [MeasureAs=ElementRequestPointerLock] void requestPointerLock(); |
134 | 128 |
135 // Event handler attributes | 129 // Event handler attributes |
136 attribute EventHandler onbeforecopy; | 130 attribute EventHandler onbeforecopy; |
137 attribute EventHandler onbeforecut; | 131 attribute EventHandler onbeforecut; |
138 attribute EventHandler onbeforepaste; | 132 attribute EventHandler onbeforepaste; |
139 attribute EventHandler oncopy; | 133 attribute EventHandler oncopy; |
140 attribute EventHandler oncut; | 134 attribute EventHandler oncut; |
141 attribute EventHandler onpaste; | 135 attribute EventHandler onpaste; |
142 attribute EventHandler onsearch; | 136 attribute EventHandler onsearch; |
143 attribute EventHandler onselectstart; | 137 attribute EventHandler onselectstart; |
144 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | 138 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
145 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | 139 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; |
146 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | 140 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; |
147 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | 141 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; |
148 attribute EventHandler onwebkitfullscreenchange; | 142 attribute EventHandler onwebkitfullscreenchange; |
149 attribute EventHandler onwebkitfullscreenerror; | 143 attribute EventHandler onwebkitfullscreenerror; |
150 [PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute EventH
andler onwheel; | 144 [LogActivity=SetterOnly] attribute EventHandler onwheel; |
151 }; | 145 }; |
152 | 146 |
153 Element implements ParentNode; | 147 Element implements ParentNode; |
154 Element implements ChildNode; | 148 Element implements ChildNode; |
OLD | NEW |