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
* W3C's DOM specification by Gecko. This file depends on
* w3c_dom2.js.
*
* When a non-standard extension appears in both Gecko and IE, we put
* it in gecko_dom.js
*
* @externs
*/
// TODO: Almost all of it has not been annotated with types.
// Gecko DOM;
/**
* Mozilla only???
* @constructor
* @extends {HTMLElement}
*/
function HTMLSpanElement() {}
/**
*/
Window.prototype.Components;
/**
* @type Window
*/
Window.prototype.content;
/**
* @type {boolean}
*/
Window.prototype.closed;
Window.prototype.controllers;
Window.prototype.crypto;
/**
* Gets/sets the status bar text for the given window.
* @type {string}
*/
Window.prototype.defaultStatus;
Window.prototype.dialogArguments;
Window.prototype.directories;
/**
* @type {HTMLObjectElement|HTMLIFrameElement|null}
*/
Window.prototype.frameElement;
/**
* Allows lookup of frames by index or by name.
* @type {?Object}
*/
Window.prototype.frames;
/**
* @type {boolean}
*/
Window.prototype.fullScreen;
/**
*/
Window.prototype.globalStorage;
/**
* @type {!History}
*/
Window.prototype.history;
/**
* Returns the number of frames (either frame or iframe elements) in the
* window.
*
* @type {number}
*/
Window.prototype.length;
/**
* @type {!Location}
* @implicitCast
*/
Window.prototype.location;
/**
*/
Window.prototype.locationbar;
/**
*/
Window.prototype.menubar;
/**
* @type {string}
*/
Window.prototype.name;
/**
* @type {Navigator}
*/
Window.prototype.navigator;
/**
* @type {?Window}
*/
Window.prototype.opener;
/**
* @type {!Window}
*/
Window.prototype.parent;
Window.prototype.personalbar;
Window.prototype.pkcs11;
Window.prototype.returnValue;
Window.prototype.scrollbars;
/**
* @type {number}
*/
Window.prototype.scrollMaxX;
/**
* @type {number}
*/
Window.prototype.scrollMaxY;
/**
* @type {!Window}
*/
Window.prototype.self;
Window.prototype.sessionStorage;
Window.prototype.sidebar;
/**
* @type {?string}
*/
Window.prototype.status;
Window.prototype.statusbar;
Window.prototype.toolbar;
/**
* @type {!Window}
*/
Window.prototype.top;
/**
* @type {!Window}
*/
Window.prototype.window;
/**
* @param {*} message
*/
Window.prototype.alert = function(message) {};
/**
* Decodes a string of data which has been encoded using base-64 encoding.
*
* @param {string} encodedData
* @return {string}
* @nosideeffects
*/
function atob(encodedData) {}
Window.prototype.back = function() {};
Window.prototype.blur = function() {};
/**
* @param {string} stringToEncode
* @return {string}
* @nosideeffects
*/
function btoa(stringToEncode) {}
/** @deprecated */
Window.prototype.captureEvents;
Window.prototype.close = function() {};
Window.prototype.find;
Window.prototype.focus = function() {};
Window.prototype.forward = function() {};
Window.prototype.getAttention = function() {};
/**
* @return {Selection}
* @nosideeffects
*/
Window.prototype.getSelection = function() {};
Window.prototype.home = function() {};
Window.prototype.openDialog;
Window.prototype.releaseEvents;
Window.prototype.scrollByLines;
Window.prototype.scrollByPages;
/**
* @param {string} uri
* @param {?=} opt_arguments
* @param {string=} opt_options
*/
Window.prototype.showModalDialog;
Window.prototype.sizeToContent;
/**
*/
Window.prototype.stop = function() {};
Window.prototype.updateCommands;
// properties of Document
/**
* @type {string}
*/
Document.prototype.alinkColor;
/**
* @type {HTMLCollection}
*/
Document.prototype.anchors;
/**
* @type {HTMLCollection}
*/
Document.prototype.applets;
/** @type {boolean} */ Document.prototype.async;
/** @type {string?} */ Document.prototype.baseURI;
Document.prototype.baseURIObject;
/**
* @type {string}
*/
Document.prototype.bgColor;
/** @type {HTMLBodyElement} */ Document.prototype.body;
Document.prototype.characterSet;
/**
* @type {string}
*/
Document.prototype.compatMode;
Document.prototype.contentType;
/** @type {string} */ Document.prototype.cookie;
Document.prototype.defaultView;
/**
* @type {string}
*/
Document.prototype.designMode;
Document.prototype.documentURIObject;
/**
* @type {string}
*/
Document.prototype.domain;
/**
* @type {HTMLCollection}
*/
Document.prototype.embeds;
/**
* @type {string}
*/
Document.prototype.fgColor;
/** @type {Element} */ Document.prototype.firstChild;
/**
* @type {HTMLCollection}
*/
Document.prototype.forms;
/** @type {number} */ Document.prototype.height;
/** @type {HTMLCollection} */ Document.prototype.images;
/**
* @type {string}
*/
Document.prototype.lastModified;
/**
* @type {string}
*/
Document.prototype.linkColor;
/**
* @type {HTMLCollection}
*/
Document.prototype.links;
/**
* @type {!Location}
* @implicitCast
*/
Document.prototype.location;
Document.prototype.namespaceURI;
Document.prototype.nodePrincipal;
Document.prototype.plugins;
Document.prototype.popupNode;
/**
* @type {string}
*/
Document.prototype.referrer;
/**
* @type {StyleSheetList}
*/
Document.prototype.styleSheets;
/** @type {?string} */ Document.prototype.title;
Document.prototype.tooltipNode;
/** @type {string} */ Document.prototype.URL;
/**
* @type {string}
*/
Document.prototype.vlinkColor;
/** @type {number} */ Document.prototype.width;
// Methods of Document
/**
*/
Document.prototype.clear = function() {};
/**
*/
Document.prototype.close;
/**
* @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate
* @param {?string} namespaceURI
* @param {string} qualifiedName
* @param {string=} opt_typeExtension
* @return {!Element}
*/
Document.prototype.createElementNS =
function(namespaceURI, qualifiedName, opt_typeExtension) {};
/**
* @param {string} type
* @return {Event}
*/
Document.prototype.createEvent = function(type) {};
Document.prototype.createNSResolver;
/** @return {Range} */ Document.prototype.createRange = function() {};
Document.prototype.createTreeWalker;
Document.prototype.evaluate;
/**
* @param {string} commandName
* @param {?boolean=} opt_showUi
* @param {*=} opt_value
*/
Document.prototype.execCommand;
/**
* @param {string} s id.
* @return {HTMLElement}
* @nosideeffects
*/
Document.prototype.getElementById = function(s) {};
/**
* @param {string} name
* @return {!NodeList}
* @nosideeffects
*/
Document.prototype.getElementsByClassName = function(name) {};
/**
* @param {string} name
* @return {!NodeList}
* @nosideeffects
*/
Document.prototype.getElementsByName = function(name) {};
/**
* @param {string} namespace
* @param {string} name
* @return {!NodeList}
* @nosideeffects
*/
Document.prototype.getElementsByTagNameNS = function(namespace, name) {};
/**
* @param {Node} externalNode
* @param {boolean} deep
* @return {Node}
*/
Document.prototype.importNode = function(externalNode, deep) {};
/** @param {string} uri */
Document.prototype.load = function(uri) {};
Document.prototype.loadOverlay;
/**
*/
Document.prototype.open;
/**
*/
Document.prototype.queryCommandEnabled;
/**
*/
Document.prototype.queryCommandIndeterm;
/**
*/
Document.prototype.queryCommandState;
/**
* @param {string} command
* @return {?} Implementation-specific.
*/
Document.prototype.queryCommandSupported;
/**
*/
Document.prototype.queryCommandValue;
/**
* @param {string} text
*/
Document.prototype.write = function(text) {};
/**
* @param {string} text
*/
Document.prototype.writeln = function(text) {};
Document.prototype.ononline;
Document.prototype.onoffline;
// XUL
/**
* @return {BoxObject}
* @nosideeffects
*/
Document.prototype.getBoxObjectFor = function(element) {};
// From:
/**
* @param {string} tag
* @return {DocumentFragment}
*/
Range.prototype.createContextualFragment;
/**
* @param {Node} parent
* @param {number} offset
* @return {boolean}
* @nosideeffects
*/
Range.prototype.isPointInRange;
/**
* @param {Node} parent
* @param {number} offset
* @return {number}
* @nosideeffects
*/
Range.prototype.comparePoint;
/**
* @param {Node} n
* @return {boolean}
* @nosideeffects
*/
Range.prototype.intersectsNode;
/**
* @param {Node} n
* @return {number}
* @nosideeffects
*/
Range.prototype.compareNode;
/** @constructor */
function Selection() {}
/**
* @type {Node}
*/
Selection.prototype.anchorNode;
/**
* @type {number}
*/
Selection.prototype.anchorOffset;
/**
* @type {Node}
*/
Selection.prototype.focusNode;
/**
* @type {number}
*/
Selection.prototype.focusOffset;
/**
* @type {boolean}
*/
Selection.prototype.isCollapsed;
/**
* @type {number}
*/
Selection.prototype.rangeCount;
/**
* @param {Range} range
* @return {undefined}
*/
Selection.prototype.addRange = function(range) {};
/**
* @param {number} index
* @return {Range}
* @nosideeffects
*/
Selection.prototype.getRangeAt = function(index) {};
/**
* @param {Node} node
* @param {number} index
* @return {undefined}
*/
Selection.prototype.collapse = function(node, index) {};
/**
* @return {undefined}
*/
Selection.prototype.collapseToEnd = function() {};
/**
* @return {undefined}
*/
Selection.prototype.collapseToStart = function() {};
/**
* @param {Node} node
* @param {boolean} partlyContained
* @return {boolean}
* @nosideeffects
*/
Selection.prototype.containsNode = function(node, partlyContained) {};
/**
*/
Selection.prototype.deleteFromDocument = function() {};
/**
* @param {Node} parentNode
* @param {number} offset
*/
Selection.prototype.extend = function(parentNode, offset) {};
/**
*/
Selection.prototype.removeAllRanges = function() {};
/**
* @param {Range} range
*/
Selection.prototype.removeRange = function(range) {};
/**
* @param {Node} parentNode
*/
Selection.prototype.selectAllChildren;
/**
*/
Selection.prototype.selectionLanguageChange;
/** @type {NamedNodeMap} */ Element.prototype.attributes;
Element.prototype.baseURIObject;
/** @type {!NodeList} */ Element.prototype.childNodes;
/**
* @type {!NodeList}
*/
Element.prototype.children;
/**
* @type {string}
* @implicitCast
*/
Element.prototype.className;
/** @type {string} */ Element.prototype.dir;
/**
* Firebug sets this property on elements it is inserting into the DOM.
* @type {boolean}
*/
Element.prototype.firebugIgnore;
/** @type {Node} */ Element.prototype.firstChild;
/**
* @type {string}
* @implicitCast
*/
Element.prototype.id;
/**
* @type {string}
* @implicitCast
*/
Element.prototype.innerHTML;
/** @type {string} */ Element.prototype.lang;
/** @type {Node} */ Element.prototype.lastChild;
Element.prototype.localName;
Element.prototype.name;
Element.prototype.namespaceURI;
/** @type {Node} */ Element.prototype.nextSibling;
Element.prototype.nodeName;
Element.prototype.nodePrincipal;
/** @type {number} */ Element.prototype.nodeType;
Element.prototype.nodeValue;
/** @type {Document} */ Element.prototype.ownerDocument;
/** @type {Node} */ Element.prototype.parentNode;
Element.prototype.prefix;
/** @type {Node} */ Element.prototype.previousSibling;
/** @type {!CSSStyleDeclaration} */ Element.prototype.style;
/**
* @type {number}
* @implicitCast
*/
Element.prototype.tabIndex;
/**
* @type {string}
* @implicitCast
*/
Element.prototype.textContent;
/** @type {string} */ Element.prototype.title;
/**
* @param {Node} child
* @return {Node} appendedElement.
* @override
*/
Element.prototype.appendChild = function(child) {};
/**
* @override
* @return {!Element}
*/
Element.prototype.cloneNode = function(deep) {};
/** @override */
Element.prototype.dispatchEvent = function(event) {};
/** @return {undefined} */
Element.prototype.blur = function() {};
/** @return {undefined} */
Element.prototype.click = function() {};
/** @return {undefined} */
Element.prototype.focus = function() {};
/**
* @return {boolean}
* @override
* @nosideeffects
*/
Element.prototype.hasAttributes = function() {};
/**
* @return {boolean}
* @override
* @nosideeffects
*/
Element.prototype.hasChildNodes = function() {};
/** @override */
Element.prototype.insertBefore = function(insertedNode, adjacentNode) {};
/**
* @return {undefined}
* @override
*/
Element.prototype.normalize = function() {};
/**
* @param {Node} removedNode
* @return {!Node}
* @override
*/
Element.prototype.removeChild = function(removedNode) {};
/**
* @param {boolean=} opt_useCapture
* @override
*/
Element.prototype.removeEventListener = function(type, handler, opt_useCapture)
{};
/** @override */
Element.prototype.replaceChild = function(insertedNode, replacedNode) {};
/** @type {number} */
HTMLInputElement.prototype.selectionStart;
/** @type {number} */
HTMLInputElement.prototype.selectionEnd;
/**
* @param {number} selectionStart
* @param {number} selectionEnd
*/
HTMLInputElement.prototype.setSelectionRange =
function(selectionStart, selectionEnd) {};
/** @type {number} */
HTMLTextAreaElement.prototype.selectionStart;
/** @type {number} */
HTMLTextAreaElement.prototype.selectionEnd;
/**
* @param {number} selectionStart
* @param {number} selectionEnd
*/
HTMLTextAreaElement.prototype.setSelectionRange =
function(selectionStart, selectionEnd) {};
/** @constructor */
function Navigator() {}
/**
* @type {string}
*/
Navigator.prototype.appCodeName;
/**
* @type {string}
*/
Navigator.prototype.appName;
/**
* @type {string}
*/
Navigator.prototype.appVersion;
/**
* @type {string}
*/
Navigator.prototype.buildID;
/**
* @type {boolean}
*/
Navigator.prototype.cookieEnabled;
/**
* @type {string}
*/
Navigator.prototype.language;
/**
* @type {MimeTypeArray}
*/
Navigator.prototype.mimeTypes;
/**
* @type {boolean}
*/
Navigator.prototype.onLine;
/**
* @type {string}
*/
Navigator.prototype.oscpu;
/**
* @type {string}
*/
Navigator.prototype.platform;
/**
* @type {PluginArray}
*/
Navigator.prototype.plugins;
/**
* @type {string}
*/
Navigator.prototype.product;
/**
* @type {string}
*/
Navigator.prototype.productSub;
/**
* @type {string}
*/
Navigator.prototype.securityPolicy;
/**
* @param {string} url
* @param {ArrayBufferView|Blob|string|FormData=} opt_data
* @return {boolean}
*/
Navigator.prototype.sendBeacon = function(url, opt_data) {};
/**
* @type {string}
*/
Navigator.prototype.userAgent;
/**
* @type {string}
*/
Navigator.prototype.vendor;
/**
* @type {string}
*/
Navigator.prototype.vendorSub;
/**
* @type {function(): boolean}
* @nosideeffects
*/
Navigator.prototype.javaEnabled = function() {};
/**
* @constructor
*/
function PluginArray() {}
/** @type {number} */
PluginArray.prototype.length;
/**
* @param {number} index
* @return {Plugin}
*/
PluginArray.prototype.item = function(index) {};
/**
* @param {string} name
* @return {Plugin}
*/
PluginArray.prototype.namedItem = function(name) {};
/** @param {boolean=} reloadDocuments */
PluginArray.prototype.refresh = function(reloadDocuments) {};
/** @constructor */
function MimeTypeArray() {}
/**
* @param {number} index
* @return {MimeType}
*/
MimeTypeArray.prototype.item = function(index) {};
/**
* @type {number}
*/
MimeTypeArray.prototype.length;
/**
* @param {string} name
* @return {MimeType}
*/
MimeTypeArray.prototype.namedItem = function(name) {};
/** @constructor */
function MimeType() {}
/** @type {string} */
MimeType.prototype.description;
/** @type {Plugin} */
MimeType.prototype.enabledPlugin;
/** @type {string} */
MimeType.prototype.suffixes;
/** @type {string} */
MimeType.prototype.type;
/** @constructor */
function Plugin() {}
/** @type {string} */
Plugin.prototype.description;
/** @type {string} */
Plugin.prototype.filename;
/** @type {number} */
Plugin.prototype.length;
/** @type {string} */
Plugin.prototype.name;
/** @constructor */
function BoxObject() {}
/** @type {Element} */
BoxObject.prototype.element;
/** @type {number} */
BoxObject.prototype.screenX;
/** @type {number} */
BoxObject.prototype.screenY;
/** @type {number} */
BoxObject.prototype.x;
/** @type {number} */
BoxObject.prototype.y;
/** @type {number} */
BoxObject.prototype.width;
/**
* @type {number}
*/
HTMLImageElement.prototype.naturalWidth;
/**
* @type {number}
*/
HTMLImageElement.prototype.naturalHeight;
/**
* @param {Element} element
* @param {?string=} pseudoElt
* @return {CSSStyleDeclaration}
* @nosideeffects
*/
function getComputedStyle(element, pseudoElt) {}