Range.hx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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\Range.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `Range` interface represents a fragment of a document that can contain nodes and parts of text nodes.
  26. Documentation [Range](https://developer.mozilla.org/en-US/docs/Web/API/Range) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Range$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/Range>
  28. **/
  29. @:native("Range")
  30. extern class Range
  31. {
  32. static inline var START_TO_START : Int = 0;
  33. static inline var START_TO_END : Int = 1;
  34. static inline var END_TO_END : Int = 2;
  35. static inline var END_TO_START : Int = 3;
  36. /**
  37. Returns the `Node` within which the `Range` starts.
  38. **/
  39. var startContainer(default,null) : Node;
  40. /**
  41. Returns a number representing where in the `startContainer` the `Range` starts.
  42. **/
  43. var startOffset(default,null) : Int;
  44. /**
  45. Returns the `Node` within which the `Range` ends.
  46. **/
  47. var endContainer(default,null) : Node;
  48. /**
  49. Returns a number representing where in the `endContainer` the `Range` ends.
  50. **/
  51. var endOffset(default,null) : Int;
  52. /**
  53. Returns a `Boolean` indicating whether the range's start and end points are at the same position.
  54. **/
  55. var collapsed(default,null) : Bool;
  56. /**
  57. Returns the deepest `Node` that contains the `startContainer` and `endContainer` nodes.
  58. **/
  59. var commonAncestorContainer(default,null) : Node;
  60. /** @throws DOMError */
  61. function new() : Void;
  62. /** @throws DOMError */
  63. function setStart( refNode : Node, offset : Int ) : Void;
  64. /** @throws DOMError */
  65. function setEnd( refNode : Node, offset : Int ) : Void;
  66. /** @throws DOMError */
  67. function setStartBefore( refNode : Node ) : Void;
  68. /** @throws DOMError */
  69. function setStartAfter( refNode : Node ) : Void;
  70. /** @throws DOMError */
  71. function setEndBefore( refNode : Node ) : Void;
  72. /** @throws DOMError */
  73. function setEndAfter( refNode : Node ) : Void;
  74. function collapse( ?toStart : Bool = false ) : Void;
  75. /** @throws DOMError */
  76. function selectNode( refNode : Node ) : Void;
  77. /** @throws DOMError */
  78. function selectNodeContents( refNode : Node ) : Void;
  79. /** @throws DOMError */
  80. function compareBoundaryPoints( how : Int, sourceRange : Range ) : Int;
  81. /** @throws DOMError */
  82. function deleteContents() : Void;
  83. /** @throws DOMError */
  84. function extractContents() : DocumentFragment;
  85. /** @throws DOMError */
  86. function cloneContents() : DocumentFragment;
  87. /** @throws DOMError */
  88. function insertNode( node : Node ) : Void;
  89. /** @throws DOMError */
  90. function surroundContents( newParent : Node ) : Void;
  91. function cloneRange() : Range;
  92. function detach() : Void;
  93. /** @throws DOMError */
  94. function isPointInRange( node : Node, offset : Int ) : Bool;
  95. /** @throws DOMError */
  96. function comparePoint( node : Node, offset : Int ) : Int;
  97. /** @throws DOMError */
  98. function intersectsNode( node : Node ) : Bool;
  99. /** @throws DOMError */
  100. function createContextualFragment( fragment : String ) : DocumentFragment;
  101. function getClientRects() : DOMRectList;
  102. function getBoundingClientRect() : DOMRect;
  103. }