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 all the extensions over the
* W3C's DOM specification by IE in JScript. This file depends on
* w3c_dom2.js. The whole file has NOT been fully type annotated.
*
* When a non-standard extension appears in both Gecko and IE, we put
* it in gecko_dom.js
*
* @externs
* @author stevey@google.com (Steve Yegge)
*/
// TODO(nicksantos): Rewrite all the DOM interfaces as interfaces, instead
// of kludging them as an inheritance hierarchy.
/**
* @constructor
* @extends {Document}
*/
function XMLDOMDocument() {}
/**
* @type {boolean}
*/
XMLDOMDocument.prototype.async;
/**
* @type {!Function}
*/
XMLDOMDocument.prototype.ondataavailable;
/**
* @type {!Function}
*/
XMLDOMDocument.prototype.onreadystatechange;
/**
* @type {!Function}
*/
XMLDOMDocument.prototype.ontransformnode;
/**
* @type {Object}
*/
XMLDOMDocument.prototype.parseError;
/**
* @type {boolean}
*/
XMLDOMDocument.prototype.preserveWhiteSpace;
/**
* @type {number}
*/
XMLDOMDocument.prototype.readyState;
/**
* @type {boolean}
*/
XMLDOMDocument.prototype.resolveExternals;
/**
* @param {string} name
* @param {*} value
*/
XMLDOMDocument.prototype.setProperty = function(name, value) {};
/**
* @type {string}
*/
XMLDOMDocument.prototype.url;
/**
* @type {boolean}
*/
XMLDOMDocument.prototype.validateOnParse;
/**
*/
XMLDOMDocument.prototype.abort = function() {};
/**
* @param {*} type
* @param {string} name
* @param {string} namespaceURI
* @return {Node}
* @nosideeffects
*/
XMLDOMDocument.prototype.createNode = function(type, name, namespaceURI) {};
/**
* @param {string} xmlSource
* @return {boolean}
* @override
*/
XMLDOMDocument.prototype.load = function(xmlSource) {};
/**
* @param {string} xmlString
* @return {boolean}
* @override
*/
XMLDOMDocument.prototype.loadXML = function(xmlString) {};
/**
* @param {string} id
* @return {Node}
*/
XMLDOMDocument.prototype.nodeFromID = function(id) {};
//==============================================================================
// XMLNode methods and properties
// In a real DOM hierarchy, XMLDOMDocument inherits from XMLNode and Document.
// Since we can't express that in our type system, we put XMLNode properties
// on Node.
/**
* @type {string}
*/
Node.prototype.baseName;
/**
* @type {?string}
*/
Node.prototype.dataType;
/**
* @type {Node}
*/
Node.prototype.definition;
/**
* IE5 used document instead of ownerDocument.
* Old versions of WebKit used document instead of contentDocument.
* @type {Document}
*/
Node.prototype.document;
/**
* Inserts the given HTML text into the element at the location.
* @param {string} sWhere Where to insert the HTML text, one of 'beforeBegin',
* 'afterBegin', 'beforeEnd', 'afterEnd'.
* @param {string} sText HTML text to insert.
*/
Node.prototype.insertAdjacentHTML = function(sWhere, sText) {};
/**
* @type {*}
*/
Node.prototype.nodeTypedValue;
/**
* @type {string}
*/
Node.prototype.nodeTypeString;
/**
* @type {boolean}
*/
Node.prototype.parsed;
/**
* @type {Element}
*/
Node.prototype.parentElement;
/**
* @type {boolean}
*/
Node.prototype.specified;
/**
* @type {string}
*/
Node.prototype.text;
/**
* @type {string}
*/
Node.prototype.xml;
/**
* @param {string} expression An XPath expression.
* @return {NodeList}
* @nosideeffects
*/
Node.prototype.selectNodes = function(expression) {};
/**
* @param {string} expression An XPath expression.
* @return {Node}
* @nosideeffects
*/
Node.prototype.selectSingleNode = function(expression) {};
/**
* @param {Node} stylesheet XSLT stylesheet.
* @return {string}
* @nosideeffects
*/
Node.prototype.transformNode = function(stylesheet) {};
/**
* @param {Node} stylesheet XSLT stylesheet.
* @param {Object} outputObject
*/
Node.prototype.transformNodeToObject =
function(stylesheet, outputObject) {};
//==============================================================================
// Node methods
/**
* @param {boolean=} opt_bRemoveChildren Whether to remove the entire sub-tree.
* Defaults to false.
* @return {Node} The object that was removed.
*/
Node.prototype.removeNode = function(opt_bRemoveChildren) {};
/**
* @constructor
*/
function ClipboardData() {}
/**
* @param {string=} opt_type Type of clipboard data to clear. 'Text' or
* 'URL' or 'File' or 'HTML' or 'Image'.
*/
ClipboardData.prototype.clearData = function(opt_type) {};
/**
* @param {string} type Type of clipboard data to set ('Text' or 'URL').
* @param {string} data Data to set
* @return {boolean} Whether the data were set correctly.
*/
ClipboardData.prototype.setData = function(type, data) {};
/**
* @param {string} type Type of clipboard data to get ('Text' or 'URL').
* @return {string} The current data
*/
ClipboardData.prototype.getData = function(type) { };
/**
* @type {!Window}
*/
var window;
/**
* @type ClipboardData
*/
Window.prototype.clipboardData;
/**
*/
Window.prototype.dialogHeight;
/**
*/
Window.prototype.dialogLeft;
/**
*/
Window.prototype.dialogTop;
/**
*/
Window.prototype.dialogWidth;
/**
*/
Window.prototype.event;
/**
*/
Window.prototype.maxConnectionsPer1_0Server;
/**
*/
Window.prototype.maxConnectionsPerServer;
/**
*/
Window.prototype.offscreenBuffering;
/**
*/
Window.prototype.screenLeft;
/**
*/
Window.prototype.screenTop;
// Functions
/**
* @param {string} event
* @param {Function} handler
*/
Window.prototype.attachEvent;
/**
*/
Window.prototype.createPopup;
/**
* @param {string} event
* @param {Function} handler
*/
Window.prototype.detachEvent;
/**
*/
Window.prototype.execScript;
/**
*/
Window.prototype.focus;
/**
* @param {number} x
* @param {number} y
*/
Window.prototype.moveBy = function(x, y) {};
/**
* @param {number} x
* @param {number} y
*/
Window.prototype.moveTo = function(x, y) {};
/**
*/
Window.prototype.navigate;
/**
* @param {*=} opt_url
* @param {string=} opt_windowName
* @param {string=} opt_windowFeatures
* @param {boolean=} opt_replace
* @return {Window}
*/
Window.prototype.open = function(opt_url, opt_windowName, opt_windowFeatures,
opt_replace) {};
/**
*/
Window.prototype.print = function() {};
/**
* @param {number} width
* @param {number} height
*/
Window.prototype.resizeBy = function(width, height) {};
/**
* @param {number} width
* @param {number} height
*/
Window.prototype.resizeTo = function(width, height) {};
/**
*/
Window.prototype.setActive;
/**
*/
Window.prototype.showHelp;
/**
*/
Window.prototype.showModelessDialog;
/**
* @const {!Object}
*/
Window.prototype.external;
/**
* @constructor
*/
function History() { };
/**
* @param {number|string} delta The number of entries to go back, or
* the URL to which to go back. (URL form is supported only in IE)
*/
History.prototype.go = function(delta) {};
/**
* @param {number=} opt_distance The number of entries to go back
* (Mozilla doesn't support distance -- use #go instead)
*/
History.prototype.back = function(opt_distance) {};
/**
* @type {number}
*/
History.prototype.length;
/**
*/
History.prototype.forward = function() {};
/**
* @type {boolean}
* @implicitCast
*/
HTMLFrameElement.prototype.allowTransparency;
/**
* @type {Window}
*/
HTMLFrameElement.prototype.contentWindow;
/**
* @type {boolean}
* @implicitCast
*/
HTMLIFrameElement.prototype.allowTransparency;
/**
* @type {Window}
*/
HTMLIFrameElement.prototype.contentWindow;
/**
*/
HTMLBodyElement.prototype.createControlRange;
/**
* @type {string}
*/
HTMLScriptElement.prototype.readyState;
/**
* @type {string}
*/
HTMLIFrameElement.prototype.readyState;
/**
* @type {string}
*/
HTMLImageElement.prototype.readyState;
/**
* @type {string}
*/
HTMLObjectElement.prototype.readyState;
/**
* @constructor
*/
function ControlRange() {}
ControlRange.prototype.add;
ControlRange.prototype.addElement;
ControlRange.prototype.execCommand;
ControlRange.prototype.item;
ControlRange.prototype.queryCommandEnabled;
ControlRange.prototype.queryCommandIndeterm;
ControlRange.prototype.queryCommandState;
ControlRange.prototype.queryCommandSupported;
ControlRange.prototype.queryCommandValue;
ControlRange.prototype.remove;
ControlRange.prototype.scrollIntoView;
ControlRange.prototype.select;
/**
* @constructor
*/
function TextRange() {}
/**
*/
TextRange.prototype.boundingHeight;
/**
*/
TextRange.prototype.boundingLeft;
/**
*/
TextRange.prototype.boundingTop;
/**
*/
TextRange.prototype.boundingWidth;
/**
*/
TextRange.prototype.htmlText;
/**
*/
TextRange.prototype.offsetLeft;
/**
*/
TextRange.prototype.offsetTop;
/**
*/
TextRange.prototype.text;
/**
*/
TextRange.prototype.collapse;
/**
*/
TextRange.prototype.compareEndPoints;
/**
*/
TextRange.prototype.duplicate;
/**
*/
TextRange.prototype.execCommand;
/**
*/
TextRange.prototype.expand;
/**
*/
TextRange.prototype.findText;
/**
*/
TextRange.prototype.getBookmark;
/**
*/
TextRange.prototype.getBoundingClientRect;
/**
*/
TextRange.prototype.getClientRects;
/**
*/
TextRange.prototype.inRange;
/**
*/
TextRange.prototype.isEqual;
/**
*/
TextRange.prototype.move;
/**
*/
TextRange.prototype.moveEnd;
/**
*/
TextRange.prototype.moveStart;
/**
*/
TextRange.prototype.moveToBookmark;
/**
*/
TextRange.prototype.moveToElementText;
/**
*/
TextRange.prototype.moveToPoint;
/**
*/
TextRange.prototype.parentElement;
/**
*/
TextRange.prototype.pasteHTML;
/**
*/
TextRange.prototype.queryCommandEnabled;
/**
*/
TextRange.prototype.queryCommandIndeterm;
/**
*/
TextRange.prototype.queryCommandState;
/**
*/
TextRange.prototype.queryCommandSupported;
/**
*/
TextRange.prototype.queryCommandValue;
/**
*/
TextRange.prototype.scrollIntoView;
/**
*/
TextRange.prototype.select;
/**
*/
TextRange.prototype.setEndPoint;
/**
* @return {undefined}
*/
Selection.prototype.clear = function() {};
/**
* @return {TextRange|ControlRange}
*/
Selection.prototype.createRange = function() {};
/**
* @return {Array.<TextRange>}
*/
Selection.prototype.createRangeCollection = function() {};
/**
* @constructor
*/
function controlRange() {}
Document.prototype.loadXML;
/**
*/
Document.prototype.activeElement;
/**
*/
Document.prototype.charset;
/**
*/
Document.prototype.cookie;
/**
*/
Document.prototype.defaultCharset;
/**
*/
Document.prototype.dir;
/**
*/
Document.prototype.documentMode;
/**
*/
Document.prototype.expando;
/**
*/
Document.prototype.fileCreatedDate;
/**
*/
Document.prototype.fileModifiedDate;
/**
*/
Document.prototype.fileSize;
/**
*/
Document.prototype.parentWindow;
/**
*/
Document.prototype.protocol;
/**
* @type {string}
*/
HTMLDocument.prototype.readyState;
/**
* @type {Selection}
*/
Document.prototype.selection;
/**
*/
Document.prototype.uniqueID;
/**
*/
Document.prototype.URLUnencoded;
/**
*/
Document.prototype.XMLDocument;
/**
*/
Document.prototype.XSLDocument;
// functions
/**
* @param {string} event
* @param {Function} handler
*/
Document.prototype.attachEvent;
/**
*/
Document.prototype.createEventObject;
/**
*/
Document.prototype.createStyleSheet;
/**
* @param {string} event
* @param {Function} handler
*/
Document.prototype.detachEvent;
/**
*/
Document.prototype.focus;
/**
* @return {boolean}
*/
Document.prototype.hasFocus = function() {};
/**
*/
Document.prototype.mergeAttributes;
/**
*/
Document.prototype.recalc;
/**
*/
Document.prototype.releaseCapture;
/**
*/
Document.prototype.setActive;
// collections
/**
*/
Document.prototype.all;
/**
*/
Document.prototype.childNodes;
/**
*/
Document.prototype.frames;
/**
*/
Document.prototype.namespaces;
/**
*/
Document.prototype.scripts;
/**
* @param {string} sUrl
* @return {number}
*/
Element.prototype.addBehavior = function(sUrl) {};
/**
* @param {string} event
* @param {Function} handler
*/
Element.prototype.attachEvent;
/**
* @type {boolean}
*/
Element.prototype.canHaveChildren;
/**
* @type {string}
*/
Element.prototype.classid;
/**
* @param {number} iCoordX Integer that specifies the client window coordinate
* of x.
* @param {number} iCoordY Integer that specifies the client window coordinate
* of y.
* @return {string} The component of an element located at the specified
* coordinates.
* @nosideeffects
*/
Element.prototype.componentFromPoint = function(iCoordX, iCoordY) {};
/**
* @type {boolean}
*/
Element.prototype.contentEditable;
/**
* @return {TextRange}
*/
Element.prototype.createTextRange;
/**
*/
Element.prototype.currentStyle;
/**
* @param {string} event
* @param {Function} handler
*/
Element.prototype.detachEvent;
/**
* @param {string=} opt_action
*/
Element.prototype.doScroll = function(opt_action) {};
/**
*/
Element.prototype.fireEvent;
/**
* @type {boolean}
*/
Element.prototype.hideFocus;
/**
*/
Element.prototype.innerText;
/**
*/
Element.prototype.isContentEditable;
/**
* NOTE: Left untyped to avoid conflict with subclasses.
*/
Element.prototype.load;
/**
* @param {number} pointerId Id of the pointer that is assign to the element.
*/
Element.prototype.msSetPointerCapture = function(pointerId) {};
/**
* @param {number} pointerId
*/
Element.prototype.msReleasePointerCapture = function(pointerId) {};
/**
* @type {?function(Event)}
*/
Element.prototype.onbeforedeactivate;
/**
* @type {?function(Event)}
*/
Element.prototype.onmouseenter;
/**
* @type {?function(Event)}
*/
Element.prototype.onmouseleave;
/**
* @type {?function(Event)}
*/
Element.prototype.onselectstart;
/**
* @type {string}
*/
Element.prototype.outerHTML;
/**
*/
Element.prototype.releaseCapture = function() {};
/**
* @param {number} iID
* @return {boolean}
*/
Element.prototype.removeBehavior = function(iID) {};
/**
*/
Element.prototype.runtimeStyle;
/**
* @param {string} sStoreName The arbitrary name assigned to a persistent object
* in a UserData store.
*/
Element.prototype.save = function(sStoreName) {};
/**
* @param {boolean=} opt_bContainerCapture Events originating in a container are
* captured by the container. Defaults to true.
*/
Element.prototype.setCapture = function(opt_bContainerCapture) {};
/**
*/
Element.prototype.sourceIndex;
/**
* @type {string}
*/
Element.prototype.unselectable;
/**
* @constructor
*/
function HTMLFiltersCollection() {}
/**
* @type {number}
*/
HTMLFiltersCollection.prototype.length;
/**
* @type {HTMLFiltersCollection}
*/
Element.prototype.filters;
/**
* @constructor
*/
function HTMLFilter() {}
/**
*/
HTMLFilter.prototype.apply = function() {};
/**
* @constructor
* @extends {HTMLFilter}
*/
function AlphaFilter() {}
/**
* @type {number}
*/
AlphaFilter.prototype.Opacity;
/**
* @constructor
* @extends {HTMLFilter}
*/
function AlphaImageLoaderFilter() {}
/**
* @type {string}
*/
AlphaImageLoaderFilter.prototype.sizingMethod;
/**
* @constructor
*/
function Location() {}
/**
* @type {DOMStringList}
*/
Location.prototype.ancestorOrigins;
/**
* @type {string}
*/
Location.prototype.hash;
/**
* @type {string}
*/
Location.prototype.host;
/**
* @type {string}
*/
Location.prototype.hostname;
/**
* @type {string}
*/
Location.prototype.href;
/**
* @type {string}
*/
Location.prototype.origin;
/**
* @type {string}
*/
Location.prototype.pathname;
/**
*/
Location.prototype.port;
/**
* @type {string}
*/
Location.prototype.protocol;
/**
* @type {string}
*/
Location.prototype.search;
/**
* @param {string} url
*/
Location.prototype.assign = function(url) {};
/**
* @param {boolean=} opt_forceReload If true, reloads the page from
* the server. Defaults to false.
*/
Location.prototype.reload = function(opt_forceReload) {};
/**
* @param {string} url
*/
Location.prototype.replace = function(url) {};
// For IE, returns an object representing key-value pairs for all the global
// variables prefixed with str, e.g. test*
/** @param {*=} opt_str */
function RuntimeObject(opt_str) {}
/**
* @type {StyleSheet}
*/
HTMLStyleElement.prototype.styleSheet;
/**
* IE implements Cross Origin Resource Sharing (cross-domain XMLHttpRequests)
* via the XDomainRequest object.
*
* @constructor
*/
function XDomainRequest() {}
/**
* Aborts the request.
*/
XDomainRequest.prototype.abort = function() {};
/**
* Sets the method and URL for the request.
* @param {string} bstrMethod Either "GET" or "POST"
* @param {string} bstrUrl The target URL
*/
XDomainRequest.prototype.open = function(bstrMethod, bstrUrl) {};
/**
* Sends the request.
* @param {string=} varBody The POST body to send to the server. If omitted,
* the behavior is identical to sending an empty string.
*/
XDomainRequest.prototype.send = function(varBody) {};
/**
* Called if the request could not be completed. Note that error information is
* not available.
* @type {?function()}
*/
XDomainRequest.prototype.onerror;
/**
* Called when the response has finished.
* @type {?function()}
*/
XDomainRequest.prototype.onload;
/**
* Called every time part of the response has been received.
* @type {?function()}
*/
XDomainRequest.prototype.onprogress;
/**
* Called if the timeout period has elapsed.
* @type {?function()}
*/
XDomainRequest.prototype.ontimeout;
/**
* The current response body.
* @type {string}
*/
XDomainRequest.prototype.responseText;
/**
* The timeout (in milliseconds) for the request.
* @type {number}
*/
XDomainRequest.prototype.timeout;
/**
* The Content-Type of the response, or an empty string.
* @type {string}
*/
XDomainRequest.prototype.contentType;
/**
* @type {string}
*/
Navigator.prototype.browserLanguage;
/**
* @type {boolean}
*/
Navigator.prototype.msPointerEnabled;
/**
* @type {number}
*/
Screen.prototype.deviceXDPI;
/**
* @type {number}
*/
Screen.prototype.logicalXDPI;
/**
* @type {number}
*/
Screen.prototype.logicalYDPI;