blob: 93843ed81c010e682f36d88b42f9777a9cc9e0e4 [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.
*/
[
SpecialWrapFor=HTMLElement|SVGElement,
] interface Element : Node {
// DOM Level 1 Core
[TreatReturnedNullStringAs=Null] readonly attribute DOMString tagName;
[TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttribute(DOMString name);
[RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttribute(DOMString name, DOMString value);
[CustomElementCallbacks] void removeAttribute(DOMString name);
[MeasureAs=ElementGetAttributeNode] Attr getAttributeNode([Default=Undefined] optional DOMString name); // Removed from DOM4.
[RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr setAttributeNode([Default=Undefined, TypeChecking=Nullable] optional Attr newAttr); // Removed from DOM4.
[RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNode] Attr removeAttributeNode([Default=Undefined, TypeChecking=Nullable] optional Attr oldAttr); // Removed from DOM4.
HTMLCollection getElementsByTagName(DOMString name);
[PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute NamedNodeMap attributes;
[MeasureAs=HasAttributes] boolean hasAttributes();
// DOM Level 2 Core
[TreatReturnedNullStringAs=Null, DartNoAutoScope] DOMString getAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
[RaisesException, CustomElementCallbacks, DartNoAutoScope] void setAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName, DOMString value);
[CustomElementCallbacks] void removeAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
[MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=NullString, Default=Undefined] optional DOMString namespaceURI,
[Default=Undefined] optional DOMString localName); // Removed from DOM4.
[RaisesException, CustomElementCallbacks, DeprecateAs=ElementSetAttributeNodeNS] Attr setAttributeNodeNS([Default=Undefined, TypeChecking=Nullable] optional Attr newAttr); // Removed from DOM4.
boolean hasAttribute(DOMString name);
boolean hasAttributeNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
[PerWorldBindings] readonly attribute CSSStyleDeclaration style;
// DOM4
[Reflect, DartNoAutoScope] attribute DOMString id;
[TreatReturnedNullStringAs=Null] readonly attribute DOMString namespaceURI;
[TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString prefix;
[TreatReturnedNullStringAs=Null] readonly attribute DOMString localName;
[RaisesException] boolean matches(DOMString selectors);
// Common extensions
readonly attribute long offsetLeft;
readonly attribute long offsetTop;
readonly attribute long offsetWidth;
readonly attribute long offsetHeight;
[ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute Element offsetParent;
readonly attribute long clientLeft;
readonly attribute long clientTop;
readonly attribute long clientWidth;
readonly attribute long clientHeight;
// FIXME: should be:
// attribute (Dictionary or double) scrollLeft;
// attribute (Dictionary or double) scrollTop;
// http://crbug.com/240176
[Custom=Setter] attribute long scrollLeft;
[Custom=Setter] attribute long scrollTop;
readonly attribute long scrollWidth;
readonly attribute long scrollHeight;
void focus();
void blur();
void scrollIntoView(optional boolean alignWithTop);
// WebKit extensions
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
[MeasureAs=ElementScrollByLines] void scrollByLines([Default=Undefined] optional long lines);
[MeasureAs=ElementScrollByPages] void scrollByPages([Default=Undefined] optional long pages);
// HTML 5
HTMLCollection getElementsByClassName(DOMString classNames);
[TreatNullAs=NullString, CustomElementCallbacks, PerWorldBindings, LogActivity=SetterOnly, RaisesException=Setter] attribute DOMString innerHTML;
[TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerHTML;
[RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement(DOMString where, Element element);
[RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMString where, DOMString text);
[CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString where, DOMString html);
[Reflect=class] attribute DOMString className;
[PerWorldBindings] readonly attribute DOMTokenList classList;
[PerWorldBindings] readonly attribute DOMStringMap dataset;
// WebKit extension
[RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector(DOMString selectors);
// Shadow DOM API
[RaisesException, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
[PerWorldBindings] readonly attribute ShadowRoot shadowRoot;
NodeList getDestinationInsertionPoints();
// CSSOM View Module API
ClientRectList getClientRects();
ClientRect getBoundingClientRect();
// Mozilla version
const unsigned short ALLOW_KEYBOARD_INPUT = 1;
[LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullScreen] void webkitRequestFullScreen([Default=Undefined] optional unsigned short flags);
// W3C version
[LogActivity, LogAllWorlds, MeasureAs=PrefixedElementRequestFullscreen] void webkitRequestFullscreen();
[MeasureAs=PrefixedElementRequestPointerLock] void webkitRequestPointerLock();
[MeasureAs=ElementRequestPointerLock] void requestPointerLock();
// Event handler attributes
attribute EventHandler onbeforecopy;
attribute EventHandler onbeforecut;
attribute EventHandler onbeforepaste;
attribute EventHandler oncopy;
attribute EventHandler oncut;
attribute EventHandler onpaste;
attribute EventHandler onsearch;
attribute EventHandler onselectstart;
[RuntimeEnabled=Touch] attribute EventHandler ontouchcancel;
[RuntimeEnabled=Touch] attribute EventHandler ontouchend;
[RuntimeEnabled=Touch] attribute EventHandler ontouchmove;
[RuntimeEnabled=Touch] attribute EventHandler ontouchstart;
attribute EventHandler onwebkitfullscreenchange;
attribute EventHandler onwebkitfullscreenerror;
[LogActivity=SetterOnly] attribute EventHandler onwheel;
};
Element implements ParentNode;
Element implements ChildNode;