Element.hx 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /*
  2. * Copyright (C)2005-2013 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated, do not edit!
  23. package js.html;
  24. /** <p>This chapter provides a brief reference for the general methods, properties, and events available to most HTML and XML elements in the Gecko DOM.</p>
  25. <p>Various W3C specifications apply to elements:</p>
  26. <ul> <li><a class="external" rel="external" href="http://www.w3.org/TR/DOM-Level-2-Core/" title="http://www.w3.org/TR/DOM-Level-2-Core/" target="_blank">DOM Core Specification</a>—describes the core interfaces shared by most DOM objects in HTML and XML documents</li> <li><a class="external" rel="external" href="http://www.w3.org/TR/DOM-Level-2-HTML/" title="http://www.w3.org/TR/DOM-Level-2-HTML/" target="_blank">DOM HTML Specification</a>—describes interfaces for objects in HTML and XHTML documents that build on the core specification</li> <li><a class="external" rel="external" href="http://www.w3.org/TR/DOM-Level-2-Events/" title="http://www.w3.org/TR/DOM-Level-2-Events/" target="_blank">DOM Events Specification</a>—describes events shared by most DOM objects, building on the DOM Core and <a class="external" rel="external" href="http://www.w3.org/TR/DOM-Level-2-Views/" title="http://www.w3.org/TR/DOM-Level-2-Views/" target="_blank">Views</a> specifications</li> <li><a class="external" title="http://www.w3.org/TR/ElementTraversal/" rel="external" href="http://www.w3.org/TR/ElementTraversal/" target="_blank">Element Traversal Specification</a>—describes the new attributes that allow traversal of elements in the DOM&nbsp;tree
  27. <span>New in <a rel="custom" href="https://developer.mozilla.org/en/Firefox_3.5_for_developers">Firefox 3.5</a></span>
  28. </li>
  29. </ul>
  30. <p>The articles listed here span the above and include links to the appropriate W3C DOM specification.</p>
  31. <p>While these interfaces are generally shared by most HTML and XML elements, there are more specialized interfaces for particular objects listed in the DOM HTML Specification. Note, however, that these HTML&nbsp;interfaces are "only for [HTML 4.01] and [XHTML 1.0] documents and are not guaranteed to work with any future version of XHTML." The HTML 5 draft does state it aims for backwards compatibility with these HTML&nbsp;interfaces but says of them that "some features that were formerly deprecated, poorly supported, rarely used or considered unnecessary have been removed." One can avoid the potential conflict by moving entirely to DOM&nbsp;XML attribute methods such as <code>getAttribute()</code>.</p>
  32. <p><code><a rel="custom" href="https://developer.mozilla.org/en/DOM/HTMLHtmlElement">Html</a></code>
  33. , <code><a rel="custom" href="/api/js/html/HeadElement">Head</a></code>
  34. , <code><a rel="custom" href="https://developer.mozilla.org/en/DOM/HTMLLinkElement">Link</a></code>
  35. , <code><a rel="custom" href="/api/js/html/TitleElement">Title</a></code>
  36. , <code><a rel="custom" href="/api/js/html/MetaElement">Meta</a></code>
  37. , <code><a rel="custom" href="/api/js/html/BaseElement">Base</a></code>
  38. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLIsIndexElement" class="new">IsIndex</a></code>
  39. , <code><a rel="custom" href="/api/js/html/StyleElement">Style</a></code>
  40. , <code><a rel="custom" href="/api/js/html/BodyElement">Body</a></code>
  41. , <code><a rel="custom" href="/api/js/html/FormElement">Form</a></code>
  42. , <code><a rel="custom" href="/api/js/html/SelectElement">Select</a></code>
  43. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLOptGroupElement" class="new">OptGroup</a></code>
  44. , <a title="en/HTML/Element/HTMLOptionElement" rel="internal" href="https://developer.mozilla.org/en/HTML/Element/HTMLOptionElement" class="new ">Option</a>, <code><a rel="custom" href="/api/js/html/InputElement">Input</a></code>
  45. , <code><a rel="custom" href="/api/js/html/TextAreaElement">TextArea</a></code>
  46. , <code><a rel="custom" href="/api/js/html/ButtonElement">Button</a></code>
  47. , <code><a rel="custom" href="/api/js/html/LabelElement">Label</a></code>
  48. , <code><a rel="custom" href="/api/js/html/FieldSetElement">FieldSet</a></code>
  49. , <code><a rel="custom" href="/api/js/html/LegendElement">Legend</a></code>
  50. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLUListElement" class="new">UList</a></code>
  51. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/OList" class="new">OList</a></code>
  52. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/DList" class="new">DList</a></code>
  53. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Directory" class="new">Directory</a></code>
  54. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Menu" class="new">Menu</a></code>
  55. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/LI" class="new">LI</a></code>
  56. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Div" class="new">Div</a></code>
  57. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Paragraph" class="new">Paragraph</a></code>
  58. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Heading" class="new">Heading</a></code>
  59. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Quote" class="new">Quote</a></code>
  60. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Pre" class="new">Pre</a></code>
  61. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/BR" class="new">BR</a></code>
  62. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/BaseFont" class="new">BaseFont</a></code>
  63. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Font" class="new">Font</a></code>
  64. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/HR" class="new">HR</a></code>
  65. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Mod" class="new">Mod</a></code>
  66. , <code><a rel="custom" href="/api/js/html/AnchorElement">Anchor</a></code>
  67. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Image" class="new">Image</a></code>
  68. , <code><a rel="custom" href="/api/js/html/ObjectElement">Object</a></code>
  69. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Param" class="new">Param</a></code>
  70. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Applet" class="new">Applet</a></code>
  71. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Map" class="new">Map</a></code>
  72. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Area" class="new">Area</a></code>
  73. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Script" class="new">Script</a></code>
  74. , <code><a rel="custom" href="/api/js/html/TableElement">Table</a></code>
  75. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCaption" class="new">TableCaption</a></code>
  76. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCol" class="new">TableCol</a></code>
  77. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableSection" class="new">TableSection</a></code>
  78. , <code><a rel="custom" href="/api/js/html/TableRowElement">TableRow</a></code>
  79. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCell" class="new">TableCell</a></code>
  80. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/FrameSet" class="new">FrameSet</a></code>
  81. , <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/DOM/Frame" class="new">Frame</a></code>
  82. , <code><a rel="custom" href="/api/js/html/IFrameElement">IFrame</a></code>
  83. </p><br><br>
  84. Documentation for this class was provided by <a href="https://developer.mozilla.org/en/DOM/element">MDN</a>. */
  85. @:native("Element")
  86. extern class Element extends Node
  87. {
  88. static inline var ALLOW_KEYBOARD_INPUT : Int = 1;
  89. var accessKey : String;
  90. /** The number of child nodes that are elements. */
  91. var childElementCount(default,null) : Int;
  92. /** A live <code><a rel="internal" href="https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMNodeList&amp;ident=nsIDOMNodeList" class="new">nsIDOMNodeList</a></code>
  93. of the current child elements. */
  94. var children(default,null) : HTMLCollection;
  95. /** Token list of class attribute */
  96. var classList(default,null) : DOMTokenList;
  97. /** Gets/sets the class of the element. */
  98. var className : String;
  99. /** The inner height of an element. */
  100. var clientHeight(default,null) : Int;
  101. /** The width of the left border of an element. */
  102. var clientLeft(default,null) : Int;
  103. /** The width of the top border of an element. */
  104. var clientTop(default,null) : Int;
  105. /** The inner width of an element. */
  106. var clientWidth(default,null) : Int;
  107. /** Gets/sets whether or not the element is editable. Setter throws DOMException. */
  108. var contentEditable : String;
  109. /** Allows access to read and write custom data attributes on the element. */
  110. var dataset(default,null) : DOMStringMap;
  111. /** Gets/sets the directionality of the element. */
  112. var dir : String;
  113. var draggable : Bool;
  114. var dropzone : String;
  115. /** The first direct child element of an element, or <code>null</code> if the element has no child elements. */
  116. var firstElementChild(default,null) : Element;
  117. var hidden : Bool;
  118. /** Gets/sets the id of the element. */
  119. var id : String;
  120. /** Gets/sets the markup of the element's content. Setter throws DOMException. */
  121. var innerHTML : String;
  122. /** Setter throws DOMException. */
  123. var innerText : String;
  124. /** Indicates whether or not the content of the element can be edited. Read only. */
  125. var isContentEditable(default,null) : Bool;
  126. /** Gets/sets the language of an element's attributes, text, and element contents. */
  127. var lang : String;
  128. /** The last direct child element of an element, or <code>null</code> if the element has no child elements. */
  129. var lastElementChild(default,null) : Element;
  130. /** The element immediately following the given one in the tree, or <code>null</code> if there's no sibling node. */
  131. var nextElementSibling(default,null) : Element;
  132. /** The height of an element, relative to the layout. */
  133. var offsetHeight(default,null) : Int;
  134. /** The distance from this element's left border to its <code>offsetParent</code>'s left border. */
  135. var offsetLeft(default,null) : Int;
  136. /** The element from which all offset calculations are currently computed. */
  137. var offsetParent(default,null) : Element;
  138. /** The distance from this element's top border to its <code>offsetParent</code>'s top border. */
  139. var offsetTop(default,null) : Int;
  140. /** The width of an element, relative to the layout. */
  141. var offsetWidth(default,null) : Int;
  142. var onabort : EventListener;
  143. var onbeforecopy : EventListener;
  144. var onbeforecut : EventListener;
  145. var onbeforepaste : EventListener;
  146. /** Returns the event handling code for the blur event. */
  147. var onblur : EventListener;
  148. /** Returns the event handling code for the change event. */
  149. var onchange : EventListener;
  150. /** Returns the event handling code for the click event. */
  151. var onclick : EventListener;
  152. /** Returns the event handling code for the contextmenu event. */
  153. var oncontextmenu : EventListener;
  154. /** Returns the event handling code for the copy event. */
  155. var oncopy : EventListener;
  156. /** Returns the event handling code for the cut event. */
  157. var oncut : EventListener;
  158. /** Returns the event handling code for the dblclick event. */
  159. var ondblclick : EventListener;
  160. var ondrag : EventListener;
  161. var ondragend : EventListener;
  162. var ondragenter : EventListener;
  163. var ondragleave : EventListener;
  164. var ondragover : EventListener;
  165. var ondragstart : EventListener;
  166. var ondrop : EventListener;
  167. var onerror : EventListener;
  168. /** Returns the event handling code for the focus event. */
  169. var onfocus : EventListener;
  170. var onfullscreenchange : EventListener;
  171. var onfullscreenerror : EventListener;
  172. var oninput : EventListener;
  173. var oninvalid : EventListener;
  174. /** Returns the event handling code for the keydown event. */
  175. var onkeydown : EventListener;
  176. /** Returns the event handling code for the keypress event. */
  177. var onkeypress : EventListener;
  178. /** Returns the event handling code for the keyup event. */
  179. var onkeyup : EventListener;
  180. var onload : EventListener;
  181. /** Returns the event handling code for the mousedown event. */
  182. var onmousedown : EventListener;
  183. /** Returns the event handling code for the mousemove event. */
  184. var onmousemove : EventListener;
  185. /** Returns the event handling code for the mouseout event. */
  186. var onmouseout : EventListener;
  187. /** Returns the event handling code for the mouseover event. */
  188. var onmouseover : EventListener;
  189. /** Returns the event handling code for the mouseup event. */
  190. var onmouseup : EventListener;
  191. var onmousewheel : EventListener;
  192. /** Returns the event handling code for the paste event. */
  193. var onpaste : EventListener;
  194. var onreset : EventListener;
  195. /** Returns the event handling code for the scroll event. */
  196. var onscroll : EventListener;
  197. var onsearch : EventListener;
  198. var onselect : EventListener;
  199. var onselectstart : EventListener;
  200. var onsubmit : EventListener;
  201. var ontouchcancel : EventListener;
  202. var ontouchend : EventListener;
  203. var ontouchmove : EventListener;
  204. var ontouchstart : EventListener;
  205. /** Gets the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string. Setter throws DOMException. */
  206. var outerHTML : String;
  207. /** Setter throws DOMException. */
  208. var outerText : String;
  209. /** The element immediately preceding the given one in the tree, or <code>null</code> if there is no sibling element. */
  210. var previousElementSibling(default,null) : Element;
  211. var pseudo : String;
  212. /** The scroll view height of an element. */
  213. var scrollHeight(default,null) : Int;
  214. /** Gets/sets the left scroll offset of an element. */
  215. var scrollLeft : Int;
  216. /** Gets/sets the top scroll offset of an element. */
  217. var scrollTop : Int;
  218. /** The scroll view width of an element. */
  219. var scrollWidth(default,null) : Int;
  220. /** Controls <a title="en/Controlling_spell_checking_in_HTML_forms" rel="internal" href="https://developer.mozilla.org/en/HTML/Controlling_spell_checking_in_HTML_forms">spell-checking</a> (present on all HTML&nbsp;elements) */
  221. var spellcheck : Bool;
  222. /** An object representing the declarations of an element's style attributes. */
  223. var style(default,null) : CSSStyleDeclaration;
  224. /** Gets/sets the position of the element in the tabbing order. */
  225. var tabIndex : Int;
  226. /** The name of the tag for the given element. */
  227. var tagName(default,null) : String;
  228. /** A string that appears in a popup box when mouse is over the element. */
  229. var title : String;
  230. var translate : Bool;
  231. function blur() : Void;
  232. function click() : Void;
  233. function focus() : Void;
  234. function getAttribute( name : String ) : String;
  235. function getAttributeNS( ?namespaceURI : String, localName : String ) : String;
  236. function getAttributeNode( name : String ) : Attr;
  237. function getAttributeNodeNS( ?namespaceURI : String, localName : String ) : Attr;
  238. function getBoundingClientRect() : ClientRect;
  239. function getClientRects() : ClientRectList;
  240. function getElementsByClassName( name : String ) : NodeList;
  241. function getElementsByTagName( name : String ) : NodeList;
  242. function getElementsByTagNameNS( ?namespaceURI : String, localName : String ) : NodeList;
  243. function hasAttribute( name : String ) : Bool;
  244. function hasAttributeNS( ?namespaceURI : String, localName : String ) : Bool;
  245. function insertAdjacentElement( where : String, element : Element ) : Element;
  246. function insertAdjacentHTML( where : String, html : String ) : Void;
  247. function insertAdjacentText( where : String, text : String ) : Void;
  248. function matchesSelector( selectors : String ) : Bool;
  249. function querySelector( selectors : String ) : Element;
  250. function querySelectorAll( selectors : String ) : NodeList;
  251. function remove() : Void;
  252. function removeAttribute( name : String ) : Void;
  253. function removeAttributeNS( namespaceURI : String, localName : String ) : Void;
  254. function removeAttributeNode( oldAttr : Attr ) : Attr;
  255. function requestFullScreen( flags : Int ) : Void;
  256. function requestFullscreen() : Void;
  257. function requestPointerLock() : Void;
  258. function scrollByLines( lines : Int ) : Void;
  259. function scrollByPages( pages : Int ) : Void;
  260. function scrollIntoView( ?alignWithTop : Bool ) : Void;
  261. function scrollIntoViewIfNeeded( ?centerIfNeeded : Bool ) : Void;
  262. function setAttribute( name : String, value : String ) : Void;
  263. function setAttributeNS( ?namespaceURI : String, qualifiedName : String, value : String ) : Void;
  264. function setAttributeNode( newAttr : Attr ) : Attr;
  265. function setAttributeNodeNS( newAttr : Attr ) : Attr;
  266. }