Home | History | Annotate | Download | only in dom
      1 /*
      2  * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
      3  * Copyright (C) 2006 Samuel Weinig <sam.weinig (at) gmail.com>
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Library General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2 of the License, or (at your option) any later version.
      9  *
     10  * This library is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  * Library General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU Library General Public License
     16  * along with this library; see the file COPYING.LIB.  If not, write to
     17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18  * Boston, MA 02110-1301, USA.
     19  */
     20 
     21 module core {
     22 
     23     interface [
     24         CustomMarkFunction,
     25         GenerateNativeConverter,
     26         InlineGetOwnPropertySlot
     27     ] Element : Node {
     28 
     29         // DOM Level 1 Core
     30 
     31         readonly attribute [ConvertNullStringTo=Null] DOMString tagName;
     32 
     33         [ConvertNullStringTo=Null] DOMString getAttribute(in DOMString name);
     34         [OldStyleObjC] void setAttribute(in DOMString name,
     35                                          in DOMString value)
     36             raises(DOMException);
     37         void removeAttribute(in DOMString name)
     38             raises(DOMException);
     39         Attr getAttributeNode(in DOMString name);
     40         Attr setAttributeNode(in Attr newAttr)
     41             raises(DOMException);
     42         Attr removeAttributeNode(in Attr oldAttr)
     43             raises(DOMException);
     44         NodeList getElementsByTagName(in DOMString name);
     45 
     46         // DOM Level 2 Core
     47 
     48         [OldStyleObjC] DOMString getAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
     49                                                 in DOMString localName);
     50         [OldStyleObjC] void setAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
     51                                            in DOMString qualifiedName,
     52                                            in DOMString value)
     53             raises(DOMException);
     54         [OldStyleObjC] void removeAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
     55                                               in DOMString localName)
     56             raises(DOMException);
     57         [OldStyleObjC] NodeList getElementsByTagNameNS(in [ConvertNullToNullString] DOMString namespaceURI,
     58                                                        in DOMString localName);
     59         [OldStyleObjC] Attr getAttributeNodeNS(in [ConvertNullToNullString] DOMString namespaceURI,
     60                                                in DOMString localName);
     61         Attr setAttributeNodeNS(in Attr newAttr)
     62             raises(DOMException);
     63         boolean hasAttribute(in DOMString name);
     64         [OldStyleObjC] boolean hasAttributeNS(in [ConvertNullToNullString] DOMString namespaceURI,
     65                                               in DOMString localName);
     66 
     67         readonly attribute CSSStyleDeclaration style;
     68 
     69         // Common extensions
     70 
     71         readonly attribute long offsetLeft;
     72         readonly attribute long offsetTop;
     73         readonly attribute long offsetWidth;
     74         readonly attribute long offsetHeight;
     75         readonly attribute Element offsetParent;
     76         readonly attribute long clientLeft;
     77         readonly attribute long clientTop;
     78         readonly attribute long clientWidth;
     79         readonly attribute long clientHeight;
     80                  attribute long scrollLeft;
     81                  attribute long scrollTop;
     82         readonly attribute long scrollWidth;
     83         readonly attribute long scrollHeight;
     84 
     85         void focus();
     86         void blur();
     87         void scrollIntoView(in [Optional] boolean alignWithTop);
     88 
     89         // IE extensions
     90 
     91         boolean contains(in Element element);
     92 
     93         // WebKit extensions
     94 
     95         void scrollIntoViewIfNeeded(in [Optional] boolean centerIfNeeded);
     96         void scrollByLines(in long lines);
     97         void scrollByPages(in long pages);
     98 
     99         WebKitAnimationList webkitGetAnimations();
    100 
    101         // HTML 5
    102         NodeList getElementsByClassName(in DOMString name);
    103 
    104 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    105         readonly attribute DOMStringMap dataset;
    106 #endif
    107 
    108         // NodeSelector - Selector API
    109         [RequiresAllArguments=Raise] Element querySelector(in DOMString selectors)
    110             raises(DOMException);
    111         [RequiresAllArguments=Raise] NodeList querySelectorAll(in DOMString selectors)
    112             raises(DOMException);
    113 
    114         // WebKit extension, pending specification.
    115         boolean webkitMatchesSelector(in DOMString selectors)
    116             raises(DOMException);
    117 
    118         // ElementTraversal API
    119         readonly attribute Element firstElementChild;
    120         readonly attribute Element lastElementChild;
    121         readonly attribute Element previousElementSibling;
    122         readonly attribute Element nextElementSibling;
    123         readonly attribute unsigned long childElementCount;
    124 
    125 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    126         // CSSOM View Module API
    127         ClientRectList getClientRects();
    128         ClientRect getBoundingClientRect();
    129 #endif
    130 
    131 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    132         // Objective-C extensions
    133         readonly attribute DOMString innerText;
    134 #endif
    135 
    136 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
    137         const unsigned short ALLOW_KEYBOARD_INPUT = 1;
    138         void webkitRequestFullScreen(in unsigned short flags);
    139 #endif
    140 
    141 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
    142         // Event handler DOM attributes
    143         attribute [DontEnum] EventListener onabort;
    144         attribute [DontEnum] EventListener onblur;
    145         attribute [DontEnum] EventListener onchange;
    146         attribute [DontEnum] EventListener onclick;
    147         attribute [DontEnum] EventListener oncontextmenu;
    148         attribute [DontEnum] EventListener ondblclick;
    149         attribute [DontEnum] EventListener ondrag;
    150         attribute [DontEnum] EventListener ondragend;
    151         attribute [DontEnum] EventListener ondragenter;
    152         attribute [DontEnum] EventListener ondragleave;
    153         attribute [DontEnum] EventListener ondragover;
    154         attribute [DontEnum] EventListener ondragstart;
    155         attribute [DontEnum] EventListener ondrop;
    156         attribute [DontEnum] EventListener onerror;
    157         attribute [DontEnum] EventListener onfocus;
    158         attribute [DontEnum] EventListener oninput;
    159         attribute [DontEnum] EventListener oninvalid;
    160         attribute [DontEnum] EventListener onkeydown;
    161         attribute [DontEnum] EventListener onkeypress;
    162         attribute [DontEnum] EventListener onkeyup;
    163         attribute [DontEnum] EventListener onload;
    164         attribute [DontEnum] EventListener onmousedown;
    165         attribute [DontEnum] EventListener onmousemove;
    166         attribute [DontEnum] EventListener onmouseout;
    167         attribute [DontEnum] EventListener onmouseover;
    168         attribute [DontEnum] EventListener onmouseup;
    169         attribute [DontEnum] EventListener onmousewheel;
    170         attribute [DontEnum] EventListener onscroll;
    171         attribute [DontEnum] EventListener onselect;
    172         attribute [DontEnum] EventListener onsubmit;
    173 
    174         // attribute [DontEnum] EventListener oncanplay;
    175         // attribute [DontEnum] EventListener oncanplaythrough;
    176         // attribute [DontEnum] EventListener ondurationchange;
    177         // attribute [DontEnum] EventListener onemptied;
    178         // attribute [DontEnum] EventListener onended;
    179         // attribute [DontEnum] EventListener onloadeddata;
    180         // attribute [DontEnum] EventListener onloadedmetadata;
    181         // attribute [DontEnum] EventListener onloadstart;
    182         // attribute [DontEnum] EventListener onpause;
    183         // attribute [DontEnum] EventListener onplay;
    184         // attribute [DontEnum] EventListener onplaying;
    185         // attribute [DontEnum] EventListener onprogress;
    186         // attribute [DontEnum] EventListener onratechange;
    187         // attribute [DontEnum] EventListener onreadystatechange;
    188         // attribute [DontEnum] EventListener onseeked;
    189         // attribute [DontEnum] EventListener onseeking;
    190         // attribute [DontEnum] EventListener onshow;
    191         // attribute [DontEnum] EventListener onstalled;
    192         // attribute [DontEnum] EventListener onsuspend;
    193         // attribute [DontEnum] EventListener ontimeupdate;
    194         // attribute [DontEnum] EventListener onvolumechange;
    195         // attribute [DontEnum] EventListener onwaiting;
    196 
    197         // WebKit extensions
    198         attribute [DontEnum] EventListener onbeforecut;
    199         attribute [DontEnum] EventListener oncut;
    200         attribute [DontEnum] EventListener onbeforecopy;
    201         attribute [DontEnum] EventListener oncopy;
    202         attribute [DontEnum] EventListener onbeforepaste;
    203         attribute [DontEnum] EventListener onpaste;
    204         attribute [DontEnum] EventListener onreset;
    205         attribute [DontEnum] EventListener onsearch;
    206         attribute [DontEnum] EventListener onselectstart;
    207         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart;
    208         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove;
    209         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
    210         attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
    211         attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange;
    212 #endif
    213     };
    214 
    215 }
    216