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 DOM Level 3 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)
*/
/**
* @type {number}
*/
DOMException.prototype.code;
/**
* @type {number}
*/
DOMException.VALIDATION_ERR = 16;
/**
* @type {number}
*/
DOMException.TYPE_MISMATCH_ERR = 17;
/**
* @constructor
*/
function DOMStringList() {}
/**
* @type {number}
*/
DOMStringList.prototype.length;
/**
* @param {string} str
* @return {boolean}
*/
DOMStringList.prototype.contains = function(str) {};
/**
* @param {number} index
* @return {string}
*/
DOMStringList.prototype.item = function(index) {};
/**
* @constructor
*/
function NameList() {}
/**
* @type {number}
*/
NameList.prototype.length;
/**
* @param {string} str
* @return {boolean}
* @nosideeffects
*/
NameList.prototype.contains = function(str) {};
/**
* @param {string} namespaceURI
* @param {string} name
* @return {boolean}
* @nosideeffects
*/
NameList.prototype.containsNS = function(namespaceURI, name) {};
/**
* @param {number} index
* @return {string}
* @nosideeffects
*/
NameList.prototype.getName = function(index) {};
/**
* @param {number} index
* @return {string}
* @nosideeffects
*/
NameList.prototype.getNamespaceURI = function(index) {};
/**
* @constructor
*/
function DOMImplementationList() {}
/**
* @type {number}
*/
DOMImplementationList.prototype.length;
/**
* @param {number} index
* @return {DOMImplementation}
* @nosideeffects
*/
DOMImplementationList.prototype.item = function(index) {};
/**
* @constructor
*/
function DOMImplementationSource() {}
/**
* @param {string} namespaceURI
* @param {string} publicId
* @param {DocumentType} doctype
* @return {Document}
* @nosideeffects
*/
DOMImplementation.prototype.createDocument = function(namespaceURI, publicId, doctype) {};
/**
* @param {string} qualifiedName
* @param {string} publicId
* @param {string} systemId
* @return {DocumentType}
* @nosideeffects
*/
DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {};
/**
* @param {string} features
* @return {DOMImplementation}
* @nosideeffects
*/
DOMImplementationSource.prototype.getDOMImplementation = function(features) {};
/**
* @param {string} features
* @return {DOMImplementationList}
* @nosideeffects
*/
DOMImplementationSource.prototype.getDOMImplementationList = function(features) {};
/**
* @param {string} feature
* @param {string} version
* @return {Object}
* @nosideeffects
*/
DOMImplementation.prototype.getFeature = function(feature, version) {};
/**
* @param {Node} externalNode
* @return {Node}
*/
Document.prototype.adoptNode = function(externalNode) {};
/**
* @type {string}
*/
Document.prototype.documentURI;
/**
* @type {DOMConfiguration}
*/
Document.prototype.domConfig;
/**
* @type {string}
*/
Document.prototype.inputEncoding;
/**
* @type {boolean}
*/
Document.prototype.strictErrorChecking;
/**
* @type {string}
*/
Document.prototype.xmlEncoding;
/**
* @type {boolean}
*/
Document.prototype.xmlStandalone;
/**
* @type {string}
*/
Document.prototype.xmlVersion;
/**
* @return {undefined}
*/
Document.prototype.normalizeDocument = function() {};
/**
* @param {Node} n
* @param {string} namespaceURI
* @param {string} qualifiedName
* @return {Node}
*/
Document.prototype.renameNode = function(n, namespaceURI, qualifiedName) {};
/**
* @type {?string}
*/
Node.prototype.baseURI;
/**
* @type {string}
*/
Node.prototype.localName;
/**
* @type {string}
*/
Node.prototype.namespaceURI;
/**
* @type {string}
*/
Node.prototype.prefix;
/**
* @type {string}
* @implicitCast
*/
Node.prototype.textContent;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_DISCONNECTED = 0x01;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_PRECEDING = 0x02;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_FOLLOWING = 0x04;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_CONTAINS = 0x08;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10;
/**
* @type {number}
*/
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
/**
* @param {Node} other
* @return {number}
* @nosideeffects
*/
Node.prototype.compareDocumentPosition = function(other) {};
/**
* @param {string} feature
* @param {string} version
* @return {Object}
* @nosideeffects
*/
Node.prototype.getFeature = function(feature, version) {};
/**
* @param {string} key
* @return {Object}
* @nosideeffects
*/
Node.prototype.getUserData = function(key) {};
/**
* @return {boolean}
* @nosideeffects
*/
Node.prototype.hasAttributes = function() {};
/**
* @param {string} namespaceURI
* @return {boolean}
* @nosideeffects
*/
Node.prototype.isDefaultNamespace = function(namespaceURI) {};
/**
* @param {Node} arg
* @return {boolean}
* @nosideeffects
*/
Node.prototype.isEqualNode = function(arg) {};
/**
* @param {Node} other
* @return {boolean}
* @nosideeffects
*/
Node.prototype.isSameNode = function(other) {};
/**
* @param {string} feature
* @param {string} version
* @return {boolean}
* @nosideeffects
*/
Node.prototype.isSupported = function(feature, version) {};
/**
* @param {string} prefix
* @return {string}
* @nosideeffects
*/
Node.prototype.lookupNamespaceURI = function(prefix) {};
/**
* @param {string} namespaceURI
* @return {string}
* @nosideeffects
*/
Node.prototype.lookupPrefix = function(namespaceURI) {};
/**
* @return undefined
*/
Node.prototype.normalize = function() {};
/**
* @param {Object} key
* @param {Object} data
* @param {UserDataHandler} handler
* @return {Object}
*/
Node.prototype.setUserData = function(key, data, handler) {};
/**
* @param {string} query
* @return {Node}
* @nosideeffects
*/
Node.prototype.querySelector = function(query) {};
/**
* @param {string} query
* @return {!NodeList}
* @nosideeffects
*/
Node.prototype.querySelectorAll = function(query) {};
/**
* @type {Element}
*/
Attr.prototype.ownerElement;
/**
* @type {boolean}
*/
Attr.prototype.isId;
/**
* @type {TypeInfo}
*/
Attr.prototype.schemaTypeInfo;
/**
* @type {TypeInfo}
*/
Element.prototype.schemaTypeInfo;
/**
* @param {string} namespaceURI
* @param {string} localName
* @return {Attr}
* @nosideeffects
*/
Element.prototype.getAttributeNodeNS = function(namespaceURI, localName) {};
/**
* @param {string} namespaceURI
* @param {string} localName
* @return {string}
* @nosideeffects
*/
Element.prototype.getAttributeNS = function(namespaceURI, localName) {};
/**
* @param {string} namespaceURI
* @param {string} localName
* @return {!NodeList}
* @nosideeffects
*/
Element.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {};
/**
* @param {string} name
* @return {boolean}
* @nosideeffects
*/
Element.prototype.hasAttribute = function(name) {};
/**
* @param {string} namespaceURI
* @param {string} localName
* @return {boolean}
* @nosideeffects
*/
Element.prototype.hasAttributeNS = function(namespaceURI, localName) {};
/**
* @param {string} namespaceURI
* @param {string} localName
* @return {undefined}
*/
Element.prototype.removeAttributeNS = function(namespaceURI, localName) {};
/**
* @param {Attr} newAttr
* @return {Attr}
*/
Element.prototype.setAttributeNodeNS = function(newAttr) {};
/**
* @param {string} namespaceURI
* @param {string} qualifiedName
* @param {string|number|boolean} value Values are converted to strings with
* ToString, so we accept number and boolean since both convert easily to
* strings.
* @return {undefined}
*/
Element.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {};
/**
* @param {string} name
* @param {boolean} isId
* @return {undefined}
*/
Element.prototype.setIdAttribute = function(name, isId) {};
/**
* @param {Attr} idAttr
* @param {boolean} isId
* @return {undefined}
*/
Element.prototype.setIdAttributeNode = function(idAttr, isId) {};
/**
* @param {string} namespaceURI
* @param {string} localName
* @param {boolean} isId
* @return {undefined}
*/
Element.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {};
/**
* @type {string}
*/
Text.prototype.wholeText;
/**
* @param {string} newText
* @return {Text}
*/
Text.prototype.replaceWholeText = function(newText) {};
/**
* @constructor
*/
function TypeInfo() {}
/**
* @type {number}
*/
TypeInfo.prototype.DERIVATION_EXTENSION;
/**
* @type {number}
*/
TypeInfo.prototype.DERIVATION_LIST;
/**
* @type {number}
*/
TypeInfo.prototype.DERIVATION_RESTRICTION;
/**
* @type {number}
*/
TypeInfo.prototype.DERIVATION_UNION;
/**
* @type {string}
*/
TypeInfo.prototype.typeName;
/**
* @type {string}
*/
TypeInfo.prototype.typeNamespace;
/**
* @param {string} typeNamespaceArg
* @param {string} typeNameArg
* @param {number} derivationMethod
* @return {boolean}
* @nosideeffects
*/
TypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {};
/**
* @constructor
*/
function UserDataHandler() {}
/**
* @type {number}
*/
UserDataHandler.prototype.NODE_CLONED = 1;
/**
* @type {number}
*/
UserDataHandler.prototype.NODE_IMPORTED = 2;
/**
* @type {number}
*/
UserDataHandler.prototype.NODE_DELETED = 3;
/**
* @type {number}
*/
UserDataHandler.prototype.NODE_RENAMED = 4;
/**
* @type {number}
*/
UserDataHandler.prototype.NODE_ADOPTED = 5;
/**
* @param {number} operation
* @param {string} key
* @param {*=} opt_data
* @param {?Node=} opt_src
* @param {?Node=} opt_dst
* @return {undefined}
*/
UserDataHandler.prototype.handle = function(operation, key, opt_data,
opt_src, opt_dst) {};
/**
* @constructor
*/
function DOMError() {}
/**
* @type {DOMLocator}
*/
DOMError.prototype.location;
/**
* @type {string}
*/
DOMError.prototype.message;
/**
* @type {Object}
*/
DOMError.prototype.relatedData;
/**
* @type {Object}
*/
DOMError.prototype.relatedException;
/**
* @type {number}
*/
DOMError.SEVERITY_WARNING = 1;
/**
* @type {number}
*/
DOMError.SEVERITY_ERROR = 2;
/**
* @type {number}
*/
DOMError.SEVERITY_FATAL_ERROR = 3;
/**
* @type {number}
*/
DOMError.prototype.severity;
/**
* @type {string}
*/
DOMError.prototype.type;
/**
* @type {string}
*/
DOMError.prototype.name;
/**
* @constructor
*/
function DOMErrorHandler() {}
/**
* @param {DOMError} error
* @return {boolean}
*/
DOMErrorHandler.prototype.handleError = function(error) {};
/**
* @constructor
*/
function DOMLocator() {}
/**
* @type {number}
*/
DOMLocator.prototype.byteOffset;
/**
* @type {number}
*/
DOMLocator.prototype.columnNumber;
/**
* @type {number}
*/
DOMLocator.prototype.lineNumber;
/**
* @type {Node}
*/
DOMLocator.prototype.relatedNode;
/**
* @type {string}
*/
DOMLocator.prototype.uri;
/**
* @type {number}
*/
DOMLocator.prototype.utf16Offset;
/**
* @constructor
*/
function DOMConfiguration() {}
/**
* @type {DOMStringList}
*/
DOMConfiguration.prototype.parameterNames;
/**
* @param {string} name
* @return {boolean}
* @nosideeffects
*/
DOMConfiguration.prototype.canSetParameter = function(name) {};
/**
* @param {string} name
* @return {*}
* @nosideeffects
*/
DOMConfiguration.prototype.getParameter = function(name) {};
/**
* @param {string} name
* @param {*} value
* @return {*}
*/
DOMConfiguration.prototype.setParameter = function(name, value) {};
/**
* @type {string}
*/
DocumentType.prototype.internalSubset;
/**
* @type {string}
*/
DocumentType.prototype.publicId;
/**
* @type {string}
*/
DocumentType.prototype.systemId;
/**
* @type {string}
*/
Entity.prototype.inputEncoding;
/**
* @type {string}
*/
Entity.prototype.xmlEncoding;
/**
* @type {string}
*/
Entity.prototype.xmlVersion;