Source code
Revision control
Copy as Markdown
Other Tools
/*
* Copyright 2008 The Closure Compiler Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Definitions for W3C's range specification.
* This file depends on w3c_dom2.js.
* The whole file has been fully type annotated.
* Created from
*
* @externs
* @author stevey@google.com (Steve Yegge)
*/
/**
* @constructor
*/
function Range() {}
/**
* @type {Node}
*/
Range.prototype.startContainer;
/**
* @type {number}
*/
Range.prototype.startOffset;
/**
* @type {Node}
*/
Range.prototype.endContainer;
/**
* @type {number}
*/
Range.prototype.endOffset;
/**
* @type {boolean}
*/
Range.prototype.collapsed;
/**
* @type {Node}
*/
Range.prototype.commonAncestorContainer;
/**
* @param {Node} refNode
* @param {number} offset
* @return {undefined}
*/
Range.prototype.setStart = function(refNode, offset) {};
/**
* @param {Node} refNode
* @param {number} offset
* @return {undefined}
*/
Range.prototype.setEnd = function(refNode, offset) {};
/**
* @param {Node} refNode
* @return {undefined}
*/
Range.prototype.setStartBefore = function(refNode) {};
/**
* @param {Node} refNode
* @return {undefined}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setStartAfter
*/
Range.prototype.setStartAfter = function(refNode) {};
/**
* @param {Node} refNode
* @return {undefined}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-setEndBefore
*/
Range.prototype.setEndBefore = function(refNode) {};
/**
* @param {Node} refNode
* @return {undefined}
*/
Range.prototype.setEndAfter = function(refNode) {};
/**
* @param {boolean} toStart
* @return {undefined}
*/
Range.prototype.collapse = function(toStart) {};
/**
* @param {Node} refNode
* @return {undefined}
*/
Range.prototype.selectNode = function(refNode) {};
/**
* @param {Node} refNode
* @return {undefined}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-selectNodeContents
*/
Range.prototype.selectNodeContents = function(refNode) {};
/**
* @type {number}
*/
Range.prototype.START_TO_START = 0;
/**
* @type {number}
*/
Range.prototype.START_TO_END = 1;
/**
* @type {number}
*/
Range.prototype.END_TO_END = 2;
/**
* @type {number}
*/
Range.prototype.END_TO_START = 3;
/**
* @param {number} how
* @param {Range} sourceRange
* @return {number}
*/
Range.prototype.compareBoundaryPoints = function(how, sourceRange) {};
/**
* @return {number}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-deleteContents
*/
Range.prototype.deleteContents = function() {};
/**
* @return {DocumentFragment}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-extractContents
*/
Range.prototype.extractContents = function() {};
/**
* @return {DocumentFragment}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-cloneContents
*/
Range.prototype.cloneContents = function() {};
/**
* @param {Node} newNode
* @return {DocumentFragment}
*/
Range.prototype.insertNode = function(newNode) {};
/**
* @param {Node} newParent
* @return {undefined}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-Range-method-surroundContents
*/
Range.prototype.surroundContents = function(newParent) {};
/**
* @return {Range}
*/
Range.prototype.cloneRange = function() {};
/**
* @return {undefined}
*/
Range.prototype.detach = function() {};
// Introduced in DOM Level 2:
/**
* @constructor
*/
function DocumentRange() {}
/**
* @return {Range}
* @see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level2-DocumentRange-method-createRange
*/
DocumentRange.prototype.createRange = function() {};
// Introduced in DOM Level 2:
/**
* @constructor
*/
function RangeException() {}
/**
* @type {number}
*/
RangeException.prototype.code;
/**
* @type {number}
*/
RangeException.prototype.BAD_BOUNDARYPOINTS_ERR = 1;
/**
* @type {number}
*/
RangeException.prototype.INVALID_NODE_TYPE_ERR = 2;