/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is * http://dom.spec.whatwg.org/#element and * http://domparsing.spec.whatwg.org/ and * http://dev.w3.org/csswg/cssom-view/ and * http://www.w3.org/TR/selectors-api/ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. */ interface Element : Node { readonly attribute DOMString? prefix; readonly attribute DOMString localName; [Constant] readonly attribute DOMString? namespaceURI; // Not [Constant] because it depends on which document we're in [Pure] readonly attribute DOMString tagName; [Pure] attribute DOMString id; [Pure] attribute DOMString className; [Constant] readonly attribute DOMTokenList classList; [Constant] readonly attribute NamedNodeMap attributes; DOMString? getAttribute(DOMString name); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); [Throws] void setAttribute(DOMString name, DOMString value); [Throws] void setAttributeNS(DOMString? namespace, DOMString name, DOMString value); void removeAttribute(DOMString name); void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString name); boolean hasAttributeNS(DOMString? namespace, DOMString localName); [Throws] boolean matches(DOMString selectors); HTMLCollection getElementsByTagName(DOMString localName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); }; // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface partial interface Element { DOMRectList getClientRects(); DOMRect getBoundingClientRect(); }; // http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface partial interface Element { [Throws,TreatNullAs=EmptyString] readonly attribute DOMString innerHTML; [Throws,TreatNullAs=EmptyString] readonly attribute DOMString outerHTML; }; Element implements ChildNode; Element implements ParentNode;