| 1 | /* |
| 2 | * Copyright 2008 Closure Compiler Authors |
| 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * @fileoverview Definitions for W3C's DOM Level 1 specification. |
| 19 | * The whole file has been fully type annotated. Created from |
| 20 | * http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html |
| 21 | * |
| 22 | * @externs |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * @constructor |
| 27 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-17189187 |
| 28 | */ |
| 29 | function DOMException() {} |
| 30 | |
| 31 | /** |
| 32 | * @type {number} |
| 33 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 34 | */ |
| 35 | DOMException.INDEX_SIZE_ERR = 1; |
| 36 | |
| 37 | /** |
| 38 | * @type {number} |
| 39 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 40 | */ |
| 41 | DOMException.DOMSTRING_SIZE_ERR = 2; |
| 42 | |
| 43 | /** |
| 44 | * @type {number} |
| 45 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 46 | */ |
| 47 | DOMException.HIERARCHY_REQUEST_ERR = 3; |
| 48 | |
| 49 | /** |
| 50 | * @type {number} |
| 51 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 52 | */ |
| 53 | DOMException.WRONG_DOCUMENT_ERR = 4; |
| 54 | |
| 55 | /** |
| 56 | * @type {number} |
| 57 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 58 | */ |
| 59 | DOMException.INVALID_CHARACTER_ERR = 5; |
| 60 | |
| 61 | /** |
| 62 | * @type {number} |
| 63 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 64 | */ |
| 65 | DOMException.NO_DATA_ALLOWED_ERR = 6; |
| 66 | |
| 67 | /** |
| 68 | * @type {number} |
| 69 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 70 | */ |
| 71 | DOMException.NO_MODIFICATION_ALLOWED_ERR = 7; |
| 72 | |
| 73 | /** |
| 74 | * @type {number} |
| 75 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 76 | */ |
| 77 | DOMException.NOT_FOUND_ERR = 8; |
| 78 | |
| 79 | /** |
| 80 | * @type {number} |
| 81 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 82 | */ |
| 83 | DOMException.NOT_SUPPORTED_ERR = 9; |
| 84 | |
| 85 | /** |
| 86 | * @type {number} |
| 87 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 88 | */ |
| 89 | DOMException.INUSE_ATTRIBUTE_ERR = 10; |
| 90 | |
| 91 | /** |
| 92 | * @constructor |
| 93 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-258A00AF |
| 94 | */ |
| 95 | function ExceptionCode() {} |
| 96 | |
| 97 | /** |
| 98 | * @constructor |
| 99 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-102161490 |
| 100 | */ |
| 101 | function DOMImplementation() {} |
| 102 | |
| 103 | /** |
| 104 | * @param {string} feature |
| 105 | * @param {string} version |
| 106 | * @return {boolean} |
| 107 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5CED94D7 |
| 108 | * @nosideeffects |
| 109 | */ |
| 110 | DOMImplementation.prototype.hasFeature = function(feature, version) {}; |
| 111 | |
| 112 | /** |
| 113 | * @constructor |
| 114 | * @implements {EventTarget} |
| 115 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 116 | */ |
| 117 | function Node() {} |
| 118 | |
| 119 | /** @override */ |
| 120 | Node.prototype.addEventListener = function(type, listener, useCapture) {}; |
| 121 | |
| 122 | /** @override */ |
| 123 | Node.prototype.removeEventListener = function(type, listener, useCapture) {}; |
| 124 | |
| 125 | /** @override */ |
| 126 | Node.prototype.dispatchEvent = function(evt) {}; |
| 127 | |
| 128 | /** |
| 129 | * @type {NamedNodeMap} |
| 130 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-attributes |
| 131 | */ |
| 132 | Node.prototype.attributes; |
| 133 | |
| 134 | /** |
| 135 | * @type {!NodeList} |
| 136 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-childNodes |
| 137 | */ |
| 138 | Node.prototype.childNodes; |
| 139 | |
| 140 | /** |
| 141 | * @type {Node?} |
| 142 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-firstChild |
| 143 | */ |
| 144 | Node.prototype.firstChild; |
| 145 | |
| 146 | /** |
| 147 | * @type {Node?} |
| 148 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-lastChild |
| 149 | */ |
| 150 | Node.prototype.lastChild; |
| 151 | |
| 152 | /** |
| 153 | * @type {Node?} |
| 154 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nextSibling |
| 155 | */ |
| 156 | Node.prototype.nextSibling; |
| 157 | |
| 158 | /** |
| 159 | * @type {string} |
| 160 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeName |
| 161 | */ |
| 162 | Node.prototype.nodeName; |
| 163 | |
| 164 | /** |
| 165 | * @type {string} |
| 166 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeValue |
| 167 | */ |
| 168 | Node.prototype.nodeValue; |
| 169 | |
| 170 | /** |
| 171 | * @type {number} |
| 172 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-nodeType |
| 173 | */ |
| 174 | Node.prototype.nodeType; |
| 175 | |
| 176 | /** |
| 177 | * @type {Document} |
| 178 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-ownerDocument |
| 179 | */ |
| 180 | Node.prototype.ownerDocument; |
| 181 | |
| 182 | /** |
| 183 | * @type {Node} |
| 184 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-parentNode |
| 185 | */ |
| 186 | Node.prototype.parentNode; |
| 187 | |
| 188 | /** |
| 189 | * @type {Node?} |
| 190 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-previousSibling |
| 191 | */ |
| 192 | Node.prototype.previousSibling; |
| 193 | |
| 194 | /** |
| 195 | * @param {Node} newChild |
| 196 | * @return {Node} |
| 197 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-appendChild |
| 198 | */ |
| 199 | Node.prototype.appendChild = function(newChild) {}; |
| 200 | |
| 201 | /** |
| 202 | * @param {boolean} deep |
| 203 | * @return {Node} |
| 204 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-cloneNode |
| 205 | * @nosideeffects |
| 206 | */ |
| 207 | Node.prototype.cloneNode = function(deep) {}; |
| 208 | |
| 209 | /** |
| 210 | * @return {boolean} |
| 211 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-hasChildNodes |
| 212 | * @nosideeffects |
| 213 | */ |
| 214 | Node.prototype.hasChildNodes = function() {}; |
| 215 | |
| 216 | /** |
| 217 | * @param {Node} newChild |
| 218 | * @param {Node?} refChild |
| 219 | * @return {Node} |
| 220 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-insertBefore |
| 221 | */ |
| 222 | Node.prototype.insertBefore = function(newChild, refChild) {}; |
| 223 | |
| 224 | /** |
| 225 | * @param {Node} oldChild |
| 226 | * @return {Node} |
| 227 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeChild |
| 228 | */ |
| 229 | Node.prototype.removeChild = function(oldChild) {}; |
| 230 | |
| 231 | /** |
| 232 | * @param {Node} newChild |
| 233 | * @param {Node} oldChild |
| 234 | * @return {Node} |
| 235 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-replaceChild |
| 236 | */ |
| 237 | Node.prototype.replaceChild = function(newChild, oldChild) {}; |
| 238 | |
| 239 | /** |
| 240 | * @type {number} |
| 241 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 242 | */ |
| 243 | Node.ATTRIBUTE_NODE; |
| 244 | |
| 245 | /** |
| 246 | * @type {number} |
| 247 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 248 | */ |
| 249 | Node.CDATA_SECTION_NODE; |
| 250 | |
| 251 | /** |
| 252 | * @type {number} |
| 253 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 254 | */ |
| 255 | Node.COMMENT_NODE; |
| 256 | |
| 257 | /** |
| 258 | * @type {number} |
| 259 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 260 | */ |
| 261 | Node.DOCUMENT_FRAGMENT_NODE; |
| 262 | |
| 263 | /** |
| 264 | * @type {number} |
| 265 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 266 | */ |
| 267 | Node.DOCUMENT_NODE; |
| 268 | |
| 269 | /** |
| 270 | * @type {number} |
| 271 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 272 | */ |
| 273 | Node.DOCUMENT_TYPE_NODE; |
| 274 | |
| 275 | /** |
| 276 | * @type {number} |
| 277 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 278 | */ |
| 279 | Node.ELEMENT_NODE; |
| 280 | |
| 281 | /** |
| 282 | * @type {number} |
| 283 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 284 | */ |
| 285 | Node.ENTITY_NODE; |
| 286 | |
| 287 | /** |
| 288 | * @type {number} |
| 289 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 290 | */ |
| 291 | Node.ENTITY_REFERENCE_NODE; |
| 292 | |
| 293 | /** |
| 294 | * @type {number} |
| 295 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 296 | */ |
| 297 | Node.PROCESSING_INSTRUCTION_NODE; |
| 298 | |
| 299 | /** |
| 300 | * @type {number} |
| 301 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 302 | */ |
| 303 | Node.TEXT_NODE; |
| 304 | |
| 305 | /** |
| 306 | * @type {number} |
| 307 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 308 | */ |
| 309 | Node.XPATH_NAMESPACE_NODE; |
| 310 | |
| 311 | /** |
| 312 | * @type {number} |
| 313 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1950641247 |
| 314 | */ |
| 315 | Node.NOTATION_NODE; |
| 316 | |
| 317 | /** |
| 318 | * @constructor |
| 319 | * @extends {Node} |
| 320 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-B63ED1A3 |
| 321 | */ |
| 322 | function DocumentFragment() {} |
| 323 | |
| 324 | /** |
| 325 | * @constructor |
| 326 | * @extends {Node} |
| 327 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#i-Document |
| 328 | */ |
| 329 | function Document() {} |
| 330 | |
| 331 | /** |
| 332 | * @type {DocumentType} |
| 333 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-doctype |
| 334 | */ |
| 335 | Document.prototype.doctype; |
| 336 | |
| 337 | /** |
| 338 | * @type {!Element} |
| 339 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-documentElement |
| 340 | */ |
| 341 | Document.prototype.documentElement; |
| 342 | |
| 343 | /** |
| 344 | * @type {DOMImplementation} |
| 345 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-implementation |
| 346 | */ |
| 347 | Document.prototype.implementation; |
| 348 | |
| 349 | /** |
| 350 | * @param {string} name |
| 351 | * @return {!Attr} |
| 352 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createAttribute |
| 353 | * @nosideeffects |
| 354 | */ |
| 355 | Document.prototype.createAttribute = function(name) {}; |
| 356 | |
| 357 | /** |
| 358 | * @param {string} data |
| 359 | * @return {!Comment} |
| 360 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createComment |
| 361 | * @nosideeffects |
| 362 | */ |
| 363 | Document.prototype.createComment = function(data) {}; |
| 364 | |
| 365 | /** |
| 366 | * @param {string} data |
| 367 | * @return {!CDATASection} |
| 368 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createCDATASection |
| 369 | * @nosideeffects |
| 370 | */ |
| 371 | Document.prototype.createCDATASection = function(data) {}; |
| 372 | |
| 373 | /** |
| 374 | * @return {!DocumentFragment} |
| 375 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createDocumentFragment |
| 376 | * @nosideeffects |
| 377 | */ |
| 378 | Document.prototype.createDocumentFragment = function() {}; |
| 379 | |
| 380 | /** |
| 381 | * Create a DOM element. Surprisingly, this has side-effects on IE |
| 382 | * (creating and element with a custom tag boots up a sub-system that |
| 383 | * handles custom tags). |
| 384 | * @param {string} tagName |
| 385 | * @return {!Element} |
| 386 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createElement |
| 387 | */ |
| 388 | Document.prototype.createElement = function(tagName) {}; |
| 389 | |
| 390 | /** |
| 391 | * @param {string} name |
| 392 | * @return {!EntityReference} |
| 393 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createEntityReference |
| 394 | * @nosideeffects |
| 395 | */ |
| 396 | Document.prototype.createEntityReference = function(name) {}; |
| 397 | |
| 398 | /** |
| 399 | * @param {string} target |
| 400 | * @param {string} data |
| 401 | * @return {!ProcessingInstruction} |
| 402 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createProcessingInstruction |
| 403 | * @nosideeffects |
| 404 | */ |
| 405 | Document.prototype.createProcessingInstruction = function(target, data) {}; |
| 406 | |
| 407 | /** |
| 408 | * @param {number|string} data |
| 409 | * @return {!Text} |
| 410 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-createTextNode |
| 411 | * @nosideeffects |
| 412 | */ |
| 413 | Document.prototype.createTextNode = function(data) {}; |
| 414 | |
| 415 | /** |
| 416 | * @param {string} tagname |
| 417 | * @return {!NodeList} |
| 418 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-A6C9094 |
| 419 | * @nosideeffects |
| 420 | */ |
| 421 | Document.prototype.getElementsByTagName = function(tagname) {}; |
| 422 | |
| 423 | /** |
| 424 | * @constructor |
| 425 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-536297177 |
| 426 | */ |
| 427 | function NodeList() {} |
| 428 | |
| 429 | /** |
| 430 | * @type {number} |
| 431 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-203510337 |
| 432 | */ |
| 433 | NodeList.prototype.length; |
| 434 | |
| 435 | /** |
| 436 | * @param {number} index |
| 437 | * @return {Node} |
| 438 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-844377136 |
| 439 | */ |
| 440 | NodeList.prototype.item = function(index) {}; |
| 441 | |
| 442 | /** |
| 443 | * @constructor |
| 444 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1780488922 |
| 445 | */ |
| 446 | function NamedNodeMap() {} |
| 447 | |
| 448 | /** |
| 449 | * @type {number} |
| 450 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6D0FB19E |
| 451 | */ |
| 452 | NamedNodeMap.prototype.length; |
| 453 | |
| 454 | /** |
| 455 | * @param {string} name |
| 456 | * @return {Node} |
| 457 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1074577549 |
| 458 | * @nosideeffects |
| 459 | */ |
| 460 | NamedNodeMap.prototype.getNamedItem = function(name) {}; |
| 461 | |
| 462 | /** |
| 463 | * @param {number} index |
| 464 | * @return {Node} |
| 465 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-349467F9 |
| 466 | * @nosideeffects |
| 467 | */ |
| 468 | NamedNodeMap.prototype.item = function(index) {}; |
| 469 | |
| 470 | /** |
| 471 | * @param {string} name |
| 472 | * @return {Node} |
| 473 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D58B193 |
| 474 | */ |
| 475 | NamedNodeMap.prototype.removeNamedItem = function(name) {}; |
| 476 | |
| 477 | /** |
| 478 | * @param {Node} arg |
| 479 | * @return {Node} |
| 480 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1025163788 |
| 481 | */ |
| 482 | NamedNodeMap.prototype.setNamedItem = function(arg) {}; |
| 483 | |
| 484 | /** |
| 485 | * @constructor |
| 486 | * @extends {Node} |
| 487 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-FF21A306 |
| 488 | */ |
| 489 | function CharacterData() {} |
| 490 | |
| 491 | /** |
| 492 | * @type {string} |
| 493 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-72AB8359 |
| 494 | */ |
| 495 | CharacterData.prototype.data; |
| 496 | |
| 497 | /** |
| 498 | * @type {number} |
| 499 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7D61178C |
| 500 | */ |
| 501 | CharacterData.prototype.length; |
| 502 | |
| 503 | /** |
| 504 | * @param {string} arg |
| 505 | * @return {undefined} |
| 506 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-32791A2F |
| 507 | */ |
| 508 | CharacterData.prototype.appendData = function(arg) {}; |
| 509 | |
| 510 | /** |
| 511 | * @param {number} offset |
| 512 | * @param {number} count |
| 513 | * @return {undefined} |
| 514 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-7C603781 |
| 515 | */ |
| 516 | CharacterData.prototype.deleteData = function(offset, count) {}; |
| 517 | |
| 518 | /** |
| 519 | * @param {number} offset |
| 520 | * @param {string} arg |
| 521 | * @return {undefined} |
| 522 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-3EDB695F |
| 523 | */ |
| 524 | CharacterData.prototype.insertData = function(offset, arg) {}; |
| 525 | |
| 526 | /** |
| 527 | * @param {number} offset |
| 528 | * @param {number} count |
| 529 | * @param {string} arg |
| 530 | * @return {undefined} |
| 531 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E5CBA7FB |
| 532 | */ |
| 533 | CharacterData.prototype.replaceData = function(offset, count, arg) {}; |
| 534 | |
| 535 | /** |
| 536 | * @param {number} offset |
| 537 | * @param {number} count |
| 538 | * @return {string} |
| 539 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6531BCCF |
| 540 | * @nosideeffects |
| 541 | */ |
| 542 | CharacterData.prototype.substringData = function(offset, count) {}; |
| 543 | |
| 544 | /** |
| 545 | * @constructor |
| 546 | * @extends {Node} |
| 547 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-637646024 |
| 548 | */ |
| 549 | function Attr() {} |
| 550 | |
| 551 | /** |
| 552 | * @type {string} |
| 553 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1112119403 |
| 554 | */ |
| 555 | Attr.prototype.name; |
| 556 | |
| 557 | /** |
| 558 | * @type {boolean} |
| 559 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-862529273 |
| 560 | */ |
| 561 | Attr.prototype.specified; |
| 562 | |
| 563 | /** |
| 564 | * @type {string} |
| 565 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-221662474 |
| 566 | */ |
| 567 | Attr.prototype.value; |
| 568 | |
| 569 | /** |
| 570 | * @constructor |
| 571 | * @extends {Node} |
| 572 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-745549614 |
| 573 | */ |
| 574 | function Element() {} |
| 575 | |
| 576 | /** |
| 577 | * @type {string} |
| 578 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#attribute-tagName |
| 579 | */ |
| 580 | Element.prototype.tagName; |
| 581 | |
| 582 | /** |
| 583 | * @param {string} name |
| 584 | * @param {number?=} opt_flags |
| 585 | * @return {string} |
| 586 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttribute |
| 587 | * @see http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx |
| 588 | * @nosideeffects |
| 589 | */ |
| 590 | Element.prototype.getAttribute = function(name, opt_flags) {}; |
| 591 | |
| 592 | /** |
| 593 | * @param {string} name |
| 594 | * @return {Attr} |
| 595 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-getAttributeNode |
| 596 | * @nosideeffects |
| 597 | */ |
| 598 | Element.prototype.getAttributeNode = function(name) {}; |
| 599 | |
| 600 | /** |
| 601 | * @param {string} tagname |
| 602 | * @return {!NodeList} |
| 603 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1938918D |
| 604 | * @nosideeffects |
| 605 | */ |
| 606 | Element.prototype.getElementsByTagName = function(tagname) {}; |
| 607 | |
| 608 | /** |
| 609 | * @param {string} name |
| 610 | * @return {undefined} |
| 611 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttribute |
| 612 | */ |
| 613 | Element.prototype.removeAttribute = function(name) {}; |
| 614 | |
| 615 | /** |
| 616 | * @param {Attr} oldAttr |
| 617 | * @return {?Attr} |
| 618 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-removeAttributeNode |
| 619 | */ |
| 620 | Element.prototype.removeAttributeNode = function(oldAttr) {}; |
| 621 | |
| 622 | /** |
| 623 | * @param {string} name |
| 624 | * @param {string|number|boolean} value Values are converted to strings with |
| 625 | * ToString, so we accept number and boolean since both convert easily to |
| 626 | * strings. |
| 627 | * @return {undefined} |
| 628 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttribute |
| 629 | */ |
| 630 | Element.prototype.setAttribute = function(name, value) {}; |
| 631 | |
| 632 | /** |
| 633 | * @param {Attr} newAttr |
| 634 | * @return {?Attr} |
| 635 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#method-setAttributeNode |
| 636 | */ |
| 637 | Element.prototype.setAttributeNode = function(newAttr) {}; |
| 638 | |
| 639 | // Event handlers |
| 640 | // The DOM level 3 spec has a good index of these |
| 641 | // http://www.w3.org/TR/DOM-Level-3-Events/#event-types |
| 642 | |
| 643 | /** @type {?function (Event)} */ Element.prototype.onabort; |
| 644 | /** @type {?function (Event)} */ Element.prototype.onbeforeunload; |
| 645 | /** @type {?function (Event)} */ Element.prototype.onblur; |
| 646 | /** @type {?function (Event)} */ Element.prototype.onchange; |
| 647 | /** @type {?function (Event)} */ Element.prototype.onclick; |
| 648 | /** @type {?function (Event)} */ Element.prototype.oncompositionstart; |
| 649 | /** @type {?function (Event)} */ Element.prototype.oncompositionupdate; |
| 650 | /** @type {?function (Event)} */ Element.prototype.oncompositionend; |
| 651 | /** @type {?function (Event)} */ Element.prototype.oncontextmenu; |
| 652 | /** @type {?function (Event)} */ Element.prototype.oncopy; |
| 653 | /** @type {?function (Event)} */ Element.prototype.oncut; |
| 654 | /** @type {?function (Event)} */ Element.prototype.ondblclick; |
| 655 | /** @type {?function (Event)} */ Element.prototype.onerror; |
| 656 | /** @type {?function (Event)} */ Element.prototype.onfocus; |
| 657 | /** @type {?function (Event)} */ Element.prototype.onfocusin; |
| 658 | /** @type {?function (Event)} */ Element.prototype.onfocusout; |
| 659 | /** @type {?function (Event)} */ Element.prototype.onkeydown; |
| 660 | /** @type {?function (Event)} */ Element.prototype.onkeypress; |
| 661 | /** @type {?function (Event)} */ Element.prototype.onkeyup; |
| 662 | /** @type {?function (Event)} */ Element.prototype.onload; |
| 663 | /** @type {?function (Event)} */ Element.prototype.onunload; |
| 664 | /** @type {?function (Event)} */ Element.prototype.onmousedown; |
| 665 | /** @type {?function (Event)} */ Element.prototype.onmousemove; |
| 666 | /** @type {?function (Event)} */ Element.prototype.onmouseout; |
| 667 | /** @type {?function (Event)} */ Element.prototype.onmouseover; |
| 668 | /** @type {?function (Event)} */ Element.prototype.onmouseup; |
| 669 | /** @type {?function (Event)} */ Element.prototype.onmousewheel; |
| 670 | /** @type {?function (Event)} */ Element.prototype.onpaste; |
| 671 | /** @type {?function (Event)} */ Element.prototype.onreset; |
| 672 | /** @type {?function (Event)} */ Element.prototype.onresize; |
| 673 | /** @type {?function (Event)} */ Element.prototype.onscroll; |
| 674 | /** @type {?function (Event)} */ Element.prototype.onselect; |
| 675 | /** @type {?function (Event=)} */ Element.prototype.onsubmit; |
| 676 | /** @type {?function (Event)} */ Element.prototype.ontextinput; |
| 677 | /** @type {?function (Event)} */ Element.prototype.onwheel; |
| 678 | |
| 679 | /** |
| 680 | * @constructor |
| 681 | * @extends {CharacterData} |
| 682 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1312295772 |
| 683 | */ |
| 684 | function Text() {} |
| 685 | |
| 686 | /** |
| 687 | * @param {number} offset |
| 688 | * @return {Text} |
| 689 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-38853C1D |
| 690 | */ |
| 691 | Text.prototype.splitText = function(offset) {}; |
| 692 | |
| 693 | /** |
| 694 | * @constructor |
| 695 | * @extends {CharacterData} |
| 696 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1728279322 |
| 697 | */ |
| 698 | function Comment() {} |
| 699 | |
| 700 | /** |
| 701 | * @constructor |
| 702 | * @extends {Text} |
| 703 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-667469212 |
| 704 | */ |
| 705 | function CDATASection() {} |
| 706 | |
| 707 | /** |
| 708 | * @constructor |
| 709 | * @extends {Node} |
| 710 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-412266927 |
| 711 | */ |
| 712 | function DocumentType() {} |
| 713 | |
| 714 | /** |
| 715 | * @type {NamedNodeMap} |
| 716 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1788794630 |
| 717 | */ |
| 718 | DocumentType.prototype.entities; |
| 719 | |
| 720 | /** |
| 721 | * @type {string} |
| 722 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1844763134 |
| 723 | */ |
| 724 | DocumentType.prototype.name; |
| 725 | |
| 726 | /** |
| 727 | * @type {NamedNodeMap} |
| 728 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D46829EF |
| 729 | */ |
| 730 | DocumentType.prototype.notations; |
| 731 | |
| 732 | /** |
| 733 | * @constructor |
| 734 | * @extends {Node} |
| 735 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-5431D1B9 |
| 736 | */ |
| 737 | function Notation() {} |
| 738 | |
| 739 | /** |
| 740 | * @type {string} |
| 741 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-54F2B4D0 |
| 742 | */ |
| 743 | Notation.prototype.publicId; |
| 744 | |
| 745 | /** |
| 746 | * @type {string} |
| 747 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-E8AAB1D0 |
| 748 | */ |
| 749 | Notation.prototype.systemId; |
| 750 | |
| 751 | /** |
| 752 | * @constructor |
| 753 | * @extends {Node} |
| 754 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-527DCFF2 |
| 755 | */ |
| 756 | function Entity() {} |
| 757 | |
| 758 | /** |
| 759 | * @type {string} |
| 760 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7303025 |
| 761 | */ |
| 762 | Entity.prototype.publicId; |
| 763 | |
| 764 | /** |
| 765 | * @type {string} |
| 766 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-D7C29F3E |
| 767 | */ |
| 768 | Entity.prototype.systemId; |
| 769 | |
| 770 | /** |
| 771 | * @type {string} |
| 772 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-6ABAEB38 |
| 773 | */ |
| 774 | Entity.prototype.notationName; |
| 775 | |
| 776 | /** |
| 777 | * @constructor |
| 778 | * @extends {Node} |
| 779 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-11C98490 |
| 780 | */ |
| 781 | function EntityReference() {} |
| 782 | |
| 783 | /** |
| 784 | * @constructor |
| 785 | * @extends {Node} |
| 786 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1004215813 |
| 787 | */ |
| 788 | function ProcessingInstruction() {} |
| 789 | |
| 790 | /** |
| 791 | * @type {string} |
| 792 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-837822393 |
| 793 | */ |
| 794 | ProcessingInstruction.prototype.data; |
| 795 | |
| 796 | /** |
| 797 | * @type {string} |
| 798 | * @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html#ID-1478689192 |
| 799 | */ |
| 800 | ProcessingInstruction.prototype.target; |
| 801 | |
| 802 | |
| 803 | /** |
| 804 | * @constructor |
| 805 | * @implements {EventTarget} |
| 806 | */ |
| 807 | function Window() {} |
| 808 | |
| 809 | /** @override */ |
| 810 | Window.prototype.addEventListener = function(type, listener, useCapture) {}; |
| 811 | |
| 812 | /** @override */ |
| 813 | Window.prototype.removeEventListener = function(type, listener, useCapture) {}; |
| 814 | |
| 815 | /** @override */ |
| 816 | Window.prototype.dispatchEvent = function(evt) {}; |
| 817 | |
| 818 | /** @type {?function (Event)} */ Window.prototype.onabort; |
| 819 | /** @type {?function (Event)} */ Window.prototype.onbeforeunload; |
| 820 | /** @type {?function (Event)} */ Window.prototype.onblur; |
| 821 | /** @type {?function (Event)} */ Window.prototype.onchange; |
| 822 | /** @type {?function (Event)} */ Window.prototype.onclick; |
| 823 | /** @type {?function (Event)} */ Window.prototype.onclose; |
| 824 | /** @type {?function (Event)} */ Window.prototype.oncontextmenu; |
| 825 | /** @type {?function (Event)} */ Window.prototype.ondblclick; |
| 826 | /** @type {?function (Event)} */ Window.prototype.ondragdrop; |
| 827 | // onerror has a special signature. |
| 828 | // See https://developer.mozilla.org/en/DOM/window.onerror |
| 829 | // and http://msdn.microsoft.com/en-us/library/cc197053(VS.85).aspx |
| 830 | /** @type {?function (string, string, number)} */ |
| 831 | Window.prototype.onerror; |
| 832 | /** @type {?function (Event)} */ Window.prototype.onfocus; |
| 833 | /** @type {?function (Event)} */ Window.prototype.onhashchange; |
| 834 | /** @type {?function (Event)} */ Window.prototype.onkeydown; |
| 835 | /** @type {?function (Event)} */ Window.prototype.onkeypress; |
| 836 | /** @type {?function (Event)} */ Window.prototype.onkeyup; |
| 837 | /** @type {?function (Event)} */ Window.prototype.onload; |
| 838 | /** @type {?function (Event)} */ Window.prototype.onmousedown; |
| 839 | /** @type {?function (Event)} */ Window.prototype.onmousemove; |
| 840 | /** @type {?function (Event)} */ Window.prototype.onmouseout; |
| 841 | /** @type {?function (Event)} */ Window.prototype.onmouseover; |
| 842 | /** @type {?function (Event)} */ Window.prototype.onmouseup; |
| 843 | /** @type {?function (Event)} */ Window.prototype.onmousewheel; |
| 844 | /** @type {?function (Event)} */ Window.prototype.onpaint; |
| 845 | /** @type {?function (Event)} */ Window.prototype.onpopstate; |
| 846 | /** @type {?function (Event)} */ Window.prototype.onreset; |
| 847 | /** @type {?function (Event)} */ Window.prototype.onresize; |
| 848 | /** @type {?function (Event)} */ Window.prototype.onscroll; |
| 849 | /** @type {?function (Event)} */ Window.prototype.onselect; |
| 850 | /** @type {?function (Event=)} */ Window.prototype.onsubmit; |
| 851 | /** @type {?function (Event)} */ Window.prototype.onunload; |
| 852 | /** @type {?function (Event)} */ Window.prototype.onwheel; |