html5.js (75429B)
1 /* 2 * Copyright 2008 The 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 * @fileoverview Definitions for all the extensions over the 18 * W3C's DOM3 specification in HTML5. This file depends on 19 * w3c_dom3.js. The whole file has been fully type annotated. 20 * 21 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/index.html 22 * @see http://dev.w3.org/html5/spec/Overview.html 23 * 24 * This also includes Typed Array definitions from 25 * http://www.khronos.org/registry/typedarray/specs/latest/ 26 * 27 * This relies on w3c_event.js being included first. 28 * 29 * @externs 30 */ 31 32 33 /** 34 * Note: In IE, the contains() method only exists on Elements, not Nodes. 35 * Therefore, it is recommended that you use the Conformance framework to 36 * prevent calling this on Nodes which are not Elements. 37 * @see https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect 38 * 39 * @param {Node} n The node to check 40 * @return {boolean} If 'n' is this Node, or is contained within this Node. 41 * @see https://developer.mozilla.org/en-US/docs/Web/API/Node.contains 42 * @nosideeffects 43 */ 44 Node.prototype.contains = function(n) {}; 45 46 47 /** 48 * @constructor 49 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element 50 * @extends {HTMLElement} 51 */ 52 function HTMLCanvasElement() {} 53 54 /** @type {number} */ 55 HTMLCanvasElement.prototype.width; 56 57 /** @type {number} */ 58 HTMLCanvasElement.prototype.height; 59 60 /** 61 * @param {string=} opt_type 62 * @param {...*} var_args 63 * @return {string} 64 * @throws {Error} 65 * @nosideeffects 66 */ 67 HTMLCanvasElement.prototype.toDataURL = function(opt_type, var_args) {}; 68 69 /** 70 * @param {string} contextId 71 * @param {Object=} opt_args 72 * @return {Object} 73 */ 74 HTMLCanvasElement.prototype.getContext = function(contextId, opt_args) {}; 75 76 /** 77 * @constructor 78 * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d 79 */ 80 function CanvasRenderingContext2D() {} 81 82 /** @type {HTMLCanvasElement} */ 83 CanvasRenderingContext2D.prototype.canvas; 84 85 /** 86 * @return {undefined} 87 */ 88 CanvasRenderingContext2D.prototype.save = function() {}; 89 90 /** 91 * @return {undefined} 92 */ 93 CanvasRenderingContext2D.prototype.restore = function() {}; 94 95 /** 96 * @param {number} x 97 * @param {number} y 98 * @return {undefined} 99 */ 100 CanvasRenderingContext2D.prototype.scale = function(x, y) {}; 101 102 /** 103 * @param {number} angle 104 * @return {undefined} 105 */ 106 CanvasRenderingContext2D.prototype.rotate = function(angle) {}; 107 108 /** 109 * @param {number} x 110 * @param {number} y 111 * @return {undefined} 112 */ 113 CanvasRenderingContext2D.prototype.translate = function(x, y) {}; 114 115 /** 116 * @param {number} m11 117 * @param {number} m12 118 * @param {number} m21 119 * @param {number} m22 120 * @param {number} dx 121 * @param {number} dy 122 * @return {undefined} 123 */ 124 CanvasRenderingContext2D.prototype.transform = function( 125 m11, m12, m21, m22, dx, dy) {}; 126 127 /** 128 * @param {number} m11 129 * @param {number} m12 130 * @param {number} m21 131 * @param {number} m22 132 * @param {number} dx 133 * @param {number} dy 134 * @return {undefined} 135 */ 136 CanvasRenderingContext2D.prototype.setTransform = function( 137 m11, m12, m21, m22, dx, dy) {}; 138 139 /** 140 * @param {number} x0 141 * @param {number} y0 142 * @param {number} x1 143 * @param {number} y1 144 * @return {CanvasGradient} 145 * @throws {Error} 146 * @nosideeffects 147 */ 148 CanvasRenderingContext2D.prototype.createLinearGradient = function( 149 x0, y0, x1, y1) {}; 150 151 /** 152 * @param {number} x0 153 * @param {number} y0 154 * @param {number} r0 155 * @param {number} x1 156 * @param {number} y1 157 * @param {number} r1 158 * @return {CanvasGradient} 159 * @throws {Error} 160 * @nosideeffects 161 */ 162 CanvasRenderingContext2D.prototype.createRadialGradient = function( 163 x0, y0, r0, x1, y1, r1) {}; 164 165 /** 166 * @param {HTMLImageElement|HTMLCanvasElement} image 167 * @param {string} repetition 168 * @return {CanvasPattern} 169 * @throws {Error} 170 * @nosideeffects 171 */ 172 CanvasRenderingContext2D.prototype.createPattern = function( 173 image, repetition) {}; 174 175 /** 176 * @param {number} x 177 * @param {number} y 178 * @param {number} w 179 * @param {number} h 180 * @return {undefined} 181 */ 182 CanvasRenderingContext2D.prototype.clearRect = function(x, y, w, h) {}; 183 184 /** 185 * @param {number} x 186 * @param {number} y 187 * @param {number} w 188 * @param {number} h 189 * @return {undefined} 190 */ 191 CanvasRenderingContext2D.prototype.fillRect = function(x, y, w, h) {}; 192 193 /** 194 * @param {number} x 195 * @param {number} y 196 * @param {number} w 197 * @param {number} h 198 * @return {undefined} 199 */ 200 CanvasRenderingContext2D.prototype.strokeRect = function(x, y, w, h) {}; 201 202 /** 203 * @return {undefined} 204 */ 205 CanvasRenderingContext2D.prototype.beginPath = function() {}; 206 207 /** 208 * @return {undefined} 209 */ 210 CanvasRenderingContext2D.prototype.closePath = function() {}; 211 212 /** 213 * @param {number} x 214 * @param {number} y 215 * @return {undefined} 216 */ 217 CanvasRenderingContext2D.prototype.moveTo = function(x, y) {}; 218 219 /** 220 * @param {number} x 221 * @param {number} y 222 * @return {undefined} 223 */ 224 CanvasRenderingContext2D.prototype.lineTo = function(x, y) {}; 225 226 /** 227 * @param {number} cpx 228 * @param {number} cpy 229 * @param {number} x 230 * @param {number} y 231 * @return {undefined} 232 */ 233 CanvasRenderingContext2D.prototype.quadraticCurveTo = function( 234 cpx, cpy, x, y) {}; 235 236 /** 237 * @param {number} cp1x 238 * @param {number} cp1y 239 * @param {number} cp2x 240 * @param {number} cp2y 241 * @param {number} x 242 * @param {number} y 243 * @return {undefined} 244 */ 245 CanvasRenderingContext2D.prototype.bezierCurveTo = function( 246 cp1x, cp1y, cp2x, cp2y, x, y) {}; 247 248 /** 249 * @param {number} x1 250 * @param {number} y1 251 * @param {number} x2 252 * @param {number} y2 253 * @param {number} radius 254 * @return {undefined} 255 */ 256 CanvasRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {}; 257 258 /** 259 * @param {number} x 260 * @param {number} y 261 * @param {number} w 262 * @param {number} h 263 * @return {undefined} 264 */ 265 CanvasRenderingContext2D.prototype.rect = function(x, y, w, h) {}; 266 267 /** 268 * @param {number} x 269 * @param {number} y 270 * @param {number} radius 271 * @param {number} startAngle 272 * @param {number} endAngle 273 * @param {boolean=} opt_anticlockwise 274 * @return {undefined} 275 */ 276 CanvasRenderingContext2D.prototype.arc = function( 277 x, y, radius, startAngle, endAngle, opt_anticlockwise) {}; 278 279 /** 280 * @return {undefined} 281 */ 282 CanvasRenderingContext2D.prototype.fill = function() {}; 283 284 /** 285 * @return {undefined} 286 */ 287 CanvasRenderingContext2D.prototype.stroke = function() {}; 288 289 /** 290 * @return {undefined} 291 */ 292 CanvasRenderingContext2D.prototype.clip = function() {}; 293 294 /** 295 * @param {number} x 296 * @param {number} y 297 * @return {boolean} 298 * @nosideeffects 299 */ 300 CanvasRenderingContext2D.prototype.isPointInPath = function(x, y) {}; 301 302 /** 303 * @param {string} text 304 * @param {number} x 305 * @param {number} y 306 * @param {number=} opt_maxWidth 307 * @return {undefined} 308 */ 309 CanvasRenderingContext2D.prototype.fillText = function( 310 text, x, y, opt_maxWidth) {}; 311 312 /** 313 * @param {string} text 314 * @param {number} x 315 * @param {number} y 316 * @param {number=} opt_maxWidth 317 * @return {undefined} 318 */ 319 CanvasRenderingContext2D.prototype.strokeText = function( 320 text, x, y, opt_maxWidth) {}; 321 322 /** 323 * @param {string} text 324 * @return {TextMetrics} 325 * @nosideeffects 326 */ 327 CanvasRenderingContext2D.prototype.measureText = function(text) {}; 328 329 /** 330 * @param {HTMLImageElement|HTMLCanvasElement|Image|HTMLVideoElement} image 331 * @param {number} dx Destination x coordinate. 332 * @param {number} dy Destination y coordinate. 333 * @param {number=} opt_dw Destination box width. Defaults to the image width. 334 * @param {number=} opt_dh Destination box height. 335 * Defaults to the image height. 336 * @param {number=} opt_sx Source box x coordinate. Used to select a portion of 337 * the source image to draw. Defaults to 0. 338 * @param {number=} opt_sy Source box y coordinate. Used to select a portion of 339 * the source image to draw. Defaults to 0. 340 * @param {number=} opt_sw Source box width. Used to select a portion of 341 * the source image to draw. Defaults to the full image width. 342 * @param {number=} opt_sh Source box height. Used to select a portion of 343 * the source image to draw. Defaults to the full image height. 344 * @return {undefined} 345 */ 346 CanvasRenderingContext2D.prototype.drawImage = function( 347 image, dx, dy, opt_dw, opt_dh, opt_sx, opt_sy, opt_sw, opt_sh) {}; 348 349 /** 350 * @param {number} sw 351 * @param {number} sh 352 * @return {ImageData} 353 * @nosideeffects 354 */ 355 CanvasRenderingContext2D.prototype.createImageData = function(sw, sh) {}; 356 357 /** 358 * @param {number} sx 359 * @param {number} sy 360 * @param {number} sw 361 * @param {number} sh 362 * @return {ImageData} 363 * @throws {Error} 364 * @nosideeffects 365 */ 366 CanvasRenderingContext2D.prototype.getImageData = function(sx, sy, sw, sh) {}; 367 368 /** 369 * @param {ImageData} imagedata 370 * @param {number} dx 371 * @param {number} dy 372 * @param {number=} opt_dirtyX 373 * @param {number=} opt_dirtyY 374 * @param {number=} opt_dirtyWidth 375 * @param {number=} opt_dirtyHeight 376 * @return {undefined} 377 */ 378 CanvasRenderingContext2D.prototype.putImageData = function(imagedata, dx, dy, 379 opt_dirtyX, opt_dirtyY, opt_dirtyWidth, opt_dirtyHeight) {}; 380 381 /** 382 * Note: WebKit only 383 * @param {number|string=} opt_a 384 * @param {number=} opt_b 385 * @param {number=} opt_c 386 * @param {number=} opt_d 387 * @param {number=} opt_e 388 * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html 389 * @return {undefined} 390 */ 391 CanvasRenderingContext2D.prototype.setFillColor; 392 393 /** 394 * Note: WebKit only 395 * @param {number|string=} opt_a 396 * @param {number=} opt_b 397 * @param {number=} opt_c 398 * @param {number=} opt_d 399 * @param {number=} opt_e 400 * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html 401 * @return {undefined} 402 */ 403 CanvasRenderingContext2D.prototype.setStrokeColor; 404 405 /** 406 * @return {Array.<number>} 407 */ 408 CanvasRenderingContext2D.prototype.getLineDash; 409 410 /** 411 * @param {Array.<number>} segments 412 * @return {undefined} 413 */ 414 CanvasRenderingContext2D.prototype.setLineDash; 415 416 /** @type {string} */ 417 CanvasRenderingContext2D.prototype.fillColor; 418 419 /** 420 * @type {string} 421 * @implicitCast 422 */ 423 CanvasRenderingContext2D.prototype.fillStyle; 424 425 /** @type {string} */ 426 CanvasRenderingContext2D.prototype.font; 427 428 /** @type {number} */ 429 CanvasRenderingContext2D.prototype.globalAlpha; 430 431 /** @type {string} */ 432 CanvasRenderingContext2D.prototype.globalCompositeOperation; 433 434 /** @type {number} */ 435 CanvasRenderingContext2D.prototype.lineWidth; 436 437 /** @type {string} */ 438 CanvasRenderingContext2D.prototype.lineCap; 439 440 /** @type {string} */ 441 CanvasRenderingContext2D.prototype.lineJoin; 442 443 /** @type {number} */ 444 CanvasRenderingContext2D.prototype.miterLimit; 445 446 /** @type {number} */ 447 CanvasRenderingContext2D.prototype.shadowBlur; 448 449 /** @type {string} */ 450 CanvasRenderingContext2D.prototype.shadowColor; 451 452 /** @type {number} */ 453 CanvasRenderingContext2D.prototype.shadowOffsetX; 454 455 /** @type {number} */ 456 CanvasRenderingContext2D.prototype.shadowOffsetY; 457 458 /** 459 * @type {string} 460 * @implicitCast 461 */ 462 CanvasRenderingContext2D.prototype.strokeStyle; 463 464 /** @type {string} */ 465 CanvasRenderingContext2D.prototype.strokeColor; 466 467 /** @type {string} */ 468 CanvasRenderingContext2D.prototype.textAlign; 469 470 /** @type {string} */ 471 CanvasRenderingContext2D.prototype.textBaseline; 472 473 /** 474 * @constructor 475 */ 476 function CanvasGradient() {} 477 478 /** 479 * @param {number} offset 480 * @param {string} color 481 * @return {undefined} 482 */ 483 CanvasGradient.prototype.addColorStop = function(offset, color) {}; 484 485 /** 486 * @constructor 487 */ 488 function CanvasPattern() {} 489 490 /** 491 * @constructor 492 */ 493 function TextMetrics() {} 494 495 /** @type {number} */ 496 TextMetrics.prototype.width; 497 498 /** 499 * @constructor 500 */ 501 function ImageData() {} 502 503 /** @type {Uint8ClampedArray} */ 504 ImageData.prototype.data; 505 506 /** @type {number} */ 507 ImageData.prototype.width; 508 509 /** @type {number} */ 510 ImageData.prototype.height; 511 512 /** 513 * @constructor 514 */ 515 function ClientInformation() {} 516 517 /** @type {boolean} */ 518 ClientInformation.prototype.onLine; 519 520 /** 521 * @param {string} protocol 522 * @param {string} uri 523 * @param {string} title 524 * @return {undefined} 525 */ 526 ClientInformation.prototype.registerProtocolHandler = function( 527 protocol, uri, title) {}; 528 529 /** 530 * @param {string} mimeType 531 * @param {string} uri 532 * @param {string} title 533 * @return {undefined} 534 */ 535 ClientInformation.prototype.registerContentHandler = function( 536 mimeType, uri, title) {}; 537 538 // HTML5 Database objects 539 /** 540 * @constructor 541 */ 542 function Database() {} 543 544 /** 545 * @type {string} 546 */ 547 Database.prototype.version; 548 549 /** 550 * @param {function(!SQLTransaction) : void} callback 551 * @param {(function(!SQLError) : void)=} opt_errorCallback 552 * @param {Function=} opt_Callback 553 */ 554 Database.prototype.transaction = function( 555 callback, opt_errorCallback, opt_Callback) {}; 556 557 /** 558 * @param {function(!SQLTransaction) : void} callback 559 * @param {(function(!SQLError) : void)=} opt_errorCallback 560 * @param {Function=} opt_Callback 561 */ 562 Database.prototype.readTransaction = function( 563 callback, opt_errorCallback, opt_Callback) {}; 564 565 /** 566 * @param {string} oldVersion 567 * @param {string} newVersion 568 * @param {function(!SQLTransaction) : void} callback 569 * @param {function(!SQLError) : void} errorCallback 570 * @param {Function} successCallback 571 */ 572 Database.prototype.changeVersion = function( 573 oldVersion, newVersion, callback, errorCallback, successCallback) {}; 574 575 /** 576 * @interface 577 */ 578 function DatabaseCallback() {} 579 580 /** 581 * @param {!Database} db 582 * @return {undefined} 583 */ 584 DatabaseCallback.prototype.handleEvent = function(db) {}; 585 586 /** 587 * @constructor 588 */ 589 function SQLError() {} 590 591 /** 592 * @type {number} 593 */ 594 SQLError.prototype.code; 595 596 /** 597 * @type {string} 598 */ 599 SQLError.prototype.message; 600 601 /** 602 * @constructor 603 */ 604 function SQLTransaction() {} 605 606 /** 607 * @param {string} sqlStatement 608 * @param {Array.<*>=} opt_queryArgs 609 * @param {SQLStatementCallback=} opt_callback 610 * @param {(function(!SQLTransaction, !SQLError) : (boolean|void))=} 611 * opt_errorCallback 612 */ 613 SQLTransaction.prototype.executeSql = function( 614 sqlStatement, opt_queryArgs, opt_callback, opt_errorCallback) {}; 615 616 /** 617 * @typedef {(function(!SQLTransaction, !SQLResultSet) : void)} 618 */ 619 var SQLStatementCallback; 620 621 /** 622 * @constructor 623 */ 624 function SQLResultSet() {} 625 626 /** 627 * @type {number} 628 */ 629 SQLResultSet.prototype.insertId; 630 631 /** 632 * @type {number} 633 */ 634 SQLResultSet.prototype.rowsAffected; 635 636 /** 637 * @type {SQLResultSetRowList} 638 */ 639 SQLResultSet.prototype.rows; 640 641 /** 642 * @constructor 643 */ 644 function SQLResultSetRowList() {} 645 646 /** 647 * @type {number} 648 */ 649 SQLResultSetRowList.prototype.length; 650 651 /** 652 * @param {number} index 653 * @return {Object} 654 * @nosideeffects 655 */ 656 SQLResultSetRowList.prototype.item = function(index) {}; 657 658 /** 659 * @param {string} name 660 * @param {string} version 661 * @param {string} description 662 * @param {number} size 663 * @param {(DatabaseCallback|function(Database))=} opt_callback 664 * @return {Database} 665 */ 666 function openDatabase(name, version, description, size, opt_callback) {} 667 668 /** 669 * @param {string} name 670 * @param {string} version 671 * @param {string} description 672 * @param {number} size 673 * @param {(DatabaseCallback|function(Database))=} opt_callback 674 * @return {Database} 675 */ 676 Window.prototype.openDatabase = 677 function(name, version, description, size, opt_callback) {}; 678 679 /** 680 * @type {boolean} 681 */ 682 HTMLImageElement.prototype.complete; 683 684 /** 685 * @type {string} 686 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-crossorigin 687 */ 688 HTMLImageElement.prototype.crossOrigin; 689 690 /** 691 * This is a superposition of the Window and Worker postMessage methods. 692 * @param {*} message 693 * @param {(string|!Array.<!Transferable>)=} opt_targetOriginOrTransfer 694 * @param {(string|!Array.<!MessagePort>|!Array.<!Transferable>)=} 695 * opt_targetOriginOrPortsOrTransfer 696 * @return {void} 697 */ 698 function postMessage(message, opt_targetOriginOrTransfer, 699 opt_targetOriginOrPortsOrTransfer) {} 700 701 /** 702 * The postMessage method (as implemented in Opera). 703 * @param {string} message 704 */ 705 Document.prototype.postMessage = function(message) {}; 706 707 /** 708 * Document head accessor. 709 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#the-head-element-0 710 * @type {HTMLHeadElement} 711 */ 712 Document.prototype.head; 713 714 /** 715 * @see https://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariJSRef/DOMApplicationCache/DOMApplicationCache.html 716 * @constructor 717 * @implements {EventTarget} 718 */ 719 function DOMApplicationCache() {} 720 721 /** 722 * @param {boolean=} opt_useCapture 723 * @override 724 */ 725 DOMApplicationCache.prototype.addEventListener = function( 726 type, listener, opt_useCapture) {}; 727 728 /** 729 * @param {boolean=} opt_useCapture 730 * @override 731 */ 732 DOMApplicationCache.prototype.removeEventListener = function( 733 type, listener, opt_useCapture) {}; 734 735 /** @override */ 736 DOMApplicationCache.prototype.dispatchEvent = function(evt) {}; 737 738 /** 739 * The object isn't associated with an application cache. This can occur if the 740 * update process fails and there is no previous cache to revert to, or if there 741 * is no manifest file. 742 * @type {number} 743 */ 744 DOMApplicationCache.prototype.UNCACHED = 0; 745 746 /** 747 * The cache is idle. 748 * @type {number} 749 */ 750 DOMApplicationCache.prototype.IDLE = 1; 751 752 /** 753 * The update has started but the resources are not downloaded yet - for 754 * example, this can happen when the manifest file is fetched. 755 * @type {number} 756 */ 757 DOMApplicationCache.prototype.CHECKING = 2; 758 759 /** 760 * The resources are being downloaded into the cache. 761 * @type {number} 762 */ 763 DOMApplicationCache.prototype.DOWNLOADING = 3; 764 765 /** 766 * Resources have finished downloading and the new cache is ready to be used. 767 * @type {number} 768 */ 769 DOMApplicationCache.prototype.UPDATEREADY = 4; 770 771 /** 772 * The cache is obsolete. 773 * @type {number} 774 */ 775 DOMApplicationCache.prototype.OBSOLETE = 5; 776 777 /** 778 * The current status of the application cache. 779 * @type {number} 780 */ 781 DOMApplicationCache.prototype.status; 782 783 /** 784 * Sent when the update process finishes for the first time; that is, the first 785 * time an application cache is saved. 786 * @type {?function(!Event)} 787 */ 788 DOMApplicationCache.prototype.oncached; 789 790 /** 791 * Sent when the cache update process begins. 792 * @type {?function(!Event)} 793 */ 794 DOMApplicationCache.prototype.onchecking; 795 796 /** 797 * Sent when the update process begins downloading resources in the manifest 798 * file. 799 * @type {?function(!Event)} 800 */ 801 DOMApplicationCache.prototype.ondownloading; 802 803 /** 804 * Sent when an error occurs. 805 * @type {?function(!Event)} 806 */ 807 DOMApplicationCache.prototype.onerror; 808 809 /** 810 * Sent when the update process finishes but the manifest file does not change. 811 * @type {?function(!Event)} 812 */ 813 DOMApplicationCache.prototype.onnoupdate; 814 815 /** 816 * Sent when each resource in the manifest file begins to download. 817 * @type {?function(!Event)} 818 */ 819 DOMApplicationCache.prototype.onprogress; 820 821 /** 822 * Sent when there is an existing application cache, the update process 823 * finishes, and there is a new application cache ready for use. 824 * @type {?function(!Event)} 825 */ 826 DOMApplicationCache.prototype.onupdateready; 827 828 /** 829 * Replaces the active cache with the latest version. 830 * @throws {DOMException} 831 */ 832 DOMApplicationCache.prototype.swapCache = function() {}; 833 834 /** 835 * Manually triggers the update process. 836 * @throws {DOMException} 837 */ 838 DOMApplicationCache.prototype.update = function() {}; 839 840 /** @type {DOMApplicationCache} */ 841 var applicationCache; 842 843 /** @type {DOMApplicationCache} */ 844 Window.prototype.applicationCache; 845 846 /** 847 * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers 848 * @param {...string} var_args 849 */ 850 Window.prototype.importScripts = function(var_args) {}; 851 852 /** 853 * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers 854 * @param {...string} var_args 855 */ 856 var importScripts = function(var_args) {}; 857 858 /** 859 * @see http://dev.w3.org/html5/workers/ 860 * @constructor 861 * @implements {EventTarget} 862 */ 863 function WebWorker() {} 864 865 /** 866 * @param {boolean=} opt_useCapture 867 * @override 868 */ 869 WebWorker.prototype.addEventListener = function( 870 type, listener, opt_useCapture) {}; 871 872 /** 873 * @param {boolean=} opt_useCapture 874 * @override 875 */ 876 WebWorker.prototype.removeEventListener = function( 877 type, listener, opt_useCapture) {}; 878 879 /** @override */ 880 WebWorker.prototype.dispatchEvent = function(evt) {}; 881 882 /** 883 * Stops the worker process 884 */ 885 WebWorker.prototype.terminate = function() {}; 886 887 /** 888 * Posts a message to the worker thread. 889 * @param {string} message 890 */ 891 WebWorker.prototype.postMessage = function(message) {}; 892 893 /** 894 * Sent when the worker thread posts a message to its creator. 895 * @type {?function(!MessageEvent.<*>)} 896 */ 897 WebWorker.prototype.onmessage; 898 899 /** 900 * Sent when the worker thread encounters an error. 901 * TODO(tbreisacher): Should this change to function(!ErrorEvent)? 902 * @type {?function(!Event)} 903 */ 904 WebWorker.prototype.onerror; 905 906 /** 907 * @see http://dev.w3.org/html5/workers/ 908 * @constructor 909 * @implements {EventTarget} 910 */ 911 function Worker(opt_arg0) {} 912 913 /** 914 * @param {boolean=} opt_useCapture 915 * @override 916 */ 917 Worker.prototype.addEventListener = function( 918 type, listener, opt_useCapture) {}; 919 920 /** 921 * @param {boolean=} opt_useCapture 922 * @override 923 */ 924 Worker.prototype.removeEventListener = function( 925 type, listener, opt_useCapture) {}; 926 927 /** @override */ 928 Worker.prototype.dispatchEvent = function(evt) {}; 929 930 /** 931 * Stops the worker process 932 */ 933 Worker.prototype.terminate = function() {}; 934 935 /** 936 * Posts a message to the worker thread. 937 * @param {*} message 938 * @param {Array.<!Transferable>=} opt_transfer 939 */ 940 Worker.prototype.postMessage = function(message, opt_transfer) {}; 941 942 /** 943 * Posts a message to the worker thread. 944 * @param {*} message 945 * @param {Array.<!Transferable>=} opt_transfer 946 */ 947 Worker.prototype.webkitPostMessage = function(message, opt_transfer) {}; 948 949 /** 950 * Sent when the worker thread posts a message to its creator. 951 * @type {?function(!MessageEvent.<*>)} 952 */ 953 Worker.prototype.onmessage; 954 955 /** 956 * Sent when the worker thread encounters an error. 957 * TODO(tbreisacher): Should this change to function(!ErrorEvent)? 958 * @type {?function(!Event)} 959 */ 960 Worker.prototype.onerror; 961 962 /** 963 * @see http://dev.w3.org/html5/workers/ 964 * @param {string} scriptURL The URL of the script to run in the SharedWorker. 965 * @param {string=} opt_name A name that can later be used to obtain a 966 * reference to the same SharedWorker. 967 * @constructor 968 * @implements {EventTarget} 969 */ 970 function SharedWorker(scriptURL, opt_name) {} 971 972 /** 973 * @param {boolean=} opt_useCapture 974 * @override 975 */ 976 SharedWorker.prototype.addEventListener = function( 977 type, listener, opt_useCapture) {}; 978 979 /** 980 * @param {boolean=} opt_useCapture 981 * @override 982 */ 983 SharedWorker.prototype.removeEventListener = function( 984 type, listener, opt_useCapture) {}; 985 986 /** @override */ 987 SharedWorker.prototype.dispatchEvent = function(evt) {}; 988 989 /** 990 * @type {!MessagePort} 991 */ 992 SharedWorker.prototype.port; 993 994 /** 995 * Called on network errors for loading the initial script. 996 * TODO(tbreisacher): Should this change to function(!ErrorEvent)? 997 * @type {?function(!Event)} 998 */ 999 SharedWorker.prototype.onerror; 1000 1001 /** 1002 * @see http://dev.w3.org/html5/workers/ 1003 * @interface 1004 */ 1005 function WorkerLocation() {} 1006 1007 /** @type {string} */ 1008 WorkerLocation.prototype.protocol; 1009 1010 /** @type {string} */ 1011 WorkerLocation.prototype.host; 1012 1013 /** @type {string} */ 1014 WorkerLocation.prototype.hostname; 1015 1016 /** @type {string} */ 1017 WorkerLocation.prototype.port; 1018 1019 /** @type {string} */ 1020 WorkerLocation.prototype.pathname; 1021 1022 /** @type {string} */ 1023 WorkerLocation.prototype.search; 1024 1025 /** @type {string} */ 1026 WorkerLocation.prototype.hash; 1027 1028 /** 1029 * @see http://dev.w3.org/html5/workers/ 1030 * @interface 1031 * @extends {EventTarget} 1032 */ 1033 function WorkerGlobalScope() {} 1034 1035 /** @type {WorkerGlobalScope} */ 1036 WorkerGlobalScope.prototype.self; 1037 1038 /** @type {WorkerLocation} */ 1039 WorkerGlobalScope.prototype.location; 1040 1041 /** 1042 * Closes the worker represented by this WorkerGlobalScope. 1043 */ 1044 WorkerGlobalScope.prototype.close = function() {}; 1045 1046 /** 1047 * Sent when the worker encounters an error. 1048 * @type {?function(!Event)} 1049 */ 1050 WorkerGlobalScope.prototype.onerror; 1051 1052 /** 1053 * Sent when the worker goes offline. 1054 * @type {?function(!Event)} 1055 */ 1056 WorkerGlobalScope.prototype.onoffline; 1057 1058 /** 1059 * Sent when the worker goes online. 1060 * @type {?function(!Event)} 1061 */ 1062 WorkerGlobalScope.prototype.ononline; 1063 1064 /** 1065 * @see http://dev.w3.org/html5/workers/ 1066 * @interface 1067 * @extends {WorkerGlobalScope} 1068 */ 1069 function DedicatedWorkerGlobalScope() {} 1070 1071 /** 1072 * Posts a message to creator of this worker. 1073 * @param {*} message 1074 * @param {Array.<!Transferable>=} opt_transfer 1075 */ 1076 DedicatedWorkerGlobalScope.prototype.postMessage = 1077 function(message, opt_transfer) {}; 1078 1079 /** 1080 * Posts a message to creator of this worker. 1081 * @param {*} message 1082 * @param {Array.<!Transferable>=} opt_transfer 1083 */ 1084 DedicatedWorkerGlobalScope.prototype.webkitPostMessage = 1085 function(message, opt_transfer) {}; 1086 1087 /** 1088 * Sent when the creator posts a message to this worker. 1089 * @type {?function(!MessageEvent.<*>)} 1090 */ 1091 DedicatedWorkerGlobalScope.prototype.onmessage; 1092 1093 /** 1094 * @see http://dev.w3.org/html5/workers/ 1095 * @interface 1096 * @extends {WorkerGlobalScope} 1097 */ 1098 function SharedWorkerGlobalScope() {} 1099 1100 /** @type {string} */ 1101 SharedWorkerGlobalScope.prototype.name; 1102 1103 /** 1104 * Sent when a connection to this worker is opened. 1105 * @type {?function(!Event)} 1106 */ 1107 SharedWorkerGlobalScope.prototype.onconnect; 1108 1109 /** @type {Element} */ 1110 HTMLElement.prototype.contextMenu; 1111 1112 /** @type {boolean} */ 1113 HTMLElement.prototype.draggable; 1114 1115 /** 1116 * This is actually a DOMSettableTokenList property. However since that 1117 * interface isn't currently defined and no known browsers implement this 1118 * feature, just define the property for now. 1119 * 1120 * @const 1121 * @type {Object} 1122 */ 1123 HTMLElement.prototype.dropzone; 1124 1125 /** 1126 * @see http://www.w3.org/TR/html5/dom.html#dom-getelementsbyclassname 1127 * @param {string} classNames 1128 * @return {!NodeList} 1129 * @nosideeffects 1130 */ 1131 HTMLElement.prototype.getElementsByClassName = function(classNames) {}; 1132 // NOTE: Document.prototype.getElementsByClassName is in gecko_dom.js 1133 1134 /** @type {boolean} */ 1135 HTMLElement.prototype.hidden; 1136 1137 /** @type {boolean} */ 1138 HTMLElement.prototype.spellcheck; 1139 1140 /** 1141 * @see http://www.w3.org/TR/components-intro/ 1142 * @return {!ShadowRoot} 1143 */ 1144 HTMLElement.prototype.createShadowRoot; 1145 1146 /** 1147 * @see http://www.w3.org/TR/components-intro/ 1148 * @return {!ShadowRoot} 1149 */ 1150 HTMLElement.prototype.webkitCreateShadowRoot; 1151 1152 /** 1153 * @see http://www.w3.org/TR/shadow-dom/ 1154 * @type {ShadowRoot} 1155 */ 1156 HTMLElement.prototype.shadowRoot; 1157 1158 /** 1159 * @see http://www.w3.org/TR/shadow-dom/ 1160 * @return {!NodeList} 1161 */ 1162 HTMLElement.prototype.getDestinationInsertionPoints = function() {}; 1163 1164 /** 1165 * @see http://www.w3.org/TR/components-intro/ 1166 * @type {function()} 1167 */ 1168 HTMLElement.prototype.createdCallback; 1169 1170 /** 1171 * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks 1172 * @type {function()} 1173 */ 1174 HTMLElement.prototype.attachedCallback; 1175 1176 /** 1177 * @see http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks 1178 * @type {function()} 1179 */ 1180 HTMLElement.prototype.detachedCallback; 1181 1182 /** @type {string} */ 1183 HTMLAnchorElement.prototype.hash; 1184 1185 /** @type {string} */ 1186 HTMLAnchorElement.prototype.host; 1187 1188 /** @type {string} */ 1189 HTMLAnchorElement.prototype.hostname; 1190 1191 /** @type {string} */ 1192 HTMLAnchorElement.prototype.pathname; 1193 1194 /** 1195 * The 'ping' attribute is known to be supported in recent versions (as of 1196 * mid-2014) of Chrome, Safari, and Firefox, and is not supported in any 1197 * current version of Internet Explorer. 1198 * 1199 * @type {string} 1200 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing 1201 */ 1202 HTMLAnchorElement.prototype.ping; 1203 1204 /** @type {string} */ 1205 HTMLAnchorElement.prototype.port; 1206 1207 /** @type {string} */ 1208 HTMLAnchorElement.prototype.protocol; 1209 1210 /** @type {string} */ 1211 HTMLAnchorElement.prototype.search; 1212 1213 /** 1214 * @type {string} 1215 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#hyperlink-auditing 1216 */ 1217 HTMLAreaElement.prototype.ping; 1218 1219 /** 1220 * @type {string} 1221 * @see http://www.w3.org/TR/html-markup/iframe.html#iframe.attrs.srcdoc 1222 */ 1223 HTMLIFrameElement.prototype.srcdoc; 1224 1225 /** @type {string} */ 1226 HTMLInputElement.prototype.autocomplete; 1227 1228 /** @type {string} */ 1229 HTMLInputElement.prototype.dirname; 1230 1231 /** @type {FileList} */ 1232 HTMLInputElement.prototype.files; 1233 1234 /** @type {string} */ 1235 HTMLInputElement.prototype.list; 1236 1237 /** @type {string} */ 1238 HTMLInputElement.prototype.max; 1239 1240 /** @type {string} */ 1241 HTMLInputElement.prototype.min; 1242 1243 /** @type {string} */ 1244 HTMLInputElement.prototype.pattern; 1245 1246 /** @type {boolean} */ 1247 HTMLInputElement.prototype.multiple; 1248 1249 /** @type {string} */ 1250 HTMLInputElement.prototype.placeholder; 1251 1252 /** @type {boolean} */ 1253 HTMLInputElement.prototype.required; 1254 1255 /** @type {string} */ 1256 HTMLInputElement.prototype.step; 1257 1258 /** @type {Date} */ 1259 HTMLInputElement.prototype.valueAsDate; 1260 1261 /** @type {number} */ 1262 HTMLInputElement.prototype.valueAsNumber; 1263 1264 /** 1265 * Changes the form control's value by the value given in the step attribute 1266 * multiplied by opt_n. 1267 * @param {number=} opt_n step multiplier. Defaults to 1. 1268 */ 1269 HTMLInputElement.prototype.stepDown = function(opt_n) {}; 1270 1271 /** 1272 * Changes the form control's value by the value given in the step attribute 1273 * multiplied by opt_n. 1274 * @param {number=} opt_n step multiplier. Defaults to 1. 1275 */ 1276 HTMLInputElement.prototype.stepUp = function(opt_n) {}; 1277 1278 1279 1280 /** 1281 * @constructor 1282 * @extends {HTMLElement} 1283 * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement 1284 */ 1285 function HTMLMediaElement() {} 1286 1287 /** 1288 * @type {number} 1289 * @const 1290 */ 1291 HTMLMediaElement.HAVE_NOTHING; // = 0 1292 1293 /** 1294 * @type {number} 1295 * @const 1296 */ 1297 HTMLMediaElement.HAVE_METADATA; // = 1 1298 1299 /** 1300 * @type {number} 1301 * @const 1302 */ 1303 HTMLMediaElement.HAVE_CURRENT_DATA; // = 2 1304 1305 /** 1306 * @type {number} 1307 * @const 1308 */ 1309 HTMLMediaElement.HAVE_FUTURE_DATA; // = 3 1310 1311 /** 1312 * @type {number} 1313 * @const 1314 */ 1315 HTMLMediaElement.HAVE_ENOUGH_DATA; // = 4 1316 1317 /** @type {MediaError} */ 1318 HTMLMediaElement.prototype.error; 1319 1320 /** @type {string} */ 1321 HTMLMediaElement.prototype.src; 1322 1323 /** @type {string} */ 1324 HTMLMediaElement.prototype.currentSrc; 1325 1326 /** @type {number} */ 1327 HTMLMediaElement.prototype.networkState; 1328 1329 /** @type {boolean} */ 1330 HTMLMediaElement.prototype.autobuffer; 1331 1332 /** @type {TimeRanges} */ 1333 HTMLMediaElement.prototype.buffered; 1334 1335 /** 1336 * Loads the media element. 1337 */ 1338 HTMLMediaElement.prototype.load = function() {}; 1339 1340 /** 1341 * @param {string} type Type of the element in question in question. 1342 * @return {string} Whether it can play the type. 1343 * @nosideeffects 1344 */ 1345 HTMLMediaElement.prototype.canPlayType = function(type) {}; 1346 1347 /** 1348 * Callback when the media is buffered and ready to play through. 1349 * @type {function(!Event)} 1350 */ 1351 HTMLMediaElement.prototype.oncanplaythrough; 1352 1353 /** @type {number} */ 1354 HTMLMediaElement.prototype.readyState; 1355 1356 /** @type {boolean} */ 1357 HTMLMediaElement.prototype.seeking; 1358 1359 /** 1360 * The current time, in seconds. 1361 * @type {number} 1362 */ 1363 HTMLMediaElement.prototype.currentTime; 1364 1365 /** 1366 * The absolute timeline offset. 1367 * @return {!Date} 1368 */ 1369 HTMLMediaElement.prototype.getStartDate = function() {}; 1370 1371 /** 1372 * The length of the media in seconds. 1373 * @type {number} 1374 */ 1375 HTMLMediaElement.prototype.duration; 1376 1377 /** @type {boolean} */ 1378 HTMLMediaElement.prototype.paused; 1379 1380 /** @type {number} */ 1381 HTMLMediaElement.prototype.defaultPlaybackRate; 1382 1383 /** @type {number} */ 1384 HTMLMediaElement.prototype.playbackRate; 1385 1386 /** @type {TimeRanges} */ 1387 HTMLMediaElement.prototype.played; 1388 1389 /** @type {TimeRanges} */ 1390 HTMLMediaElement.prototype.seekable; 1391 1392 /** @type {boolean} */ 1393 HTMLMediaElement.prototype.ended; 1394 1395 /** @type {boolean} */ 1396 HTMLMediaElement.prototype.autoplay; 1397 1398 /** @type {boolean} */ 1399 HTMLMediaElement.prototype.loop; 1400 1401 /** 1402 * Starts playing the media. 1403 */ 1404 HTMLMediaElement.prototype.play = function() {}; 1405 1406 /** 1407 * Pauses the media. 1408 */ 1409 HTMLMediaElement.prototype.pause = function() {}; 1410 1411 /** @type {boolean} */ 1412 HTMLMediaElement.prototype.controls; 1413 1414 /** 1415 * The audio volume, from 0.0 (silent) to 1.0 (loudest). 1416 * @type {number} 1417 */ 1418 HTMLMediaElement.prototype.volume; 1419 1420 /** @type {boolean} */ 1421 HTMLMediaElement.prototype.muted; 1422 1423 /** 1424 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-media-addtexttrack 1425 * @param {string} kind Kind of the text track. 1426 * @param {string=} opt_label Label of the text track. 1427 * @param {string=} opt_language Language of the text track. 1428 * @return {TextTrack} TextTrack object added to the media element. 1429 */ 1430 HTMLMediaElement.prototype.addTextTrack = 1431 function(kind, opt_label, opt_language) {}; 1432 1433 /** @type {TextTrackList} */ 1434 HTMLMediaElement.prototype.textTracks; 1435 1436 1437 /** 1438 * @see http://www.w3.org/TR/shadow-dom/ 1439 * @return {!NodeList} 1440 */ 1441 Text.prototype.getDestinationInsertionPoints = function() {}; 1442 1443 1444 /** 1445 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttracklist 1446 * @constructor 1447 */ 1448 function TextTrackList() {} 1449 1450 /** @type {number} */ 1451 TextTrackList.prototype.length; 1452 1453 /** 1454 * @param {string} id 1455 * @return {TextTrack} 1456 */ 1457 TextTrackList.prototype.getTrackById = function(id) {}; 1458 1459 1460 /** 1461 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrack 1462 * @constructor 1463 * @implements {EventTarget} 1464 */ 1465 function TextTrack() {} 1466 1467 /** 1468 * @param {TextTrackCue} cue 1469 */ 1470 TextTrack.prototype.addCue = function(cue) {}; 1471 1472 /** 1473 * @param {TextTrackCue} cue 1474 */ 1475 TextTrack.prototype.removeCue = function(cue) {}; 1476 1477 /** 1478 * @const {TextTrackCueList} 1479 */ 1480 TextTrack.prototype.activeCues; 1481 1482 /** 1483 * @const {TextTrackCueList} 1484 */ 1485 TextTrack.prototype.cues; 1486 1487 /** @override */ 1488 TextTrack.prototype.addEventListener = function(type, listener, useCapture) {}; 1489 1490 /** @override */ 1491 TextTrack.prototype.dispatchEvent = function(evt) {}; 1492 1493 /** @override */ 1494 TextTrack.prototype.removeEventListener = function(type, listener, useCapture) 1495 {}; 1496 1497 1498 1499 /** 1500 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist 1501 * @constructor 1502 */ 1503 function TextTrackCueList() {} 1504 1505 /** @const {number} */ 1506 TextTrackCueList.prototype.length; 1507 1508 /** 1509 * @param {string} id 1510 * @return {TextTrackCue} 1511 */ 1512 TextTrackCueList.prototype.getCueById = function(id) {}; 1513 1514 1515 1516 /** 1517 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcue 1518 * @constructor 1519 * @param {number} startTime 1520 * @param {number} endTime 1521 * @param {string} text 1522 */ 1523 function TextTrackCue(startTime, endTime, text) {} 1524 1525 /** @type {string} */ 1526 TextTrackCue.prototype.id; 1527 1528 /** @type {number} */ 1529 TextTrackCue.prototype.startTime; 1530 1531 /** @type {number} */ 1532 TextTrackCue.prototype.endTime; 1533 1534 /** @type {string} */ 1535 TextTrackCue.prototype.text; 1536 1537 1538 /** 1539 * @see http://dev.w3.org/html5/webvtt/#the-vttcue-interface 1540 * @constructor 1541 * @extends {TextTrackCue} 1542 */ 1543 function VTTCue(startTime, endTime, text) {} 1544 1545 1546 /** 1547 * @constructor 1548 * @extends {HTMLMediaElement} 1549 */ 1550 function HTMLAudioElement() {} 1551 1552 /** 1553 * @constructor 1554 * @extends {HTMLMediaElement} 1555 * The webkit-prefixed attributes are defined in 1556 * https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLVideoElement.idl 1557 */ 1558 function HTMLVideoElement() {} 1559 1560 /** 1561 * Starts displaying the video in full screen mode. 1562 */ 1563 HTMLVideoElement.prototype.webkitEnterFullscreen = function() {}; 1564 1565 /** 1566 * Starts displaying the video in full screen mode. 1567 */ 1568 HTMLVideoElement.prototype.webkitEnterFullScreen = function() {}; 1569 1570 /** 1571 * Stops displaying the video in full screen mode. 1572 */ 1573 HTMLVideoElement.prototype.webkitExitFullscreen = function() {}; 1574 1575 /** 1576 * Stops displaying the video in full screen mode. 1577 */ 1578 HTMLVideoElement.prototype.webkitExitFullScreen = function() {}; 1579 1580 /** @type {string} */ 1581 HTMLVideoElement.prototype.width; 1582 1583 /** @type {string} */ 1584 HTMLVideoElement.prototype.height; 1585 1586 /** @type {number} */ 1587 HTMLVideoElement.prototype.videoWidth; 1588 1589 /** @type {number} */ 1590 HTMLVideoElement.prototype.videoHeight; 1591 1592 /** @type {string} */ 1593 HTMLVideoElement.prototype.poster; 1594 1595 /** @type {boolean} */ 1596 HTMLVideoElement.prototype.webkitSupportsFullscreen; 1597 1598 /** @type {boolean} */ 1599 HTMLVideoElement.prototype.webkitDisplayingFullscreen; 1600 1601 /** @type {number} */ 1602 HTMLVideoElement.prototype.webkitDecodedFrameCount; 1603 1604 /** @type {number} */ 1605 HTMLVideoElement.prototype.webkitDroppedFrameCount; 1606 1607 /** 1608 * @constructor 1609 */ 1610 function MediaError() {} 1611 1612 /** @type {number} */ 1613 MediaError.prototype.code; 1614 1615 // HTML5 MessageChannel 1616 /** 1617 * @see http://dev.w3.org/html5/spec/comms.html#messagechannel 1618 * @constructor 1619 */ 1620 function MessageChannel() {} 1621 1622 /** 1623 * Returns the first port. 1624 * @type {!MessagePort} 1625 */ 1626 MessageChannel.prototype.port1; 1627 1628 /** 1629 * Returns the second port. 1630 * @type {!MessagePort} 1631 */ 1632 MessageChannel.prototype.port2; 1633 1634 // HTML5 MessagePort 1635 /** 1636 * @see http://dev.w3.org/html5/spec/comms.html#messageport 1637 * @constructor 1638 * @implements {EventTarget} 1639 * @implements {Transferable} 1640 */ 1641 function MessagePort() {} 1642 1643 /** 1644 * @param {boolean=} opt_useCapture 1645 * @override 1646 */ 1647 MessagePort.prototype.addEventListener = function( 1648 type, listener, opt_useCapture) {}; 1649 1650 /** 1651 * @param {boolean=} opt_useCapture 1652 * @override 1653 */ 1654 MessagePort.prototype.removeEventListener = function( 1655 type, listener, opt_useCapture) {}; 1656 1657 /** @override */ 1658 MessagePort.prototype.dispatchEvent = function(evt) {}; 1659 1660 1661 /** 1662 * Posts a message through the channel, optionally with the given 1663 * Array of Transferables. 1664 * @param {*} message 1665 * @param {Array.<!Transferable>=} opt_transfer 1666 */ 1667 MessagePort.prototype.postMessage = function(message, opt_transfer) { 1668 }; 1669 1670 /** 1671 * Begins dispatching messages received on the port. 1672 */ 1673 MessagePort.prototype.start = function() {}; 1674 1675 /** 1676 * Disconnects the port, so that it is no longer active. 1677 */ 1678 MessagePort.prototype.close = function() {}; 1679 1680 /** 1681 * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed 1682 * @type {?function(!MessageEvent.<?>)} 1683 */ 1684 MessagePort.prototype.onmessage; 1685 1686 // HTML5 MessageEvent class 1687 /** 1688 * @see http://dev.w3.org/html5/spec/comms.html#messageevent 1689 * @constructor 1690 * @extends {Event} 1691 * @template T 1692 */ 1693 function MessageEvent() {} 1694 1695 /** 1696 * The data payload of the message. 1697 * @type {T} 1698 */ 1699 MessageEvent.prototype.data; 1700 1701 /** 1702 * The origin of the message, for server-sent events and cross-document 1703 * messaging. 1704 * @type {string} 1705 */ 1706 MessageEvent.prototype.origin; 1707 1708 /** 1709 * The last event ID, for server-sent events. 1710 * @type {string} 1711 */ 1712 MessageEvent.prototype.lastEventId; 1713 1714 /** 1715 * The window that dispatched the event. 1716 * @type {Window} 1717 */ 1718 MessageEvent.prototype.source; 1719 1720 /** 1721 * The Array of MessagePorts sent with the message, for cross-document 1722 * messaging and channel messaging. 1723 * @type {Array.<MessagePort>} 1724 */ 1725 MessageEvent.prototype.ports; 1726 1727 /** 1728 * Initializes the event in a manner analogous to the similarly-named methods in 1729 * the DOM Events interfaces. 1730 * @param {string} typeArg 1731 * @param {boolean} canBubbleArg 1732 * @param {boolean} cancelableArg 1733 * @param {T} dataArg 1734 * @param {string} originArg 1735 * @param {string} lastEventIdArg 1736 * @param {Window} sourceArg 1737 * @param {Array.<MessagePort>} portsArg 1738 */ 1739 MessageEvent.prototype.initMessageEvent = function(typeArg, canBubbleArg, 1740 cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, portsArg) {}; 1741 1742 /** 1743 * Initializes the event in a manner analogous to the similarly-named methods in 1744 * the DOM Events interfaces. 1745 * @param {string} namespaceURI 1746 * @param {string} typeArg 1747 * @param {boolean} canBubbleArg 1748 * @param {boolean} cancelableArg 1749 * @param {T} dataArg 1750 * @param {string} originArg 1751 * @param {string} lastEventIdArg 1752 * @param {Window} sourceArg 1753 * @param {Array.<MessagePort>} portsArg 1754 */ 1755 MessageEvent.prototype.initMessageEventNS = function(namespaceURI, typeArg, 1756 canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, 1757 portsArg) {}; 1758 1759 /** 1760 * HTML5 DataTransfer class. 1761 * 1762 * We say that this extends ClipboardData, because Event.prototype.clipboardData 1763 * is a DataTransfer on WebKit but a ClipboardData on IE. The interfaces are so 1764 * similar that it's easier to merge them. 1765 * 1766 * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html 1767 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html 1768 * @see http://developers.whatwg.org/dnd.html#datatransferitem 1769 * @constructor 1770 * @extends {ClipboardData} 1771 */ 1772 function DataTransfer() {} 1773 1774 /** @type {string} */ 1775 DataTransfer.prototype.dropEffect; 1776 1777 /** @type {string} */ 1778 DataTransfer.prototype.effectAllowed; 1779 1780 /** @type {Array.<string>} */ 1781 DataTransfer.prototype.types; 1782 1783 /** @type {FileList} */ 1784 DataTransfer.prototype.files; 1785 1786 /** 1787 * @param {string=} opt_format Format for which to remove data. 1788 * @override 1789 */ 1790 DataTransfer.prototype.clearData = function(opt_format) {}; 1791 1792 /** 1793 * @param {string} format Format for which to set data. 1794 * @param {string} data Data to add. 1795 * @override 1796 */ 1797 DataTransfer.prototype.setData = function(format, data) {}; 1798 1799 /** 1800 * @param {string} format Format for which to set data. 1801 * @return {string} Data for the given format. 1802 * @override 1803 */ 1804 DataTransfer.prototype.getData = function(format) { return ''; }; 1805 1806 /** 1807 * @param {HTMLElement} img The image to use when dragging. 1808 * @param {number} x Horizontal position of the cursor. 1809 * @param {number} y Vertical position of the cursor. 1810 */ 1811 DataTransfer.prototype.setDragImage = function(img, x, y) {}; 1812 1813 /** 1814 * @param {HTMLElement} elem Element to receive drag result events. 1815 */ 1816 DataTransfer.prototype.addElement = function(elem) {}; 1817 1818 /** 1819 * Addition for accessing clipboard file data that are part of the proposed 1820 * HTML5 spec. 1821 * @type {DataTransfer} 1822 */ 1823 MouseEvent.prototype.dataTransfer; 1824 1825 /** 1826 * @typedef {{ 1827 * bubbles: (boolean|undefined), 1828 * cancelable: (boolean|undefined), 1829 * view: (Window|undefined), 1830 * detail: (number|undefined), 1831 * screenX: (number|undefined), 1832 * screenY: (number|undefined), 1833 * clientX: (number|undefined), 1834 * clientY: (number|undefined), 1835 * ctrlKey: (boolean|undefined), 1836 * shiftKey: (boolean|undefined), 1837 * altKey: (boolean|undefined), 1838 * metaKey: (boolean|undefined), 1839 * button: (number|undefined), 1840 * buttons: (number|undefined), 1841 * relatedTarget: (EventTarget|undefined), 1842 * deltaX: (number|undefined), 1843 * deltaY: (number|undefined), 1844 * deltaZ: (number|undefined), 1845 * deltaMode: (number|undefined) 1846 * }} 1847 */ 1848 var WheelEventInit; 1849 1850 /** 1851 * @param {string} type 1852 * @param {WheelEventInit=} opt_eventInitDict 1853 * @see http://www.w3.org/TR/DOM-Level-3-Events/#interface-WheelEvent 1854 * @constructor 1855 * @extends {MouseEvent} 1856 */ 1857 var WheelEvent = function(type, opt_eventInitDict) {}; 1858 1859 /** @const {number} */ 1860 WheelEvent.prototype.deltaX; 1861 1862 /** @const {number} */ 1863 WheelEvent.prototype.deltaY; 1864 1865 /** @const {number} */ 1866 WheelEvent.prototype.deltaZ; 1867 1868 /** @const {number} */ 1869 WheelEvent.prototype.deltaMode; 1870 1871 /** 1872 * HTML5 DataTransferItem class. 1873 * 1874 * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html 1875 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html 1876 * @see http://developers.whatwg.org/dnd.html#datatransferitem 1877 * @constructor 1878 */ 1879 var DataTransferItem = function() {}; 1880 1881 /** @type {string} */ 1882 DataTransferItem.prototype.kind; 1883 1884 /** @type {string} */ 1885 DataTransferItem.prototype.type; 1886 1887 /** 1888 * @param {function(string)} callback 1889 * @nosideeffects 1890 */ 1891 DataTransferItem.prototype.getAsString = function(callback) {}; 1892 1893 /** 1894 * @return {?File} The file corresponding to this item, or null. 1895 * @nosideeffects 1896 */ 1897 DataTransferItem.prototype.getAsFile = function() { return null; }; 1898 1899 /** 1900 * @return {?Entry} The Entry corresponding to this item, or null. Note that 1901 * despite its name,this method only works in Chrome, and will eventually 1902 * be renamed to {@code getAsEntry}. 1903 * @nosideeffects 1904 */ 1905 DataTransferItem.prototype.webkitGetAsEntry = function() { return null; }; 1906 1907 /** 1908 * HTML5 DataTransferItemList class. There are some discrepancies in the docs 1909 * on the whatwg.org site. When in doubt, these prototypes match what is 1910 * implemented as of Chrome 30. 1911 * 1912 * @see http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html 1913 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html 1914 * @see http://developers.whatwg.org/dnd.html#datatransferitem 1915 * @constructor 1916 */ 1917 var DataTransferItemList = function() {}; 1918 1919 /** @type {number} */ 1920 DataTransferItemList.prototype.length; 1921 1922 /** 1923 * @param {number} i File to return from the list. 1924 * @return {DataTransferItem} The ith DataTransferItem in the list, or null. 1925 * @nosideeffects 1926 */ 1927 DataTransferItemList.prototype.item = function(i) { return null; }; 1928 1929 /** 1930 * Adds an item to the list. 1931 * @param {string|!File} data Data for the item being added. 1932 * @param {string=} opt_type Mime type of the item being added. MUST be present 1933 * if the {@code data} parameter is a string. 1934 */ 1935 DataTransferItemList.prototype.add = function(data, opt_type) {}; 1936 1937 /** 1938 * Removes an item from the list. 1939 * @param {number} i File to remove from the list. 1940 */ 1941 DataTransferItemList.prototype.remove = function(i) {}; 1942 1943 /** 1944 * Removes all items from the list. 1945 */ 1946 DataTransferItemList.prototype.clear = function() {}; 1947 1948 /** @type {!DataTransferItemList} */ 1949 DataTransfer.prototype.items; 1950 1951 1952 /** 1953 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dragevent-interface 1954 * @constructor 1955 * @extends {MouseEvent} 1956 */ 1957 function DragEvent() {} 1958 1959 /** @type {DataTransfer} */ 1960 DragEvent.prototype.dataTransfer; 1961 1962 1963 /** 1964 * @typedef {{ 1965 * lengthComputable: (boolean|undefined), 1966 * loaded: (number|undefined), 1967 * total: (number|undefined) 1968 * }} 1969 */ 1970 var ProgressEventInit; 1971 1972 /** 1973 * @constructor 1974 * @param {string} type 1975 * @param {ProgressEventInit=} opt_progressEventInitDict 1976 * @extends {Event} 1977 * @see https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent 1978 */ 1979 function ProgressEvent(type, opt_progressEventInitDict) {} 1980 1981 /** @type {number} */ 1982 ProgressEvent.prototype.total; 1983 1984 /** @type {number} */ 1985 ProgressEvent.prototype.loaded; 1986 1987 /** @type {boolean} */ 1988 ProgressEvent.prototype.lengthComputable; 1989 1990 1991 /** 1992 * @constructor 1993 */ 1994 function TimeRanges() {} 1995 1996 /** @type {number} */ 1997 TimeRanges.prototype.length; 1998 1999 /** 2000 * @param {number} index The index. 2001 * @return {number} The start time of the range at index. 2002 * @throws {DOMException} 2003 */ 2004 TimeRanges.prototype.start = function(index) { return 0; }; 2005 2006 /** 2007 * @param {number} index The index. 2008 * @return {number} The end time of the range at index. 2009 * @throws {DOMException} 2010 */ 2011 TimeRanges.prototype.end = function(index) { return 0; }; 2012 2013 2014 // HTML5 Web Socket class 2015 /** 2016 * @see http://dev.w3.org/html5/websockets/ 2017 * @constructor 2018 * @param {string} url 2019 * @param {string=} opt_protocol 2020 * @implements {EventTarget} 2021 */ 2022 function WebSocket(url, opt_protocol) {} 2023 2024 /** 2025 * @param {boolean=} opt_useCapture 2026 * @override 2027 */ 2028 WebSocket.prototype.addEventListener = function( 2029 type, listener, opt_useCapture) {}; 2030 2031 /** 2032 * @param {boolean=} opt_useCapture 2033 * @override 2034 */ 2035 WebSocket.prototype.removeEventListener = function( 2036 type, listener, opt_useCapture) {}; 2037 2038 /** @override */ 2039 WebSocket.prototype.dispatchEvent = function(evt) {}; 2040 2041 /** 2042 * Returns the URL value that was passed to the constructor. 2043 * @type {string} 2044 */ 2045 WebSocket.prototype.URL; 2046 2047 /** 2048 * The connection has not yet been established. 2049 * @type {number} 2050 */ 2051 WebSocket.prototype.CONNECTING = 0; 2052 2053 /** 2054 * The Web Socket connection is established and communication is possible. 2055 * @type {number} 2056 */ 2057 WebSocket.prototype.OPEN = 1; 2058 2059 /** 2060 * The connection has been closed or could not be opened. 2061 * @type {number} 2062 */ 2063 WebSocket.prototype.CLOSED = 2; 2064 2065 /** 2066 * Represents the state of the connection. 2067 * @type {number} 2068 */ 2069 WebSocket.prototype.readyState; 2070 2071 /** 2072 * Returns the number of bytes that have been queued but not yet sent. 2073 * @type {number} 2074 */ 2075 WebSocket.prototype.bufferedAmount; 2076 2077 /** 2078 * An event handler called on open event. 2079 * @type {?function(!Event)} 2080 */ 2081 WebSocket.prototype.onopen; 2082 2083 /** 2084 * An event handler called on message event. 2085 * TODO(blickly): Change this to MessageEvent.<*> and add casts as needed 2086 * @type {?function(!MessageEvent.<?>)} 2087 */ 2088 WebSocket.prototype.onmessage; 2089 2090 /** 2091 * An event handler called on close event. 2092 * @type {?function(!Event)} 2093 */ 2094 WebSocket.prototype.onclose; 2095 2096 /** 2097 * Transmits data using the connection. 2098 * @param {string|ArrayBuffer|ArrayBufferView} data 2099 * @return {boolean} 2100 */ 2101 WebSocket.prototype.send = function(data) {}; 2102 2103 /** 2104 * Closes the Web Socket connection or connection attempt, if any. 2105 */ 2106 WebSocket.prototype.close = function() {}; 2107 2108 /** 2109 * @type {string} Sets the type of data (blob or arraybuffer) for binary data. 2110 */ 2111 WebSocket.prototype.binaryType; 2112 2113 // HTML5 History 2114 /** 2115 * Pushes a new state into the session history. 2116 * @see http://www.w3.org/TR/html5/history.html#the-history-interface 2117 * @param {*} data New state. 2118 * @param {string} title The title for a new session history entry. 2119 * @param {string=} opt_url The URL for a new session history entry. 2120 */ 2121 History.prototype.pushState = function(data, title, opt_url) {}; 2122 2123 /** 2124 * Replaces the current state in the session history. 2125 * @see http://www.w3.org/TR/html5/history.html#the-history-interface 2126 * @param {*} data New state. 2127 * @param {string} title The title for a session history entry. 2128 * @param {string=} opt_url The URL for a new session history entry. 2129 */ 2130 History.prototype.replaceState = function(data, title, opt_url) {}; 2131 2132 /** 2133 * Pending state object. 2134 * @see https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Reading_the_current_state 2135 * @type {*} 2136 */ 2137 History.prototype.state; 2138 2139 /** 2140 * @see http://www.whatwg.org/specs/web-apps/current-work/#popstateevent 2141 * @constructor 2142 * @extends {Event} 2143 * 2144 * @param {string} type 2145 * @param {{state: *}=} opt_eventInitDict 2146 */ 2147 function PopStateEvent(type, opt_eventInitDict) {} 2148 2149 /** 2150 * @type {*} 2151 */ 2152 PopStateEvent.prototype.state; 2153 2154 /** 2155 * Initializes the event after it has been created with document.createEvent 2156 * @param {string} typeArg 2157 * @param {boolean} canBubbleArg 2158 * @param {boolean} cancelableArg 2159 * @param {*} stateArg 2160 */ 2161 PopStateEvent.prototype.initPopStateEvent = function(typeArg, canBubbleArg, 2162 cancelableArg, stateArg) {}; 2163 2164 /** 2165 * @see http://www.whatwg.org/specs/web-apps/current-work/#hashchangeevent 2166 * @constructor 2167 * @extends {Event} 2168 * 2169 * @param {string} type 2170 * @param {{oldURL: string, newURL: string}=} opt_eventInitDict 2171 */ 2172 function HashChangeEvent(type, opt_eventInitDict) {} 2173 2174 /** @type {string} */ 2175 HashChangeEvent.prototype.oldURL; 2176 2177 /** @type {string} */ 2178 HashChangeEvent.prototype.newURL; 2179 2180 /** 2181 * Initializes the event after it has been created with document.createEvent 2182 * @param {string} typeArg 2183 * @param {boolean} canBubbleArg 2184 * @param {boolean} cancelableArg 2185 * @param {string} oldURLArg 2186 * @param {string} newURLArg 2187 */ 2188 HashChangeEvent.prototype.initHashChangeEvent = function(typeArg, canBubbleArg, 2189 cancelableArg, oldURLArg, newURLArg) {}; 2190 2191 /** 2192 * @see http://www.whatwg.org/specs/web-apps/current-work/#pagetransitionevent 2193 * @constructor 2194 * @extends {Event} 2195 * 2196 * @param {string} type 2197 * @param {{persisted: boolean}=} opt_eventInitDict 2198 */ 2199 function PageTransitionEvent(type, opt_eventInitDict) {} 2200 2201 /** @type {boolean} */ 2202 PageTransitionEvent.prototype.persisted; 2203 2204 /** 2205 * Initializes the event after it has been created with document.createEvent 2206 * @param {string} typeArg 2207 * @param {boolean} canBubbleArg 2208 * @param {boolean} cancelableArg 2209 * @param {*} persistedArg 2210 */ 2211 PageTransitionEvent.prototype.initPageTransitionEvent = function(typeArg, 2212 canBubbleArg, cancelableArg, persistedArg) {}; 2213 2214 /** 2215 * @constructor 2216 */ 2217 function FileList() {} 2218 2219 /** @type {number} */ 2220 FileList.prototype.length; 2221 2222 /** 2223 * @param {number} i File to return from the list. 2224 * @return {File} The ith file in the list. 2225 * @nosideeffects 2226 */ 2227 FileList.prototype.item = function(i) { return null; }; 2228 2229 /** 2230 * @type {boolean} 2231 * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#withcredentials 2232 */ 2233 XMLHttpRequest.prototype.withCredentials; 2234 2235 /** 2236 * @type {XMLHttpRequestUpload} 2237 * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-upload-attribute 2238 */ 2239 XMLHttpRequest.prototype.upload; 2240 2241 /** 2242 * @param {string} mimeType The mime type to override with. 2243 */ 2244 XMLHttpRequest.prototype.overrideMimeType = function(mimeType) {}; 2245 2246 /** 2247 * @type {string} 2248 * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute 2249 */ 2250 XMLHttpRequest.prototype.responseType; 2251 2252 /** 2253 * @type {*} 2254 * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute 2255 */ 2256 XMLHttpRequest.prototype.response; 2257 2258 2259 /** 2260 * @type {ArrayBuffer} 2261 * Implemented as a draft spec in Firefox 4 as the way to get a requested array 2262 * buffer from an XMLHttpRequest. 2263 * @see https://developer.mozilla.org/En/Using_XMLHttpRequest#Receiving_binary_data_using_JavaScript_typed_arrays 2264 */ 2265 XMLHttpRequest.prototype.mozResponseArrayBuffer; 2266 2267 /** 2268 * XMLHttpRequestEventTarget defines events for checking the status of a data 2269 * transfer between a client and a server. This should be a common base class 2270 * for XMLHttpRequest and XMLHttpRequestUpload. 2271 * 2272 * @constructor 2273 * @implements {EventTarget} 2274 */ 2275 function XMLHttpRequestEventTarget() {} 2276 2277 /** 2278 * @param {boolean=} opt_useCapture 2279 * @override 2280 */ 2281 XMLHttpRequestEventTarget.prototype.addEventListener = function( 2282 type, listener, opt_useCapture) {}; 2283 2284 /** 2285 * @param {boolean=} opt_useCapture 2286 * @override 2287 */ 2288 XMLHttpRequestEventTarget.prototype.removeEventListener = function( 2289 type, listener, opt_useCapture) {}; 2290 2291 /** @override */ 2292 XMLHttpRequestEventTarget.prototype.dispatchEvent = function(evt) {}; 2293 2294 /** 2295 * An event target to track the status of an upload. 2296 * 2297 * @constructor 2298 * @extends {XMLHttpRequestEventTarget} 2299 */ 2300 function XMLHttpRequestUpload() {} 2301 2302 /** 2303 * @param {number=} opt_width 2304 * @param {number=} opt_height 2305 * @constructor 2306 * @extends {HTMLImageElement} 2307 */ 2308 function Image(opt_width, opt_height) {} 2309 2310 2311 /** 2312 * Dataset collection. 2313 * This is really a DOMStringMap but it behaves close enough to an object to 2314 * pass as an object. 2315 * @type {Object} 2316 * @const 2317 */ 2318 HTMLElement.prototype.dataset; 2319 2320 2321 /** 2322 * @constructor 2323 * @see https://dom.spec.whatwg.org/#interface-domtokenlist 2324 */ 2325 function DOMTokenList() {} 2326 2327 /** 2328 * Returns the number of CSS classes applied to this Element. 2329 * @type {number} 2330 */ 2331 DOMTokenList.prototype.length; 2332 2333 /** 2334 * @param {number} index The index of the item to return. 2335 * @return {string} The CSS class at the specified index. 2336 * @nosideeffects 2337 */ 2338 DOMTokenList.prototype.item = function(index) {}; 2339 2340 /** 2341 * @param {string} token The CSS class to check for. 2342 * @return {boolean} Whether the CSS class has been applied to the Element. 2343 * @nosideeffects 2344 */ 2345 DOMTokenList.prototype.contains = function(token) {}; 2346 2347 /** 2348 * @param {...string} var_args The CSS class(es) to add to this element. 2349 */ 2350 DOMTokenList.prototype.add = function(var_args) {}; 2351 2352 /** 2353 * @param {...string} var_args The CSS class(es) to remove from this element. 2354 */ 2355 DOMTokenList.prototype.remove = function(var_args) {}; 2356 2357 /** 2358 * @param {string} token The CSS class to toggle from this element. 2359 * @param {boolean=} opt_force True to add the class whether it exists 2360 * or not. False to remove the class whether it exists or not. 2361 * This argument is not supported on IE 10 and below, according to 2362 * the MDN page linked below. 2363 * @return {boolean} False if the token was removed; True otherwise. 2364 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element.classList 2365 */ 2366 DOMTokenList.prototype.toggle = function(token, opt_force) {}; 2367 2368 /** 2369 * @return {string} A stringified representation of CSS classes. 2370 * @nosideeffects 2371 * @override 2372 */ 2373 DOMTokenList.prototype.toString = function() {}; 2374 2375 /** 2376 * A better interface to CSS classes than className. 2377 * @type {DOMTokenList} 2378 * @see http://www.w3.org/TR/html5/elements.html#dom-classlist 2379 * @const 2380 */ 2381 HTMLElement.prototype.classList; 2382 2383 /** 2384 * Web Cryptography API 2385 * @see http://www.w3.org/TR/WebCryptoAPI/ 2386 */ 2387 2388 /** @see https://developer.mozilla.org/en/DOM/window.crypto */ 2389 Window.prototype.crypto; 2390 2391 /** 2392 * @see https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues 2393 * @param {!ArrayBufferView} typedArray 2394 * @return {!ArrayBufferView} 2395 * @throws {Error} 2396 */ 2397 Window.prototype.crypto.getRandomValues = function(typedArray) {}; 2398 2399 /** 2400 * Constraint Validation API properties and methods 2401 * @see http://www.w3.org/TR/2009/WD-html5-20090423/forms.html#the-constraint-validation-api 2402 */ 2403 2404 /** @return {boolean} */ 2405 HTMLFormElement.prototype.checkValidity = function() {}; 2406 2407 /** @type {boolean} */ 2408 HTMLFormElement.prototype.noValidate; 2409 2410 /** @constructor */ 2411 function ValidityState() {} 2412 2413 /** @type {boolean} */ 2414 ValidityState.prototype.customError; 2415 2416 /** @type {boolean} */ 2417 ValidityState.prototype.patternMismatch; 2418 2419 /** @type {boolean} */ 2420 ValidityState.prototype.rangeOverflow; 2421 2422 /** @type {boolean} */ 2423 ValidityState.prototype.rangeUnderflow; 2424 2425 /** @type {boolean} */ 2426 ValidityState.prototype.stepMismatch; 2427 2428 /** @type {boolean} */ 2429 ValidityState.prototype.typeMismatch; 2430 2431 /** @type {boolean} */ 2432 ValidityState.prototype.tooLong; 2433 2434 /** @type {boolean} */ 2435 ValidityState.prototype.valid; 2436 2437 /** @type {boolean} */ 2438 ValidityState.prototype.valueMissing; 2439 2440 2441 /** @type {boolean} */ 2442 HTMLButtonElement.prototype.autofocus; 2443 2444 /** 2445 * @const 2446 * @type {NodeList} 2447 */ 2448 HTMLButtonElement.prototype.labels; 2449 2450 /** @type {string} */ 2451 HTMLButtonElement.prototype.validationMessage; 2452 2453 /** 2454 * @const 2455 * @type {ValidityState} 2456 */ 2457 HTMLButtonElement.prototype.validity; 2458 2459 /** @type {boolean} */ 2460 HTMLButtonElement.prototype.willValidate; 2461 2462 /** @return {boolean} */ 2463 HTMLButtonElement.prototype.checkValidity = function() {}; 2464 2465 /** @param {string} message */ 2466 HTMLButtonElement.prototype.setCustomValidity = function(message) {}; 2467 2468 /** 2469 * @type {string} 2470 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction 2471 */ 2472 HTMLButtonElement.prototype.formAction; 2473 2474 /** 2475 * @type {string} 2476 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype 2477 */ 2478 HTMLButtonElement.prototype.formEnctype; 2479 2480 /** 2481 * @type {string} 2482 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod 2483 */ 2484 HTMLButtonElement.prototype.formMethod; 2485 2486 /** 2487 * @type {string} 2488 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget 2489 */ 2490 HTMLButtonElement.prototype.formTarget; 2491 2492 /** @type {boolean} */ 2493 HTMLInputElement.prototype.autofocus; 2494 2495 /** @type {boolean} */ 2496 HTMLInputElement.prototype.formNoValidate; 2497 2498 /** 2499 * @type {string} 2500 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formaction 2501 */ 2502 HTMLInputElement.prototype.formAction; 2503 2504 /** 2505 * @type {string} 2506 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formenctype 2507 */ 2508 HTMLInputElement.prototype.formEnctype; 2509 2510 /** 2511 * @type {string} 2512 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formmethod 2513 */ 2514 HTMLInputElement.prototype.formMethod; 2515 2516 /** 2517 * @type {string} 2518 * @see http://www.w3.org/TR/html5/forms.html#attr-fs-formtarget 2519 */ 2520 HTMLInputElement.prototype.formTarget; 2521 2522 /** 2523 * @const 2524 * @type {NodeList} 2525 */ 2526 HTMLInputElement.prototype.labels; 2527 2528 /** @type {string} */ 2529 HTMLInputElement.prototype.validationMessage; 2530 2531 /** 2532 * @const 2533 * @type {ValidityState} 2534 */ 2535 HTMLInputElement.prototype.validity; 2536 2537 /** @type {boolean} */ 2538 HTMLInputElement.prototype.willValidate; 2539 2540 /** @return {boolean} */ 2541 HTMLInputElement.prototype.checkValidity = function() {}; 2542 2543 /** @param {string} message */ 2544 HTMLInputElement.prototype.setCustomValidity = function(message) {}; 2545 2546 /** @type {Element} */ 2547 HTMLLabelElement.prototype.control; 2548 2549 /** @type {boolean} */ 2550 HTMLSelectElement.prototype.autofocus; 2551 2552 /** 2553 * @const 2554 * @type {NodeList} 2555 */ 2556 HTMLSelectElement.prototype.labels; 2557 2558 /** @type {HTMLCollection} */ 2559 HTMLSelectElement.prototype.selectedOptions; 2560 2561 /** @type {string} */ 2562 HTMLSelectElement.prototype.validationMessage; 2563 2564 /** 2565 * @const 2566 * @type {ValidityState} 2567 */ 2568 HTMLSelectElement.prototype.validity; 2569 2570 /** @type {boolean} */ 2571 HTMLSelectElement.prototype.willValidate; 2572 2573 /** @return {boolean} */ 2574 HTMLSelectElement.prototype.checkValidity = function() {}; 2575 2576 /** @param {string} message */ 2577 HTMLSelectElement.prototype.setCustomValidity = function(message) {}; 2578 2579 /** @type {boolean} */ 2580 HTMLTextAreaElement.prototype.autofocus; 2581 2582 /** 2583 * @const 2584 * @type {NodeList} 2585 */ 2586 HTMLTextAreaElement.prototype.labels; 2587 2588 /** @type {string} */ 2589 HTMLTextAreaElement.prototype.validationMessage; 2590 2591 /** 2592 * @const 2593 * @type {ValidityState} 2594 */ 2595 HTMLTextAreaElement.prototype.validity; 2596 2597 /** @type {boolean} */ 2598 HTMLTextAreaElement.prototype.willValidate; 2599 2600 /** @return {boolean} */ 2601 HTMLTextAreaElement.prototype.checkValidity = function() {}; 2602 2603 /** @param {string} message */ 2604 HTMLTextAreaElement.prototype.setCustomValidity = function(message) {}; 2605 2606 /** 2607 * @constructor 2608 * @extends {HTMLElement} 2609 * @see http://www.w3.org/TR/html5/the-embed-element.html#htmlembedelement 2610 */ 2611 function HTMLEmbedElement() {} 2612 2613 /** 2614 * @type {string} 2615 * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-width 2616 */ 2617 HTMLEmbedElement.prototype.width; 2618 2619 /** 2620 * @type {string} 2621 * @see http://www.w3.org/TR/html5/dimension-attributes.html#dom-dim-height 2622 */ 2623 HTMLEmbedElement.prototype.height; 2624 2625 /** 2626 * @type {string} 2627 * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-src 2628 */ 2629 HTMLEmbedElement.prototype.src; 2630 2631 /** 2632 * @type {string} 2633 * @see http://www.w3.org/TR/html5/the-embed-element.html#dom-embed-type 2634 */ 2635 HTMLEmbedElement.prototype.type; 2636 2637 // Fullscreen APIs. 2638 2639 /** 2640 * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-element-requestfullscreen 2641 */ 2642 Element.prototype.requestFullscreen = function() {}; 2643 2644 /** 2645 * @type {boolean} 2646 * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenenabled 2647 */ 2648 Document.prototype.fullscreenEnabled; 2649 2650 /** 2651 * @type {Element} 2652 * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-fullscreenelement 2653 */ 2654 Document.prototype.fullscreenElement; 2655 2656 /** 2657 * @see http://www.w3.org/TR/2012/WD-fullscreen-20120703/#dom-document-exitfullscreen 2658 */ 2659 Document.prototype.exitFullscreen = function() {}; 2660 2661 // Externs definitions of browser current implementations. 2662 // Firefox 10 implementation. 2663 Element.prototype.mozRequestFullScreen = function() {}; 2664 2665 Element.prototype.mozRequestFullScreenWithKeys = function() {}; 2666 2667 /** @type {boolean} */ 2668 Document.prototype.mozFullScreen; 2669 2670 Document.prototype.mozCancelFullScreen = function() {}; 2671 2672 /** @type {Element} */ 2673 Document.prototype.mozFullScreenElement; 2674 2675 /** @type {boolean} */ 2676 Document.prototype.mozFullScreenEnabled; 2677 2678 // Chrome 21 implementation. 2679 /** 2680 * The current fullscreen element for the document is set to this element. 2681 * Valid only for Webkit browsers. 2682 * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired. 2683 * Should use ALLOW_KEYBOARD_INPUT constant. 2684 */ 2685 Element.prototype.webkitRequestFullScreen = function(opt_allowKeyboardInput) {}; 2686 2687 /** 2688 * The current fullscreen element for the document is set to this element. 2689 * Valid only for Webkit browsers. 2690 * @param {number=} opt_allowKeyboardInput Whether keyboard input is desired. 2691 * Should use ALLOW_KEYBOARD_INPUT constant. 2692 */ 2693 Element.prototype.webkitRequestFullscreen = function(opt_allowKeyboardInput) {}; 2694 2695 /** @type {boolean} */ 2696 Document.prototype.webkitIsFullScreen; 2697 2698 Document.prototype.webkitCancelFullScreen = function() {}; 2699 2700 /** @type {Element} */ 2701 Document.prototype.webkitCurrentFullScreenElement; 2702 2703 /** @type {Element} */ 2704 Document.prototype.webkitFullscreenElement; 2705 2706 /** @type {boolean} */ 2707 Document.prototype.webkitFullScreenKeyboardInputAllowed; 2708 2709 // IE 11 implementation. 2710 // http://msdn.microsoft.com/en-us/library/ie/dn265028(v=vs.85).aspx 2711 /** @return {void} */ 2712 Element.prototype.msRequestFullscreen = function() {}; 2713 2714 /** @return {void} */ 2715 Element.prototype.msExitFullscreen = function() {}; 2716 2717 /** @type {boolean} */ 2718 Document.prototype.msFullscreenEnabled; 2719 2720 /** @type {Element} */ 2721 Document.prototype.msFullscreenElement; 2722 2723 /** @type {number} */ 2724 Element.ALLOW_KEYBOARD_INPUT = 1; 2725 2726 /** @type {number} */ 2727 Element.prototype.ALLOW_KEYBOARD_INPUT = 1; 2728 2729 2730 /** @constructor */ 2731 function MutationObserverInit() {} 2732 2733 /** @type {boolean} */ 2734 MutationObserverInit.prototype.childList; 2735 2736 /** @type {boolean} */ 2737 MutationObserverInit.prototype.attributes; 2738 2739 /** @type {boolean} */ 2740 MutationObserverInit.prototype.characterData; 2741 2742 /** @type {boolean} */ 2743 MutationObserverInit.prototype.subtree; 2744 2745 /** @type {boolean} */ 2746 MutationObserverInit.prototype.attributeOldValue; 2747 2748 /** @type {boolean} */ 2749 MutationObserverInit.prototype.characterDataOldValue; 2750 2751 /** @type {Array.<string>} */ 2752 MutationObserverInit.prototype.attributeFilter; 2753 2754 2755 /** @constructor */ 2756 function MutationRecord() {} 2757 2758 /** @type {string} */ 2759 MutationRecord.prototype.type; 2760 2761 /** @type {Node} */ 2762 MutationRecord.prototype.target; 2763 2764 /** @type {NodeList} */ 2765 MutationRecord.prototype.addedNodes; 2766 2767 /** @type {NodeList} */ 2768 MutationRecord.prototype.removedNodes; 2769 2770 /** @type {Node} */ 2771 MutationRecord.prototype.previouSibling; 2772 2773 /** @type {Node} */ 2774 MutationRecord.prototype.nextSibling; 2775 2776 /** @type {?string} */ 2777 MutationRecord.prototype.attributeName; 2778 2779 /** @type {?string} */ 2780 MutationRecord.prototype.attributeNamespace; 2781 2782 /** @type {?string} */ 2783 MutationRecord.prototype.oldValue; 2784 2785 2786 /** 2787 * @see http://www.w3.org/TR/domcore/#mutation-observers 2788 * @param {function(Array.<MutationRecord>, MutationObserver)} callback 2789 * @constructor 2790 */ 2791 function MutationObserver(callback) {} 2792 2793 /** 2794 * @param {Node} target 2795 * @param {MutationObserverInit=} options 2796 */ 2797 MutationObserver.prototype.observe = function(target, options) {}; 2798 2799 MutationObserver.prototype.disconnect = function() {}; 2800 2801 /** 2802 * @type {function(new:MutationObserver, function(Array.<MutationRecord>))} 2803 */ 2804 Window.prototype.WebKitMutationObserver; 2805 2806 /** 2807 * @type {function(new:MutationObserver, function(Array.<MutationRecord>))} 2808 */ 2809 Window.prototype.MozMutationObserver; 2810 2811 2812 /** 2813 * @see http://www.w3.org/TR/page-visibility/ 2814 * @type {VisibilityState} 2815 */ 2816 Document.prototype.visibilityState; 2817 2818 /** 2819 * @type {string} 2820 */ 2821 Document.prototype.webkitVisibilityState; 2822 2823 /** 2824 * @type {string} 2825 */ 2826 Document.prototype.msVisibilityState; 2827 2828 /** 2829 * @see http://www.w3.org/TR/page-visibility/ 2830 * @type {boolean} 2831 */ 2832 Document.prototype.hidden; 2833 2834 /** 2835 * @type {boolean} 2836 */ 2837 Document.prototype.webkitHidden; 2838 2839 /** 2840 * @type {boolean} 2841 */ 2842 Document.prototype.msHidden; 2843 2844 /** 2845 * @see http://www.w3.org/TR/components-intro/ 2846 * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register 2847 * @param {string} type 2848 * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options 2849 */ 2850 Document.prototype.registerElement; 2851 2852 /** 2853 * This method is deprecated and should be removed by the end of 2014. 2854 * @see http://www.w3.org/TR/components-intro/ 2855 * @see http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register 2856 * @param {string} type 2857 * @param {{extends: (string|undefined), prototype: (Object|undefined)}} options 2858 */ 2859 Document.prototype.register; 2860 2861 /** 2862 * @type {!FontFaceSet} 2863 * @see http://dev.w3.org/csswg/css-font-loading/#dom-fontfacesource-fonts 2864 */ 2865 Document.prototype.fonts; 2866 2867 2868 /** 2869 * Definition of ShadowRoot interface, 2870 * @see http://www.w3.org/TR/shadow-dom/#api-shadow-root 2871 * @constructor 2872 * @extends {DocumentFragment} 2873 */ 2874 function ShadowRoot() {} 2875 2876 /** 2877 * The host element that a ShadowRoot is attached to. 2878 * Note: this is not yet W3C standard but is undergoing development. 2879 * W3C feature tracking bug: 2880 * https://www.w3.org/Bugs/Public/show_bug.cgi?id=22399 2881 * Draft specification: 2882 * https://dvcs.w3.org/hg/webcomponents/raw-file/6743f1ace623/spec/shadow/index.html#shadow-root-object 2883 * @type {!Element} 2884 */ 2885 ShadowRoot.prototype.host; 2886 2887 /** 2888 * @param {string} id id. 2889 * @return {HTMLElement} 2890 * @nosideeffects 2891 */ 2892 ShadowRoot.prototype.getElementById = function(id) {}; 2893 2894 2895 /** 2896 * @param {string} className 2897 * @return {!NodeList} 2898 * @nosideeffects 2899 */ 2900 ShadowRoot.prototype.getElementsByClassName = function(className) {}; 2901 2902 2903 /** 2904 * @param {string} tagName 2905 * @return {!NodeList} 2906 * @nosideeffects 2907 */ 2908 ShadowRoot.prototype.getElementsByTagName = function(tagName) {}; 2909 2910 2911 /** 2912 * @param {string} namespace 2913 * @param {string} localName 2914 * @return {!NodeList} 2915 * @nosideeffects 2916 */ 2917 ShadowRoot.prototype.getElementsByTagNameNS = function(namespace, localName) {}; 2918 2919 2920 /** 2921 * @return {Selection} 2922 * @nosideeffects 2923 */ 2924 ShadowRoot.prototype.getSelection = function() {}; 2925 2926 2927 /** 2928 * @param {number} x 2929 * @param {number} y 2930 * @return {Element} 2931 * @nosideeffects 2932 */ 2933 ShadowRoot.prototype.elementFromPoint = function(x, y) {}; 2934 2935 2936 /** 2937 * @type {boolean} 2938 */ 2939 ShadowRoot.prototype.applyAuthorStyles; 2940 2941 2942 /** 2943 * @type {boolean} 2944 */ 2945 ShadowRoot.prototype.resetStyleInheritance; 2946 2947 2948 /** 2949 * @type {Element} 2950 */ 2951 ShadowRoot.prototype.activeElement; 2952 2953 2954 /** 2955 * @type {?ShadowRoot} 2956 */ 2957 ShadowRoot.prototype.olderShadowRoot; 2958 2959 2960 /** 2961 * @type {string} 2962 */ 2963 ShadowRoot.prototype.innerHTML; 2964 2965 2966 /** 2967 * @type {!StyleSheetList} 2968 */ 2969 ShadowRoot.prototype.styleSheets; 2970 2971 2972 2973 /** 2974 * @see http://www.w3.org/TR/shadow-dom/#the-content-element 2975 * @constructor 2976 * @extends {HTMLElement} 2977 */ 2978 function HTMLContentElement() {} 2979 2980 /** 2981 * @type {!string} 2982 */ 2983 HTMLContentElement.prototype.select; 2984 2985 /** 2986 * @return {!NodeList} 2987 */ 2988 HTMLContentElement.prototype.getDistributedNodes = function() {}; 2989 2990 2991 /** 2992 * @see http://www.w3.org/TR/shadow-dom/#the-shadow-element 2993 * @constructor 2994 * @extends {HTMLElement} 2995 */ 2996 function HTMLShadowElement() {} 2997 2998 /** 2999 * @return {!NodeList} 3000 */ 3001 HTMLShadowElement.prototype.getDistributedNodes = function() {}; 3002 3003 3004 /** 3005 * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface 3006 * 3007 * @constructor 3008 * @extends {Event} 3009 * 3010 * @param {string} type 3011 * @param {ErrorEventInit=} opt_eventInitDict 3012 */ 3013 function ErrorEvent(type, opt_eventInitDict) {} 3014 3015 /** @const {string} */ 3016 ErrorEvent.prototype.message; 3017 3018 /** @const {string} */ 3019 ErrorEvent.prototype.filename; 3020 3021 /** @const {number} */ 3022 ErrorEvent.prototype.lineno; 3023 3024 /** @const {number} */ 3025 ErrorEvent.prototype.colno; 3026 3027 /** @const {*} */ 3028 ErrorEvent.prototype.error; 3029 3030 3031 /** 3032 * @see http://www.w3.org/TR/html5/webappapis.html#the-errorevent-interface 3033 * 3034 * @typedef {{ 3035 * bubbles: (boolean|undefined), 3036 * cancelable: (boolean|undefined), 3037 * message: string, 3038 * filename: string, 3039 * lineno: number, 3040 * colno: number, 3041 * error: * 3042 * }} 3043 */ 3044 var ErrorEventInit; 3045 3046 3047 /** 3048 * @see http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument 3049 * @param {string=} opt_title A title to give the new HTML document 3050 * @return {!HTMLDocument} 3051 */ 3052 DOMImplementation.prototype.createHTMLDocument = function(opt_title) {}; 3053 3054 3055 3056 /** 3057 * @constructor 3058 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element 3059 * @extends {HTMLElement} 3060 */ 3061 function HTMLPictureElement() {} 3062 3063 /** 3064 * @constructor 3065 * @see https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element 3066 * @extends {HTMLElement} 3067 */ 3068 function HTMLSourceElement() {} 3069 3070 /** @type {string} */ 3071 HTMLSourceElement.prototype.media; 3072 3073 /** @type {string} */ 3074 HTMLSourceElement.prototype.sizes; 3075 3076 /** @type {string} */ 3077 HTMLSourceElement.prototype.src; 3078 3079 /** @type {string} */ 3080 HTMLSourceElement.prototype.srcset; 3081 3082 /** @type {string} */ 3083 HTMLSourceElement.prototype.type; 3084 3085 /** @type {string} */ 3086 HTMLImageElement.prototype.sizes; 3087 3088 /** @type {string} */ 3089 HTMLImageElement.prototype.srcset; 3090 3091 3092 /** 3093 * 4.11 Interactive elements 3094 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html 3095 */ 3096 3097 /** 3098 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-details-element 3099 * @constructor 3100 * @extends {HTMLElement} 3101 */ 3102 function HTMLDetailsElement() {} 3103 3104 /** 3105 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-details-open 3106 * @type {boolean} 3107 */ 3108 HTMLDetailsElement.prototype.open; 3109 3110 3111 // As of 2/20/2015, <summary> has no special web IDL interface nor global 3112 // constructor (i.e. HTMLSummaryElement). 3113 3114 3115 /** 3116 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-type 3117 * @type {string} 3118 */ 3119 HTMLMenuElement.prototype.type; 3120 3121 /** 3122 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menu-label 3123 * @type {string} 3124 */ 3125 HTMLMenuElement.prototype.label; 3126 3127 3128 /** 3129 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-menuitem-element 3130 * @constructor 3131 * @extends {HTMLElement} 3132 */ 3133 function HTMLMenuItemElement() {} 3134 3135 /** 3136 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-type 3137 * @type {string} 3138 */ 3139 HTMLMenuItemElement.prototype.type; 3140 3141 /** 3142 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-label 3143 * @type {string} 3144 */ 3145 HTMLMenuItemElement.prototype.label; 3146 3147 /** 3148 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-icon 3149 * @type {string} 3150 */ 3151 HTMLMenuItemElement.prototype.icon; 3152 3153 /** 3154 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-disabled 3155 * @type {boolean} 3156 */ 3157 HTMLMenuItemElement.prototype.disabled; 3158 3159 /** 3160 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-checked 3161 * @type {boolean} 3162 */ 3163 HTMLMenuItemElement.prototype.checked; 3164 3165 /** 3166 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-radiogroup 3167 * @type {string} 3168 */ 3169 HTMLMenuItemElement.prototype.radiogroup; 3170 3171 /** 3172 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-menuitem-default 3173 * @type {boolean} 3174 */ 3175 HTMLMenuItemElement.prototype.default; 3176 3177 // TODO(dbeam): add HTMLMenuItemElement.prototype.command if it's implemented. 3178 3179 3180 /** 3181 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#relatedevent 3182 * @param {string} type 3183 * @param {{relatedTarget: (EventTarget|undefined)}=} opt_eventInitDict 3184 * @constructor 3185 * @extends {Event} 3186 */ 3187 function RelatedEvent(type, opt_eventInitDict) {} 3188 3189 /** 3190 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-relatedevent-relatedtarget 3191 * @type {EventTarget|undefined} 3192 */ 3193 RelatedEvent.prototype.relatedTarget; 3194 3195 3196 /** 3197 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#the-dialog-element 3198 * @constructor 3199 * @extends {HTMLElement} 3200 */ 3201 function HTMLDialogElement() {} 3202 3203 /** 3204 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-open 3205 * @type {boolean} 3206 */ 3207 HTMLDialogElement.prototype.open; 3208 3209 /** 3210 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-returnvalue 3211 * @type {string} 3212 */ 3213 HTMLDialogElement.prototype.returnValue; 3214 3215 /** 3216 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-show 3217 * @param {(MouseEvent|Element)=} opt_anchor 3218 */ 3219 HTMLDialogElement.prototype.show = function(opt_anchor) {}; 3220 3221 /** 3222 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-showmodal 3223 * @param {(MouseEvent|Element)=} opt_anchor 3224 */ 3225 HTMLDialogElement.prototype.showModal = function(opt_anchor) {}; 3226 3227 /** 3228 * @see http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-close 3229 * @param {string=} opt_returnValue 3230 */ 3231 HTMLDialogElement.prototype.close = function(opt_returnValue) {};