Element.idl   [plain text]


/*
 * 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.
 */

module core {

    interface [
        JSGenerateToNativeObject,
        JSInlineGetOwnPropertySlot
    ] Element : Node {

        // DOM Level 1 Core

        readonly attribute [TreatReturnedNullStringAs=Null] 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);
        NodeList getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString name);

        // 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);

        readonly attribute CSSStyleDeclaration style;

        // Common extensions

        readonly attribute long offsetLeft;
        readonly attribute long offsetTop;
        readonly attribute long offsetWidth;
        readonly attribute long offsetHeight;
        readonly attribute Element offsetParent;
        readonly attribute long clientLeft;
        readonly attribute long clientTop;
        readonly attribute long clientWidth;
        readonly attribute long clientHeight;
                 attribute long scrollLeft;
                 attribute long scrollTop;
        readonly attribute long scrollWidth;
        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);

#