2
0

Node.hx 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /*
  2. * Copyright (C)2005-2017 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 from mozilla\Node.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. A `Node` is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly.
  26. Documentation [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Node$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/Node>
  28. **/
  29. @:native("Node")
  30. extern class Node extends EventTarget
  31. {
  32. static inline var ELEMENT_NODE : Int = 1;
  33. static inline var ATTRIBUTE_NODE : Int = 2;
  34. static inline var TEXT_NODE : Int = 3;
  35. static inline var CDATA_SECTION_NODE : Int = 4;
  36. static inline var ENTITY_REFERENCE_NODE : Int = 5;
  37. static inline var ENTITY_NODE : Int = 6;
  38. static inline var PROCESSING_INSTRUCTION_NODE : Int = 7;
  39. static inline var COMMENT_NODE : Int = 8;
  40. static inline var DOCUMENT_NODE : Int = 9;
  41. static inline var DOCUMENT_TYPE_NODE : Int = 10;
  42. static inline var DOCUMENT_FRAGMENT_NODE : Int = 11;
  43. static inline var NOTATION_NODE : Int = 12;
  44. static inline var DOCUMENT_POSITION_DISCONNECTED : Int = 1;
  45. static inline var DOCUMENT_POSITION_PRECEDING : Int = 2;
  46. static inline var DOCUMENT_POSITION_FOLLOWING : Int = 4;
  47. static inline var DOCUMENT_POSITION_CONTAINS : Int = 8;
  48. static inline var DOCUMENT_POSITION_CONTAINED_BY : Int = 16;
  49. static inline var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : Int = 32;
  50. /**
  51. Returns an <code>unsigned short</code> representing the type of the node. Possible values are:
  52. <table class="standard-table">
  53. <tr>
  54. Name
  55. Value
  56. </tr>
  57. <tr>
  58. <td><code>ELEMENT_NODE</code></td>
  59. <td><code>1</code></td>
  60. </tr>
  61. <tr>
  62. <td><code>ATTRIBUTE_NODE</code> <em>(deprecated)</em></td>
  63. <td><code>2</code></td>
  64. </tr>
  65. <tr>
  66. <td><code>TEXT_NODE</code></td>
  67. <td><code>3</code></td>
  68. </tr>
  69. <tr>
  70. <td><code>CDATA_SECTION_NODE</code> <em>(deprecated)</em></td>
  71. <td><code>4</code></td>
  72. </tr>
  73. <tr>
  74. <td><code>ENTITY_REFERENCE_NODE</code> <em>(deprecated)</em></td>
  75. <td><code>5</code></td>
  76. </tr>
  77. <tr>
  78. <td><code>ENTITY_NODE</code> <em>(deprecated)</em></td>
  79. <td><code>6</code></td>
  80. </tr>
  81. <tr>
  82. <td><code>PROCESSING_INSTRUCTION_NODE</code></td>
  83. <td><code>7</code></td>
  84. </tr>
  85. <tr>
  86. <td><code>COMMENT_NODE</code></td>
  87. <td><code>8</code></td>
  88. </tr>
  89. <tr>
  90. <td><code>DOCUMENT_NODE</code></td>
  91. <td><code>9</code></td>
  92. </tr>
  93. <tr>
  94. <td><code>DOCUMENT_TYPE_NODE</code></td>
  95. <td><code>10</code></td>
  96. </tr>
  97. <tr>
  98. <td><code>DOCUMENT_FRAGMENT_NODE</code></td>
  99. <td><code>11</code></td>
  100. </tr>
  101. <tr>
  102. <td><code>NOTATION_NODE</code> <em>(deprecated)</em></td>
  103. <td><code>12</code></td>
  104. </tr>
  105. </table>
  106. **/
  107. var nodeType(default,null) : Int;
  108. /**
  109. Returns a `DOMString` containing the name of the `Node`. The structure of the name will differ with the name type. E.g. An `HTMLElement` will contain the name of the corresponding tag, like `'audio'` for an `HTMLAudioElement`, a `Text` node will have the `'#text'` string, or a `Document` node will have the `'#document'` string.
  110. **/
  111. var nodeName(default,null) : String;
  112. /**
  113. Returns a `DOMString` representing the base URL. The concept of base URL changes from one language to another; in HTML, it corresponds to the protocol, the domain name and the directory structure, that is all until the last `'/'`.
  114. **/
  115. var baseURI(default,null) : String;
  116. /**
  117. Returns the `Document` that this node belongs to. If no document is associated with it, returns `null`.
  118. **/
  119. var ownerDocument(default,null) : HTMLDocument;
  120. /**
  121. Returns a `Node` that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns `null`.
  122. **/
  123. var parentNode(default,null) : Node;
  124. /**
  125. Returns an `Element` that is the parent of this node. If the node has no parent, or if that parent is not an `Element`, this property returns `null`.
  126. **/
  127. var parentElement(default,null) : Element;
  128. /**
  129. Returns a live `NodeList` containing all the children of this node. `NodeList` being live means that if the children of the `Node` change, the `NodeList` object is automatically updated.
  130. **/
  131. var childNodes(default,null) : NodeList;
  132. /**
  133. Returns a `Node` representing the first direct child node of the node, or `null` if the node has no child.
  134. **/
  135. var firstChild(default,null) : Node;
  136. /**
  137. Returns a `Node` representing the last direct child node of the node, or `null` if the node has no child.
  138. **/
  139. var lastChild(default,null) : Node;
  140. /**
  141. Returns a `Node` representing the previous node in the tree, or `null` if there isn't such node.
  142. **/
  143. var previousSibling(default,null) : Node;
  144. /**
  145. Returns a `Node` representing the next node in the tree, or `null` if there isn't such node.
  146. **/
  147. var nextSibling(default,null) : Node;
  148. /**
  149. Returns / Sets the value of the current node
  150. **/
  151. var nodeValue : String;
  152. /**
  153. Returns / Sets the textual content of an element and all its descendants.
  154. **/
  155. var textContent : String;
  156. /**
  157. The namespace URI of this node, or `null` if it is no namespace.
  158. Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the `https://www.w3.org/1999/xhtml/` namespace in both HTML and XML trees. `1.9.2`
  159. **/
  160. var namespaceURI(default,null) : String;
  161. /**
  162. Is a `DOMString` representing the namespace prefix of the node, or `null` if no prefix is specified.
  163. **/
  164. var prefix(default,null) : String;
  165. /**
  166. Returns a `DOMString` representing the local part of the qualified name of an element.
  167. Note: In Firefox 3.5 and earlier, the property upper-cases the local name for HTML elements (but not XHTML elements). In later versions, this does not happen, so the property is in lower case for both HTML and XHTML. `1.9.2`
  168. **/
  169. var localName(default,null) : String;
  170. /**
  171. Returns a `Boolean` indicating if the element has any child nodes, or not.
  172. **/
  173. function hasChildNodes() : Bool;
  174. /** @throws DOMError */
  175. /**
  176. Inserts the first `Node` given in a parameter immediately before the second, child of this element, `Node`.
  177. **/
  178. function insertBefore( node : Node, child : Node ) : Node;
  179. /** @throws DOMError */
  180. /**
  181. Adds the specified childNode argument as the last child to the current node.
  182. If the argument referenced an existing node on the DOM tree, the node will be detached from its current position and attached at the new position.
  183. **/
  184. function appendChild( node : Node ) : Node;
  185. /** @throws DOMError */
  186. /**
  187. Replaces one child `Node` of the current one with the second one given in parameter.
  188. **/
  189. function replaceChild( node : Node, child : Node ) : Node;
  190. /** @throws DOMError */
  191. /**
  192. Removes a child node from the current element, which must be a child of the current node.
  193. **/
  194. function removeChild( child : Node ) : Node;
  195. /**
  196. Clean up all the text nodes under this element (merge adjacent, remove empty).
  197. **/
  198. function normalize() : Void;
  199. /** @throws DOMError */
  200. /**
  201. Clone a `Node`, and optionally, all of its contents. By default, it clones the content of the node.
  202. **/
  203. function cloneNode( ?deep : Bool = false ) : Node;
  204. /**
  205. Returns a `Boolean` which indicates whether or not two nodes are of the same type and all their defining data points match.
  206. **/
  207. function isEqualNode( node : Node ) : Bool;
  208. /**
  209. Returns the context objects root which optionally includes the shadow root if it is available. 
  210. **/
  211. function compareDocumentPosition( other : Node ) : Int;
  212. /**
  213. Returns the context objects root which optionally includes the shadow root if it is available. 
  214. **/
  215. function contains( other : Node ) : Bool;
  216. /**
  217. Clean up all the text nodes under this element (merge adjacent, remove empty).
  218. **/
  219. function lookupPrefix( namespace_ : String ) : String;
  220. /**
  221. Clean up all the text nodes under this element (merge adjacent, remove empty).
  222. **/
  223. function lookupNamespaceURI( prefix : String ) : String;
  224. /**
  225. Returns a `Boolean` which indicates whether or not two nodes are of the same type and all their defining data points match.
  226. **/
  227. function isDefaultNamespace( namespace_ : String ) : Bool;
  228. }