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 DOM Level 3 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-3-Core/ecma-script-binding.html
25 * @author stevey@google.com (Steve Yegge)
30 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
32 DOMException.prototype.code;
36 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
38 DOMException.VALIDATION_ERR = 16;
42 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF
44 DOMException.TYPE_MISMATCH_ERR = 17;
48 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList
50 function DOMStringList() {}
54 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-length
56 DOMStringList.prototype.length;
61 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-contains
63 DOMStringList.prototype.contains = function(str) {};
66 * @param {number} index
68 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMStringList-item
70 DOMStringList.prototype.item = function(index) {};
74 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList
76 function NameList() {}
80 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-length
82 NameList.prototype.length;
87 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-contains
90 NameList.prototype.contains = function(str) {};
93 * @param {string} namespaceURI
94 * @param {string} name
96 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-containsNS
99 NameList.prototype.containsNS = function(namespaceURI, name) {};
102 * @param {number} index
104 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getName
107 NameList.prototype.getName = function(index) {};
110 * @param {number} index
112 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#NameList-getNamespaceURI
115 NameList.prototype.getNamespaceURI = function(index) {};
119 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList
121 function DOMImplementationList() {}
125 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-length
127 DOMImplementationList.prototype.length;
130 * @param {number} index
131 * @return {DOMImplementation}
132 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationList-item
135 DOMImplementationList.prototype.item = function(index) {};
139 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementationSource
141 function DOMImplementationSource() {}
144 * @param {string} namespaceURI
145 * @param {string} publicId
146 * @param {DocumentType} doctype
148 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument
151 DOMImplementation.prototype.createDocument = function(namespaceURI, publicId, doctype) {};
154 * @param {string} qualifiedName
155 * @param {string} publicId
156 * @param {string} systemId
157 * @return {DocumentType}
158 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocType
161 DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {};
164 * @param {string} features
165 * @return {DOMImplementation}
166 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpl
169 DOMImplementationSource.prototype.getDOMImplementation = function(features) {};
172 * @param {string} features
173 * @return {DOMImplementationList}
174 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-getDOMImpls
177 DOMImplementationSource.prototype.getDOMImplementationList = function(features) {};
180 * @param {string} feature
181 * @param {string} version
183 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMImplementation3-getFeature
186 DOMImplementation.prototype.getFeature = function(feature, version) {};
189 * @param {Node} externalNode
191 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-adoptNode
193 Document.prototype.adoptNode = function(externalNode) {};
197 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-documentURI
199 Document.prototype.documentURI;
202 * @type {DOMConfiguration}
203 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-domConfig
205 Document.prototype.domConfig;
209 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-inputEncoding
211 Document.prototype.inputEncoding;
215 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-strictErrorChecking
217 Document.prototype.strictErrorChecking;
221 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-encoding
223 Document.prototype.xmlEncoding;
227 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-standalone
229 Document.prototype.xmlStandalone;
233 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-version
235 Document.prototype.xmlVersion;
238 * @return {undefined}
239 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-normalizeDocument
241 Document.prototype.normalizeDocument = function() {};
245 * @param {string} namespaceURI
246 * @param {string} qualifiedName
248 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Document3-renameNode
250 Document.prototype.renameNode = function(n, namespaceURI, qualifiedName) {};
254 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI
256 Node.prototype.baseURI;
260 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSLocalN
262 Node.prototype.localName;
266 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSname
268 Node.prototype.namespaceURI;
272 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix
274 Node.prototype.prefix;
279 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent
281 Node.prototype.textContent;
285 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_DISCONNECTED
287 Node.DOCUMENT_POSITION_DISCONNECTED = 0x01;
291 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_PRECEDING
293 Node.DOCUMENT_POSITION_PRECEDING = 0x02;
297 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_FOLLOWING
299 Node.DOCUMENT_POSITION_FOLLOWING = 0x04;
303 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINS
305 Node.DOCUMENT_POSITION_CONTAINS = 0x08;
309 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_CONTAINED_BY
311 Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10;
315 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node-DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
317 Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
320 * @param {Node} other
322 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-compareDocumentPosition
325 Node.prototype.compareDocumentPosition = function(other) {};
328 * @param {string} feature
329 * @param {string} version
331 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getFeature
334 Node.prototype.getFeature = function(feature, version) {};
337 * @param {string} key
339 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-getUserData
342 Node.prototype.getUserData = function(key) {};
346 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeHasAttrs
349 Node.prototype.hasAttributes = function() {};
352 * @param {string} namespaceURI
354 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace
357 Node.prototype.isDefaultNamespace = function(namespaceURI) {};
362 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode
365 Node.prototype.isEqualNode = function(arg) {};
368 * @param {Node} other
370 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isSameNode
373 Node.prototype.isSameNode = function(other) {};
376 * @param {string} feature
377 * @param {string} version
379 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-Node-supports
382 Node.prototype.isSupported = function(feature, version) {};
385 * @param {string} prefix
387 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI
390 Node.prototype.lookupNamespaceURI = function(prefix) {};
393 * @param {string} namespaceURI
395 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
398 Node.prototype.lookupPrefix = function(namespaceURI) {};
402 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-normalize
404 Node.prototype.normalize = function() {};
407 * @param {Object} key
408 * @param {Object} data
409 * @param {UserDataHandler} handler
411 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-setUserData'
413 Node.prototype.setUserData = function(key, data, handler) {};
416 * @param {string} query
418 * @see http://www.w3.org/TR/selectors-api/#queryselector
421 Node.prototype.querySelector = function(query) {};
424 * @param {string} query
425 * @return {!NodeList}
426 * @see http://www.w3.org/TR/selectors-api/#queryselectorall
429 Node.prototype.querySelectorAll = function(query) {};
433 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-ownerElement
435 Attr.prototype.ownerElement;
439 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-isId
445 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-schemaTypeInfo
447 Attr.prototype.schemaTypeInfo;
451 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Element-schemaTypeInfo
453 Element.prototype.schemaTypeInfo;
456 * @param {string} namespaceURI
457 * @param {string} localName
459 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAtNodeNS
462 Element.prototype.getAttributeNodeNS = function(namespaceURI, localName) {};
465 * @param {string} namespaceURI
466 * @param {string} localName
468 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElGetAttrNS
471 Element.prototype.getAttributeNS = function(namespaceURI, localName) {};
474 * @param {string} namespaceURI
475 * @param {string} localName
476 * @return {!NodeList}
477 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-A6C90942
480 Element.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {};
483 * @param {string} name
485 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttr
488 Element.prototype.hasAttribute = function(name) {};
491 * @param {string} namespaceURI
492 * @param {string} localName
494 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElHasAttrNS
497 Element.prototype.hasAttributeNS = function(namespaceURI, localName) {};
500 * @param {string} namespaceURI
501 * @param {string} localName
502 * @return {undefined}
503 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElRemAtNS
505 Element.prototype.removeAttributeNS = function(namespaceURI, localName) {};
508 * @param {Attr} newAttr
510 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAtNodeNS
512 Element.prototype.setAttributeNodeNS = function(newAttr) {};
515 * @param {string} namespaceURI
516 * @param {string} qualifiedName
517 * @param {string|number|boolean} value Values are converted to strings with
518 * ToString, so we accept number and boolean since both convert easily to
520 * @return {undefined}
521 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAttrNS
523 Element.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {};
526 * @param {string} name
527 * @param {boolean} isId
528 * @return {undefined}
529 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttr
531 Element.prototype.setIdAttribute = function(name, isId) {};
534 * @param {Attr} idAttr
535 * @param {boolean} isId
536 * @return {undefined}
537 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNode
539 Element.prototype.setIdAttributeNode = function(idAttr, isId) {};
542 * @param {string} namespaceURI
543 * @param {string} localName
544 * @param {boolean} isId
545 * @return {undefined}
546 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetIdAttrNS
548 Element.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {};
552 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-wholeText
554 Text.prototype.wholeText;
557 * @param {string} newText
559 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Text3-replaceWholeText
561 Text.prototype.replaceWholeText = function(newText) {};
565 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo
567 function TypeInfo() {}
571 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_EXTENSION
573 TypeInfo.prototype.DERIVATION_EXTENSION;
577 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_LIST
579 TypeInfo.prototype.DERIVATION_LIST;
583 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_RESTRICTION
585 TypeInfo.prototype.DERIVATION_RESTRICTION;
589 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-DERIVATION_UNION
591 TypeInfo.prototype.DERIVATION_UNION;
595 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeName
597 TypeInfo.prototype.typeName;
601 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-typeNamespace
603 TypeInfo.prototype.typeNamespace;
606 * @param {string} typeNamespaceArg
607 * @param {string} typeNameArg
608 * @param {number} derivationMethod
610 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
613 TypeInfo.prototype.isDerivedFrom = function(typeNamespaceArg, typeNameArg, derivationMethod) {};
617 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler
619 function UserDataHandler() {}
623 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-CLONED
625 UserDataHandler.prototype.NODE_CLONED = 1;
629 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-IMPORTED
631 UserDataHandler.prototype.NODE_IMPORTED = 2;
635 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-DELETED
637 UserDataHandler.prototype.NODE_DELETED = 3;
641 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-RENAMED
643 UserDataHandler.prototype.NODE_RENAMED = 4;
647 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#UserDataHandler-ADOPTED
649 UserDataHandler.prototype.NODE_ADOPTED = 5;
652 * @param {number} operation
653 * @param {string} key
654 * @param {*=} opt_data
655 * @param {?Node=} opt_src
656 * @param {?Node=} opt_dst
657 * @return {undefined}
658 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-handleUserDataEvent
660 UserDataHandler.prototype.handle = function(operation, key, opt_data,
661 opt_src, opt_dst) {};
665 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMError
667 function DOMError() {}
671 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-location
673 DOMError.prototype.location;
677 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-message
679 DOMError.prototype.message;
683 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedData
685 DOMError.prototype.relatedData;
689 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-relatedException
691 DOMError.prototype.relatedException;
695 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-warning
697 DOMError.SEVERITY_WARNING = 1;
701 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-error
703 DOMError.SEVERITY_ERROR = 2;
707 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity-fatal-error
709 DOMError.SEVERITY_FATAL_ERROR = 3;
713 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-severity
715 DOMError.prototype.severity;
719 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-DOMError-type
721 DOMError.prototype.type;
725 * @see http://www.w3.org/TR/dom/#domerror
727 DOMError.prototype.name;
731 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ERROR-Interfaces-DOMErrorHandler
733 function DOMErrorHandler() {}
736 * @param {DOMError} error
738 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ERRORS-DOMErrorHandler-handleError
740 DOMErrorHandler.prototype.handleError = function(error) {};
744 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Interfaces-DOMLocator
746 function DOMLocator() {}
750 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-byteOffset
752 DOMLocator.prototype.byteOffset;
756 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-column-number
758 DOMLocator.prototype.columnNumber;
762 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-line-number
764 DOMLocator.prototype.lineNumber;
768 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-node
770 DOMLocator.prototype.relatedNode;
774 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-uri
776 DOMLocator.prototype.uri;
780 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMLocator-utf16Offset
782 DOMLocator.prototype.utf16Offset;
786 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration
788 function DOMConfiguration() {}
791 * @type {DOMStringList}
792 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-parameterNames
794 DOMConfiguration.prototype.parameterNames;
797 * @param {string} name
799 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-canSetParameter
802 DOMConfiguration.prototype.canSetParameter = function(name) {};
805 * @param {string} name
807 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-getParameter
810 DOMConfiguration.prototype.getParameter = function(name) {};
813 * @param {string} name
816 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration-property
818 DOMConfiguration.prototype.setParameter = function(name, value) {};
822 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-internalSubset
824 DocumentType.prototype.internalSubset;
828 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-publicId
830 DocumentType.prototype.publicId;
834 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-Core-DocType-systemId
836 DocumentType.prototype.systemId;
840 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-inputEncoding
842 Entity.prototype.inputEncoding;
846 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-encoding
848 Entity.prototype.xmlEncoding;
852 * @see http://www.w3.org/TR/DOM-Level-3-Core/core.html#Entity3-version
854 Entity.prototype.xmlVersion;