summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/core/dom/Element.idl
blob: 722419705919c084343430276033b3375b187075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/*
 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

[
    CustomToV8
] interface Element : Node {

    // DOM Level 1 Core

    [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString tagName;

    [TreatReturnedNullStringAs=Null] DOMString getAttribute([Default=Undefined] optional DOMString name);
    [RaisesException, CustomElementCallbacks=Enable] void setAttribute([Default=Undefined] optional DOMString name,
                                     [Default=Undefined] optional DOMString value);
    [CustomElementCallbacks=Enable] void removeAttribute([Default=Undefined] optional DOMString name);
    [MeasureAs=ElementGetAttributeNode] Attr getAttributeNode([Default=Undefined] optional DOMString name); // Removed from DOM4.
    [RaisesException, CustomElementCallbacks=Enable, MeasureAs=ElementSetAttributeNode] Attr setAttributeNode([Default=Undefined, StrictTypeChecking] optional Attr newAttr); // Removed from DOM4.
    [RaisesException, CustomElementCallbacks=Enable, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode([Default=Undefined, StrictTypeChecking] optional Attr oldAttr); // Removed from DOM4.
    [PerWorldBindings] NodeList getElementsByTagName([Default=Undefined] optional DOMString name);

    // For ObjC this is defined on Node for legacy support.
    [PerWorldBindings] readonly attribute NamedNodeMap     attributes;
    boolean            hasAttributes();

    // DOM Level 2 Core

     DOMString getAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                            [Default=Undefined] optional DOMString localName);
     [RaisesException, CustomElementCallbacks=Enable] void setAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                       [Default=Undefined] optional DOMString qualifiedName,
                                       [Default=Undefined] optional DOMString value);
     [CustomElementCallbacks=Enable] void removeAttributeNS([TreatNullAs=NullString] DOMString namespaceURI,
                                          DOMString localName);
     NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                   [Default=Undefined] optional DOMString localName);
     [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                   [Default=Undefined] optional DOMString localName); // Removed from DOM4.
    [RaisesException, CustomElementCallbacks=Enable] Attr setAttributeNodeNS([Default=Undefined, StrictTypeChecking] optional Attr newAttr);
    boolean hasAttribute(DOMString name);
     boolean hasAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                          [Default=Undefined] optional DOMString localName);

    [PerWorldBindings] readonly attribute CSSStyleDeclaration style;

    // DOM4
    // iht.com relies on id returning the empty string when no id is present.
    // Other browsers do this as well. So we don't convert null to JS null.
    [Reflect] attribute DOMString id;

    // Common extensions

    [PerWorldBindings] readonly attribute long offsetLeft;
    [PerWorldBindings] readonly attribute long offsetTop;
    [PerWorldBindings] readonly attribute long offsetWidth;
    [PerWorldBindings] readonly attribute long offsetHeight;
    [ImplementedAs=bindingsOffsetParent, PerWorldBindings] readonly attribute Element offsetParent;
    [PerWorldBindings] readonly attribute long clientLeft;
    [PerWorldBindings] readonly attribute long clientTop;
    [PerWorldBindings] readonly attribute long clientWidth;
    [PerWorldBindings] readonly attribute long clientHeight;
             [PerWorldBindings] attribute long scrollLeft;
             [PerWorldBindings] attribute long scrollTop;
    [PerWorldBindings] readonly attribute long scrollWidth;
    [PerWorldBindings] readonly attribute long scrollHeight;

    void focus();
    void blur();
    void scrollIntoView(optional boolean alignWithTop);

    // WebKit extensions

    void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
    void scrollByLines([Default=Undefined] optional long lines);
    void scrollByPages([Default=Undefined] optional long pages);

    // HTML 5
    NodeList getElementsByClassName([Default=Undefined] optional DOMString name);

    [Reflect=class, PerWorldBindings] attribute DOMString className;
    [PerWorldBindings] readonly attribute DOMTokenList classList;

    [PerWorldBindings] readonly attribute DOMStringMap dataset;

    // NodeSelector - Selector API
    [RaisesException] Element querySelector(DOMString selectors);
    [RaisesException] NodeList querySelectorAll(DOMString selectors);

    // WebKit extension, pending specification.
    [RaisesException] boolean webkitMatchesSelector([Default=Undefined] optional DOMString selectors);

    // Shadow DOM API
    [EnabledAtRuntime=ShadowDOM, Reflect, PerWorldBindings] attribute DOMString pseudo;
    [EnabledAtRuntime=ShadowDOM, RaisesException] ShadowRoot createShadowRoot();
    [EnabledAtRuntime=ShadowDOM, PerWorldBindings] readonly attribute ShadowRoot shadowRoot;
    [EnabledAtRuntime=ShadowDOM, PerWorldBindings] NodeList getDestinationInsertionPoints();

    // To-be-deprecated prefixed Shadow DOM API
    [Reflect=pseudo, ImplementedAs=pseudo, PerWorldBindings, MeasureAs=ShadowDOMPrefixedPseudo] attribute DOMString webkitPseudo;
    [ImplementedAs=createShadowRoot, RaisesException, MeasureAs=ShadowDOMPrefixedCreateShadowRoot] ShadowRoot webkitCreateShadowRoot();
    [ImplementedAs=shadowRoot, PerWorldBindings, MeasureAs=ShadowDOMPrefixedShadowRoot] readonly attribute ShadowRoot webkitShadowRoot;

    // CSSOM View Module API
    ClientRectList getClientRects();
    ClientRect getBoundingClientRect();

    // Mozilla version
    const unsigned short ALLOW_KEYBOARD_INPUT = 1;
    [EnabledAtRuntime=fullscreen] void webkitRequestFullScreen([Default=Undefined] optional unsigned short flags);

    // W3C version
    [EnabledAtRuntime=fullscreen] void webkitRequestFullscreen();

    void webkitRequestPointerLock();

    // CSS Regions API
    [EnabledAtRuntime=cssRegions, PerWorldBindings] readonly attribute DOMString webkitRegionOverset;
    [EnabledAtRuntime=cssRegions] sequence<Range> webkitGetRegionFlowRanges();

    // Event handler DOM attributes
    [NotEnumerable, PerWorldBindings] attribute EventHandler onabort;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onblur;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onchange;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onclick;
    [NotEnumerable, PerWorldBindings] attribute EventHandler oncontextmenu;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondblclick;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondrag;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragend;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragenter;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragleave;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragover;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondragstart;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler ondrop;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onerror;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onfocus;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler oninput;
    [NotEnumerable, PerWorldBindings] attribute EventHandler oninvalid;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeydown;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeypress;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onkeyup;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onload;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousedown;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseenter;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseleave;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousemove;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseout;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseover;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmouseup;
    [NotEnumerable, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds] attribute EventHandler onmousewheel;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onscroll;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onselect;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onsubmit;

    // attribute [NotEnumerable] EventHandler oncanplay;
    // attribute [NotEnumerable] EventHandler oncanplaythrough;
    // attribute [NotEnumerable] EventHandler ondurationchange;
    // attribute [NotEnumerable] EventHandler onemptied;
    // attribute [NotEnumerable] EventHandler onended;
    // attribute [NotEnumerable] EventHandler onloadeddata;
    // attribute [NotEnumerable] EventHandler onloadedmetadata;
    // attribute [NotEnumerable] EventHandler onloadstart;
    // attribute [NotEnumerable] EventHandler onpause;
    // attribute [NotEnumerable] EventHandler onplay;
    // attribute [NotEnumerable] EventHandler onplaying;
    // attribute [NotEnumerable] EventHandler onprogress;
    // attribute [NotEnumerable] EventHandler onratechange;
    // attribute [NotEnumerable] EventHandler onreadystatechange;
    // attribute [NotEnumerable] EventHandler onseeked;
    // attribute [NotEnumerable] EventHandler onseeking;
    // attribute [NotEnumerable] EventHandler onshow;
    // attribute [NotEnumerable] EventHandler onstalled;
    // attribute [NotEnumerable] EventHandler onsuspend;
    // attribute [NotEnumerable] EventHandler ontimeupdate;
    // attribute [NotEnumerable] EventHandler onvolumechange;
    // attribute [NotEnumerable] EventHandler onwaiting;

    // WebKit extensions
    [NotEnumerable, PerWorldBindings] attribute EventHandler onbeforecut;
    [NotEnumerable, PerWorldBindings] attribute EventHandler oncut;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onbeforecopy;
    [NotEnumerable, PerWorldBindings] attribute EventHandler oncopy;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onbeforepaste;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onpaste;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onreset;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onsearch;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onselectstart;
    [NotEnumerable, EnabledAtRuntime=touch, PerWorldBindings] attribute EventHandler ontouchstart;
    [NotEnumerable, EnabledAtRuntime=touch, PerWorldBindings] attribute EventHandler ontouchmove;
    [NotEnumerable, EnabledAtRuntime=touch, PerWorldBindings] attribute EventHandler ontouchend;
    [NotEnumerable, EnabledAtRuntime=touch, PerWorldBindings] attribute EventHandler ontouchcancel;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onwebkitfullscreenchange;
    [NotEnumerable, PerWorldBindings] attribute EventHandler onwebkitfullscreenerror;
};

Element implements ParentNode;
Element implements ChildNode;