2 * Copyright 2008 The Closure Compiler Authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @fileoverview Definitions for W3C's range specification.
19 * This file depends on w3c_dom2.js.
20 * The whole file has been fully type annotated.
22 * http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html
25 * @author stevey@google.com (Steve Yegge)
31 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Interface
37 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startParent
39 Range.prototype.startContainer;
43 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-startOffset
45 Range.prototype.startOffset;
49 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endParent
51 Range.prototype.endContainer;
55 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-endOffset
57 Range.prototype.endOffset;
61 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-collapsed
63 Range.prototype.collapsed;
67 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-attr-commonParent
69 Range.prototype.commonAncestorContainer;
72 * @param {Node} refNode
73 * @param {number} offset
75 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStart
77 Range.prototype.setStart = function(refNode, offset) {};
80 * @param {Node} refNode
81 * @param {number} offset
83 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEnd
85 Range.prototype.setEnd = function(refNode, offset) {};
88 * @param {Node} refNode
90 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-setStartBefore
92 Range.prototype.setStartBefore = function(refNode) {};
95 * @param {Node} refNode
97 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStartAfter
99 Range.prototype.setStartAfter = function(refNode) {};
102 * @param {Node} refNode
103 * @return {undefined}
104 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndBefore
106 Range.prototype.setEndBefore = function(refNode) {};
109 * @param {Node} refNode
110 * @return {undefined}
111 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndAfter
113 Range.prototype.setEndAfter = function(refNode) {};
116 * @param {boolean} toStart
117 * @return {undefined}
118 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-collapse
120 Range.prototype.collapse = function(toStart) {};
123 * @param {Node} refNode
124 * @return {undefined}
125 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNode
127 Range.prototype.selectNode = function(refNode) {};
130 * @param {Node} refNode
131 * @return {undefined}
132 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNodeContents
134 Range.prototype.selectNodeContents = function(refNode) {};
138 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
140 Range.prototype.START_TO_START = 0;
144 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
146 Range.prototype.START_TO_END = 1;
150 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
152 Range.prototype.END_TO_END = 2;
156 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-compareHow
158 Range.prototype.END_TO_START = 3;
161 * @param {number} how
162 * @param {Range} sourceRange
164 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-compareBoundaryPoints
166 Range.prototype.compareBoundaryPoints = function(how, sourceRange) {};
170 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-deleteContents
172 Range.prototype.deleteContents = function() {};
175 * @return {DocumentFragment}
176 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-extractContents
178 Range.prototype.extractContents = function() {};
181 * @return {DocumentFragment}
182 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-cloneContents
184 Range.prototype.cloneContents = function() {};
187 * @param {Node} newNode
188 * @return {DocumentFragment}
189 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-insertNode
191 Range.prototype.insertNode = function(newNode) {};
194 * @param {Node} newParent
195 * @return {undefined}
196 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-surroundContents
198 Range.prototype.surroundContents = function(newParent) {};
202 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-clone
204 Range.prototype.cloneRange = function() {};
207 * @return {undefined}
208 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-detach
210 Range.prototype.detach = function() {};
212 // Introduced in DOM Level 2:
215 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-DocumentRange-idl
217 function DocumentRange() {}
221 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-DocumentRange-method-createRange
223 DocumentRange.prototype.createRange = function() {};
225 // Introduced in DOM Level 2:
228 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeException
230 function RangeException() {}
234 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
236 RangeException.prototype.code;
240 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
242 RangeException.prototype.BAD_BOUNDARYPOINTS_ERR = 1;
246 * @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#RangeExceptionCode
248 RangeException.prototype.INVALID_NODE_TYPE_ERR = 2;