blob: 35f3379520ef7d533fc40bccd593ee8658eb0aff [file] [log] [blame]
/*
* 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.
*/
[
V8CustomToJSObject,
V8SkipVTableValidation
] interface Element : Node {
// DOM Level 1 Core
[TreatReturnedNullStringAs=Null, V8PerWorldBindings] readonly attribute DOMString tagName;
[TreatReturnedNullStringAs=Null] DOMString getAttribute(in [Optional=DefaultIsUndefined] DOMString name);
[ObjCLegacyUnnamedParameters] void setAttribute(in [Optional=DefaultIsUndefined] DOMString name,
in [Optional=DefaultIsUndefined] DOMString value)
raises(DOMException);
void removeAttribute(in [Optional=DefaultIsUndefined] DOMString name);
Attr getAttributeNode(in [Optional=DefaultIsUndefined] DOMString name);
Attr setAttributeNode(in [Optional=DefaultIsUndefined] Attr newAttr)
raises(DOMException);
Attr removeAttributeNode(in [Optional=DefaultIsUndefined] Attr oldAttr)
raises(DOMException);
[V8PerWorldBindings] NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString name);
#if !defined(LANGUAGE_OBJECTIVE_C)
// For ObjC this is defined on Node for legacy support.
[V8PerWorldBindings] readonly attribute NamedNodeMap attributes;
boolean hasAttributes();
#endif
// DOM Level 2 Core
[ObjCLegacyUnnamedParameters] DOMString getAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString localName);
[ObjCLegacyUnnamedParameters] void setAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString qualifiedName,
in [Optional=DefaultIsUndefined] DOMString value)
raises(DOMException);
[ObjCLegacyUnnamedParameters] void removeAttributeNS(in [TreatNullAs=NullString] DOMString namespaceURI,
in DOMString localName);
[ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString localName);
[ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString localName);
Attr setAttributeNodeNS(in [Optional=DefaultIsUndefined] Attr newAttr)
raises(DOMException);
boolean hasAttribute(in DOMString name);
[ObjCLegacyUnnamedParameters] boolean hasAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
in [Optional=DefaultIsUndefined] DOMString localName);
[V8PerWorldBindings] readonly attribute CSSStyleDeclaration style;
// Common extensions
[V8PerWorldBindings] readonly attribute long offsetLeft;
[V8PerWorldBindings] readonly attribute long offsetTop;
[V8PerWorldBindings] readonly attribute long offsetWidth;
[V8PerWorldBindings] readonly attribute long offsetHeight;
[ImplementedAs=bindingsOffsetParent, V8PerWorldBindings] readonly attribute Element offsetParent;
[V8PerWorldBindings] readonly attribute long clientLeft;
[V8PerWorldBindings] readonly attribute long clientTop;
[V8PerWorldBindings] readonly attribute long clientWidth;
[V8PerWorldBindings] readonly attribute long clientHeight;
[V8PerWorldBindings] attribute long scrollLeft;
[V8PerWorldBindings] attribute long scrollTop;
[V8PerWorldBindings] readonly attribute long scrollWidth;
[V8PerWorldBindings] readonly attribute long scrollHeight;
void focus();
void blur();
void scrollIntoView(in [Optional] boolean alignWithTop);
// WebKit extensions
void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
void scrollByLines(in [Optional=DefaultIsUndefined] long lines);
void scrollByPages(in [Optional=DefaultIsUndefined] long pages);
// HTML 5
NodeList getElementsByClassName(in [Optional=DefaultIsUndefined] DOMString name);
[Reflect=class, V8PerWorldBindings] attribute DOMString className;
[V8PerWorldBindings] readonly attribute DOMTokenList classList;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[V8PerWorldBindings] readonly attribute DOMStringMap dataset;
#endif
// NodeSelector - Selector API
Element querySelector(in DOMString selectors)
raises(DOMException);
NodeList querySelectorAll(in DOMString selectors)
raises(DOMException);
// WebKit extension, pending specification.
boolean webkitMatchesSelector(in [Optional=DefaultIsUndefined] DOMString selectors)
raises(DOMException);
// ElementTraversal API
[V8PerWorldBindings] readonly attribute Element firstElementChild;
[V8PerWorldBindings] readonly attribute Element lastElementChild;
[V8PerWorldBindings] readonly attribute Element previousElementSibling;
[V8PerWorldBindings] readonly attribute Element nextElementSibling;
[V8PerWorldBindings] readonly attribute unsigned long childElementCount;
// ShadowAware API
#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM && defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[Reflect=pseudo, V8EnabledAtRuntime=shadowDOM, ImplementedAs=pseudo, V8PerWorldBindings] attribute DOMString webkitPseudo;
[V8EnabledAtRuntime=shadowDOM, ImplementedAs=createShadowRoot] ShadowRoot webkitCreateShadowRoot() raises(DOMException);
[V8EnabledAtRuntime=shadowDOM, ImplementedAs=shadowRoot, V8PerWorldBindings] readonly attribute ShadowRoot webkitShadowRoot;
[V8EnabledAtRuntime=shadowDOM, ImplementedAs=insertionParentForBinding, V8PerWorldBindings] readonly attribute Node webkitInsertionParent;
#endif
// DOM 4
void remove()
raises(DOMException);
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
// CSSOM View Module API
ClientRectList getClientRects();
ClientRect getBoundingClientRect();
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// Objective-C extensions
[V8PerWorldBindings] readonly attribute DOMString innerText;
#endif
// Mozilla version
const unsigned short ALLOW_KEYBOARD_INPUT = 1;
[V8EnabledAtRuntime] void webkitRequestFullScreen(in [Optional=DefaultIsUndefined] unsigned short flags);
// W3C version
[V8EnabledAtRuntime] void webkitRequestFullscreen();
[Conditional=POINTER_LOCK] void webkitRequestPointerLock();
// CSS Regions API
[Conditional=CSS_REGIONS, V8EnabledAtRuntime=cssRegions, V8PerWorldBindings] readonly attribute DOMString webkitRegionOverset;
[Conditional=CSS_REGIONS, V8EnabledAtRuntime=cssRegions] sequence<Range> webkitGetRegionFlowRanges();
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
// Event handler DOM attributes
[NotEnumerable, V8PerWorldBindings] attribute EventListener onabort;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onblur;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onchange;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onclick;
[NotEnumerable, V8PerWorldBindings] attribute EventListener oncontextmenu;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondblclick;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondrag;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondragend;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondragenter;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondragleave;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondragover;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondragstart;
[NotEnumerable, V8PerWorldBindings] attribute EventListener ondrop;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onerror;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onfocus;
[NotEnumerable, V8PerWorldBindings] attribute EventListener oninput;
[NotEnumerable, V8PerWorldBindings] attribute EventListener oninvalid;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onkeydown;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onkeypress;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onkeyup;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onload;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmousedown;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmousemove;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmouseout;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmouseover;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmouseup;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onmousewheel;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onscroll;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onselect;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onsubmit;
// attribute [NotEnumerable] EventListener oncanplay;
// attribute [NotEnumerable] EventListener oncanplaythrough;
// attribute [NotEnumerable] EventListener ondurationchange;
// attribute [NotEnumerable] EventListener onemptied;
// attribute [NotEnumerable] EventListener onended;
// attribute [NotEnumerable] EventListener onloadeddata;
// attribute [NotEnumerable] EventListener onloadedmetadata;
// attribute [NotEnumerable] EventListener onloadstart;
// attribute [NotEnumerable] EventListener onpause;
// attribute [NotEnumerable] EventListener onplay;
// attribute [NotEnumerable] EventListener onplaying;
// attribute [NotEnumerable] EventListener onprogress;
// attribute [NotEnumerable] EventListener onratechange;
// attribute [NotEnumerable] EventListener onreadystatechange;
// attribute [NotEnumerable] EventListener onseeked;
// attribute [NotEnumerable] EventListener onseeking;
// attribute [NotEnumerable] EventListener onshow;
// attribute [NotEnumerable] EventListener onstalled;
// attribute [NotEnumerable] EventListener onsuspend;
// attribute [NotEnumerable] EventListener ontimeupdate;
// attribute [NotEnumerable] EventListener onvolumechange;
// attribute [NotEnumerable] EventListener onwaiting;
// WebKit extensions
[NotEnumerable, V8PerWorldBindings] attribute EventListener onbeforecut;
[NotEnumerable, V8PerWorldBindings] attribute EventListener oncut;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onbeforecopy;
[NotEnumerable, V8PerWorldBindings] attribute EventListener oncopy;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onbeforepaste;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onpaste;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onreset;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onsearch;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onselectstart;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch, V8PerWorldBindings] attribute EventListener ontouchstart;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch, V8PerWorldBindings] attribute EventListener ontouchmove;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch, V8PerWorldBindings] attribute EventListener ontouchend;
[NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime=touch, V8PerWorldBindings] attribute EventListener ontouchcancel;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onwebkitfullscreenchange;
[NotEnumerable, V8PerWorldBindings] attribute EventListener onwebkitfullscreenerror;
#endif
};