Element.idl   [plain text]


/*
 * Copyright (C) 2006 Apple Computer, Inc.
 *
 * 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., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

module core {

    interface [LegacyParent=KJS::DOMEventTargetNode, GenerateConstructor] Element : EventTargetNode {

        // DOM Level 1 Core

        readonly attribute [ConvertNullStringTo=Null] DOMString tagName;

        [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name);

        [Custom] void setAttribute(in DOMString name,
                                   in DOMString value)
            raises(DOMException);

        void removeAttribute(in DOMString name)
            raises(DOMException);

        Attr getAttributeNode(in DOMString name);

        [Custom] Attr setAttributeNode(in Attr newAttr)
            raises(DOMException);

        Attr removeAttributeNode(in Attr oldAttr)
            raises(DOMException);

        NodeList getElementsByTagName(in DOMString name);

        // DOM Level 2 Core

        DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                 in DOMString localName);

        [Custom] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                     in DOMString qualifiedName, 
                                     in DOMString value)
            raises(DOMException);

        void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                               in DOMString localName)
            raises(DOMException);

        NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                        in DOMString localName);

        Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                                in DOMString localName);

        [Custom] Attr setAttributeNodeNS(in Attr newAttr)
            raises(DOMException);

        boolean hasAttribute(in DOMString name);

        boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
                               in 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 clientWidth;

        readonly attribute long clientHeight;

        attribute long scrollLeft;

        attribute long scrollTop;

        readonly attribute long scrollWidth;

        readonly attribute long scrollHeight;

        void focus();

        [Disabled] void blur();

        void scrollIntoView(in [ConvertUndefinedToTrue] boolean alignWithTop);

        // IE extensions

        Node insertAdjacentElement(in DOMString position, 
                                   in Node newElement)
            raises(DOMException);
        
        boolean contains(in Element element);

        // WebKit extensions

        void scrollIntoViewIfNeeded(in [ConvertUndefinedToTrue] boolean alignWithTop);

        void scrollByLines(in long lines);

        void scrollByPages(in long pages);

    };

}