UNPKG

google-closure-compiler

Version:

Check, compile, optimize and compress Javascript with Closure-Compiler

2,011 lines (1,696 loc) • 164 kB
/* * Copyright 2008 The Closure Compiler Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Definitions for all the extensions over the * W3C's DOM3 specification in HTML5. This file depends on * w3c_dom3.js. The whole file has been fully type annotated. * * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/index.html * @see http://dev.w3.org/html5/spec/Overview.html * * This also includes Typed Array definitions from * http://www.khronos.org/registry/typedarray/specs/latest/ * * This relies on w3c_event.js being included first. * * @externs */ /** @type {?HTMLSlotElement} */ Node.prototype.assignedSlot; /** * @type {string} * @see https://dom.spec.whatwg.org/#dom-element-slot */ Element.prototype.slot; /** * Note: In IE, the contains() method only exists on Elements, not Nodes. * Therefore, it is recommended that you use the Conformance framework to * prevent calling this on Nodes which are not Elements. * @see https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect * * @param {Node} n The node to check * @return {boolean} If 'n' is this Node, or is contained within this Node. * @see https://developer.mozilla.org/en-US/docs/Web/API/Node.contains * @nosideeffects */ Node.prototype.contains = function(n) {}; /** @type {boolean} */ Node.prototype.isConnected; /** * @type {boolean} * @see https://html.spec.whatwg.org/multipage/scripting.html#the-script-element */ HTMLScriptElement.prototype.async; /** * @type {string?} * @see https://html.spec.whatwg.org/multipage/scripting.html#the-script-element */ HTMLScriptElement.prototype.crossOrigin; /** * @type {string} * @see https://html.spec.whatwg.org/multipage/scripting.html#the-script-element */ HTMLScriptElement.prototype.integrity; /** * @type {boolean} * @see https://html.spec.whatwg.org/multipage/scripting.html#the-script-element */ HTMLScriptElement.prototype.noModule; /** * @type {string} * @see https://html.spec.whatwg.org/multipage/scripting.html#the-script-element */ HTMLScriptElement.prototype.referrerPolicy; /** * @constructor * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#the-canvas-element * @extends {HTMLElement} */ function HTMLCanvasElement() {} /** @type {number} */ HTMLCanvasElement.prototype.width; /** @type {number} */ HTMLCanvasElement.prototype.height; /** * @see https://www.w3.org/TR/html5/scripting-1.html#dom-canvas-toblob * @param {function(!Blob)} callback * @param {string=} opt_type * @param {...*} var_args * @throws {Error} */ HTMLCanvasElement.prototype.toBlob = function(callback, opt_type, var_args) {}; /** * @param {string=} opt_type * @param {...*} var_args * @return {string} * @throws {Error} */ HTMLCanvasElement.prototype.toDataURL = function(opt_type, var_args) {}; /** * @modifies {this} * @param {string} contextId * @param {Object=} opt_args * @return {Object} */ HTMLCanvasElement.prototype.getContext = function(contextId, opt_args) {}; /** * @see https://www.w3.org/TR/mediacapture-fromelement/ * @param {number=} opt_framerate * @return {!MediaStream} * @throws {Error} */ HTMLCanvasElement.prototype.captureStream = function(opt_framerate) {}; /** * @see https://html.spec.whatwg.org/multipage/canvas.html#dom-canvas-transfercontroltooffscreen * @return {!OffscreenCanvas} * @throws {Error} */ HTMLCanvasElement.prototype.transferControlToOffscreen = function() {}; /** * @constructor * @extends {MediaStreamTrack} * @see https://w3c.github.io/mediacapture-fromelement/#the-canvascapturemediastreamtrack */ function CanvasCaptureMediaStreamTrack() {} /** * The canvas element that this media stream captures. * @type {!HTMLCanvasElement} */ CanvasCaptureMediaStreamTrack.prototype.canvas; /** * Allows applications to manually request that a frame from the canvas be * captured and rendered into the track. * @return {undefined} */ CanvasCaptureMediaStreamTrack.prototype.requestFrame = function() {}; /** * @see https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface * @implements {EventTarget} * @param {number} width * @param {number} height * @nosideeffects * @constructor */ function OffscreenCanvas(width, height) {} /** @override */ OffscreenCanvas.prototype.addEventListener = function( type, listener, opt_options) {}; /** @override */ OffscreenCanvas.prototype.removeEventListener = function( type, listener, opt_options) {}; /** @override */ OffscreenCanvas.prototype.dispatchEvent = function(evt) {}; /** @type {number} */ OffscreenCanvas.prototype.width; /** @type {number} */ OffscreenCanvas.prototype.height; /** * @param {string} contextId * @param {!Object=} opt_options * @modifies {this} * @return {!Object} */ OffscreenCanvas.prototype.getContext = function(contextId, opt_options) {}; /** * @return {!ImageBitmap} */ OffscreenCanvas.prototype.transferToImageBitmap = function() {}; /** * @param {{type: (string|undefined), quality: (number|undefined)}=} opt_options * @return {!Promise<!Blob>} */ OffscreenCanvas.prototype.convertToBlob = function(opt_options) {}; // TODO(tjgq): Find a way to add SVGImageElement to this typedef without making // svg.js part of core. /** * @typedef {HTMLImageElement|HTMLVideoElement|HTMLCanvasElement|ImageBitmap| * OffscreenCanvas} */ var CanvasImageSource; /** * @interface * @see https://www.w3.org/TR/2dcontext/#canvaspathmethods */ function CanvasPathMethods() {} /** * @return {undefined} */ CanvasPathMethods.prototype.closePath = function() {}; /** * @param {number} x * @param {number} y * @return {undefined} */ CanvasPathMethods.prototype.moveTo = function(x, y) {}; /** * @param {number} x * @param {number} y * @return {undefined} */ CanvasPathMethods.prototype.lineTo = function(x, y) {}; /** * @param {number} cpx * @param {number} cpy * @param {number} x * @param {number} y * @return {undefined} */ CanvasPathMethods.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {}; /** * @param {number} cp1x * @param {number} cp1y * @param {number} cp2x * @param {number} cp2y * @param {number} x * @param {number} y * @return {undefined} */ CanvasPathMethods.prototype.bezierCurveTo = function( cp1x, cp1y, cp2x, cp2y, x, y) {}; /** * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} radius * @return {undefined} */ CanvasPathMethods.prototype.arcTo = function(x1, y1, x2, y2, radius) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} */ CanvasPathMethods.prototype.rect = function(x, y, w, h) {}; /** * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii * @return {undefined} */ CanvasPathMethods.prototype.roundRect = function(x, y, w, h, radii) {}; /** * @param {number} x * @param {number} y * @param {number} radius * @param {number} startAngle * @param {number} endAngle * @param {boolean=} opt_anticlockwise * @return {undefined} */ CanvasPathMethods.prototype.arc = function( x, y, radius, startAngle, endAngle, opt_anticlockwise) {}; /** * @constructor * @param {!Path2D|string=} arg * @implements {CanvasPathMethods} * @see https://html.spec.whatwg.org/multipage/scripting.html#path2d-objects */ function Path2D(arg) {} /** * @return {undefined} * @override */ Path2D.prototype.closePath = function() {}; /** * @param {number} x * @param {number} y * @return {undefined} * @override */ Path2D.prototype.moveTo = function(x, y) {}; /** * @param {number} x * @param {number} y * @return {undefined} * @override */ Path2D.prototype.lineTo = function(x, y) {}; /** * @param {number} cpx * @param {number} cpy * @param {number} x * @param {number} y * @return {undefined} * @override */ Path2D.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {}; /** * @param {number} cp1x * @param {number} cp1y * @param {number} cp2x * @param {number} cp2y * @param {number} x * @param {number} y * @return {undefined} * @override */ Path2D.prototype.bezierCurveTo = function(cp1x, cp1y, cp2x, cp2y, x, y) {}; /** * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} radius * @return {undefined} * @override */ Path2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} * @override */ Path2D.prototype.rect = function(x, y, w, h) {}; /** * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii * @return {undefined} * @override */ Path2D.prototype.roundRect = function(x, y, w, h, radii) {}; /** * @param {number} x * @param {number} y * @param {number} radius * @param {number} startAngle * @param {number} endAngle * @param {boolean=} optAnticlockwise * @return {undefined} * @override */ Path2D.prototype.arc = function( x, y, radius, startAngle, endAngle, optAnticlockwise) {}; /** * @param {Path2D} path * @return {undefined} */ Path2D.prototype.addPath = function(path) {}; /** * @interface * @see https://www.w3.org/TR/2dcontext/#canvasdrawingstyles */ function CanvasDrawingStyles() {} /** @type {number} */ CanvasDrawingStyles.prototype.lineWidth; /** @type {string} */ CanvasDrawingStyles.prototype.lineCap; /** @type {string} */ CanvasDrawingStyles.prototype.lineJoin; /** @type {number} */ CanvasDrawingStyles.prototype.miterLimit; /** * @param {Array<number>} segments * @return {undefined} */ CanvasDrawingStyles.prototype.setLineDash = function(segments) {}; /** * @return {!Array<number>} */ CanvasDrawingStyles.prototype.getLineDash = function() {}; /** @type {string} */ CanvasDrawingStyles.prototype.font; /** @type {string} */ CanvasDrawingStyles.prototype.textAlign; /** @type {string} */ CanvasDrawingStyles.prototype.textBaseline; /** @type {string} */ CanvasDrawingStyles.prototype.letterSpacing; /** * @constructor * @see https://html.spec.whatwg.org/multipage/canvas.html#canvasrenderingcontext2dsettings */ function CanvasRenderingContext2DSettings() {} /** * @type {boolean} */ CanvasRenderingContext2DSettings.prototype.alpha; /** * @type {boolean} */ CanvasRenderingContext2DSettings.prototype.desynchronized; /** * @type {string} */ CanvasRenderingContext2DSettings.prototype.colorSpace; /** * @type {boolean} */ CanvasRenderingContext2DSettings.prototype.willReadFrequently; // TODO(dramaix): replace this with @record. /** * @constructor * @abstract * @implements {CanvasDrawingStyles} * @implements {CanvasPathMethods} * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d */ function BaseRenderingContext2D() {} /** @const {!HTMLCanvasElement|!OffscreenCanvas} */ BaseRenderingContext2D.prototype.canvas; /** @return {!CanvasRenderingContext2DSettings} */ BaseRenderingContext2D.prototype.getContextAttributes = function() {}; /** * @return {undefined} */ BaseRenderingContext2D.prototype.save = function() {}; /** * @return {undefined} */ BaseRenderingContext2D.prototype.restore = function() {}; /** * @param {number} x * @param {number} y * @return {undefined} */ BaseRenderingContext2D.prototype.scale = function(x, y) {}; /** * @param {number} angle * @return {undefined} */ BaseRenderingContext2D.prototype.rotate = function(angle) {}; /** * @param {number} x * @param {number} y * @return {undefined} */ BaseRenderingContext2D.prototype.translate = function(x, y) {}; /** * @param {number} m11 * @param {number} m12 * @param {number} m21 * @param {number} m22 * @param {number} dx * @param {number} dy * @return {undefined} */ BaseRenderingContext2D.prototype.transform = function( m11, m12, m21, m22, dx, dy) {}; /** * @see https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-settransform-dev * @param {(number|DOMMatrixReadOnly)} m11OrMatrix * @param {number=} m12 * @param {number=} m21 * @param {number=} m22 * @param {number=} dx * @param {number=} dy * @return {undefined} */ BaseRenderingContext2D.prototype.setTransform = function( m11OrMatrix, m12, m21, m22, dx, dy) {}; /** * @return {undefined} */ BaseRenderingContext2D.prototype.resetTransform = function() {}; /** * @return {!DOMMatrixReadOnly} */ BaseRenderingContext2D.prototype.getTransform = function() {}; /** * @param {number} x0 * @param {number} y0 * @param {number} x1 * @param {number} y1 * @return {!CanvasGradient} * @throws {Error} */ BaseRenderingContext2D.prototype.createLinearGradient = function( x0, y0, x1, y1) {}; /** * @param {number} startAngle * @param {number} x * @param {number} y * @return {!CanvasGradient} * @throws {Error} */ BaseRenderingContext2D.prototype.createConicGradient = function( startAngle, x, y) {}; /** * @param {number} x0 * @param {number} y0 * @param {number} r0 * @param {number} x1 * @param {number} y1 * @param {number} r1 * @return {!CanvasGradient} * @throws {Error} */ BaseRenderingContext2D.prototype.createRadialGradient = function( x0, y0, r0, x1, y1, r1) {}; /** * @param {CanvasImageSource} image * @param {string} repetition * @return {?CanvasPattern} * @throws {Error} * @see https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-createpattern */ BaseRenderingContext2D.prototype.createPattern = function(image, repetition) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} */ BaseRenderingContext2D.prototype.clearRect = function(x, y, w, h) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} */ BaseRenderingContext2D.prototype.fillRect = function(x, y, w, h) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} */ BaseRenderingContext2D.prototype.strokeRect = function(x, y, w, h) {}; /** * @return {undefined} */ BaseRenderingContext2D.prototype.beginPath = function() {}; /** * @return {undefined} * @override */ BaseRenderingContext2D.prototype.closePath = function() {}; /** * @param {number} x * @param {number} y * @return {undefined} * @override */ BaseRenderingContext2D.prototype.moveTo = function(x, y) {}; /** * @param {number} x * @param {number} y * @return {undefined} * @override */ BaseRenderingContext2D.prototype.lineTo = function(x, y) {}; /** * @param {number} cpx * @param {number} cpy * @param {number} x * @param {number} y * @return {undefined} * @override */ BaseRenderingContext2D.prototype.quadraticCurveTo = function(cpx, cpy, x, y) {}; /** * @param {number} cp1x * @param {number} cp1y * @param {number} cp2x * @param {number} cp2y * @param {number} x * @param {number} y * @return {undefined} * @override */ BaseRenderingContext2D.prototype.bezierCurveTo = function( cp1x, cp1y, cp2x, cp2y, x, y) {}; /** * @param {number} x1 * @param {number} y1 * @param {number} x2 * @param {number} y2 * @param {number} radius * @return {undefined} * @override */ BaseRenderingContext2D.prototype.arcTo = function(x1, y1, x2, y2, radius) {}; /** * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @return {undefined} * @override */ BaseRenderingContext2D.prototype.rect = function(x, y, w, h) {}; /** * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @param {(number|!DOMPointInit|!Array<number|!DOMPointInit>)=} radii * @return {undefined} * @override */ BaseRenderingContext2D.prototype.roundRect = function(x, y, w, h, radii) {}; /** * @param {number} x * @param {number} y * @param {number} radius * @param {number} startAngle * @param {number} endAngle * @param {boolean=} opt_anticlockwise * @return {undefined} * @override */ BaseRenderingContext2D.prototype.arc = function( x, y, radius, startAngle, endAngle, opt_anticlockwise) {}; /** * @param {number} x * @param {number} y * @param {number} radiusX * @param {number} radiusY * @param {number} rotation * @param {number} startAngle * @param {number} endAngle * @param {boolean=} opt_anticlockwise * @return {undefined} * @see http://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D/ellipse */ BaseRenderingContext2D.prototype.ellipse = function( x, y, radiusX, radiusY, rotation, startAngle, endAngle, opt_anticlockwise) {}; /** * @param {Path2D|string=} optFillRuleOrPath * @param {string=} optFillRule * @return {undefined} */ BaseRenderingContext2D.prototype.fill = function( optFillRuleOrPath, optFillRule) {}; /** * @param {Path2D=} optStroke * @return {undefined} */ BaseRenderingContext2D.prototype.stroke = function(optStroke) {}; /** * @param {Element} element * @return {undefined} */ BaseRenderingContext2D.prototype.drawFocusIfNeeded = function(element) {}; /** * @param {Path2D|string=} optFillRuleOrPath * @param {string=} optFillRule * @return {undefined} */ BaseRenderingContext2D.prototype.clip = function( optFillRuleOrPath, optFillRule) {}; /** * @param {number} x * @param {number} y * @return {boolean} * @nosideeffects * @see http://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke */ BaseRenderingContext2D.prototype.isPointInStroke = function(x, y) {}; /** * @param {!Path2D|number} pathOrX * @param {number} xOrY * @param {number|string=} yOrFillRule * @param {string=} fillRule * @return {boolean} * @nosideeffects * @see http://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath */ BaseRenderingContext2D.prototype.isPointInPath = function( pathOrX, xOrY, yOrFillRule, fillRule) {}; /** * @param {string} text * @param {number} x * @param {number} y * @param {number=} opt_maxWidth * @return {undefined} */ BaseRenderingContext2D.prototype.fillText = function( text, x, y, opt_maxWidth) {}; /** * @param {string} text * @param {number} x * @param {number} y * @param {number=} opt_maxWidth * @return {undefined} */ BaseRenderingContext2D.prototype.strokeText = function( text, x, y, opt_maxWidth) {}; /** * @param {string} text * @return {!TextMetrics} * @nosideeffects */ BaseRenderingContext2D.prototype.measureText = function(text) {}; /** * @param {CanvasImageSource} image * @param {number} dx Destination x coordinate. * @param {number} dy Destination y coordinate. * @param {number=} opt_dw Destination box width. Defaults to the image width. * @param {number=} opt_dh Destination box height. * Defaults to the image height. * @param {number=} opt_sx Source box x coordinate. Used to select a portion of * the source image to draw. Defaults to 0. * @param {number=} opt_sy Source box y coordinate. Used to select a portion of * the source image to draw. Defaults to 0. * @param {number=} opt_sw Source box width. Used to select a portion of * the source image to draw. Defaults to the full image width. * @param {number=} opt_sh Source box height. Used to select a portion of * the source image to draw. Defaults to the full image height. * @return {undefined} */ BaseRenderingContext2D.prototype.drawImage = function( image, dx, dy, opt_dw, opt_dh, opt_sx, opt_sy, opt_sw, opt_sh) {}; /** * @param {number} sw * @param {number} sh * @return {!ImageData} * @throws {Error} * @nosideeffects */ BaseRenderingContext2D.prototype.createImageData = function(sw, sh) {}; /** * @param {number} sx * @param {number} sy * @param {number} sw * @param {number} sh * @return {!ImageData} * @throws {Error} */ BaseRenderingContext2D.prototype.getImageData = function(sx, sy, sw, sh) {}; /** * @param {ImageData} imagedata * @param {number} dx * @param {number} dy * @param {number=} opt_dirtyX * @param {number=} opt_dirtyY * @param {number=} opt_dirtyWidth * @param {number=} opt_dirtyHeight * @return {undefined} */ BaseRenderingContext2D.prototype.putImageData = function( imagedata, dx, dy, opt_dirtyX, opt_dirtyY, opt_dirtyWidth, opt_dirtyHeight) {}; /** * Note: WebKit only * @param {number|string=} opt_a * @param {number=} opt_b * @param {number=} opt_c * @param {number=} opt_d * @param {number=} opt_e * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html * @return {undefined} * @deprecated */ BaseRenderingContext2D.prototype.setFillColor = function( opt_a, opt_b, opt_c, opt_d, opt_e) {}; /** * Note: WebKit only * @param {number|string=} opt_a * @param {number=} opt_b * @param {number=} opt_c * @param {number=} opt_d * @param {number=} opt_e * @see http://developer.apple.com/library/safari/#documentation/appleapplications/reference/WebKitDOMRef/CanvasRenderingContext2D_idl/Classes/CanvasRenderingContext2D/index.html * @return {undefined} * @deprecated */ BaseRenderingContext2D.prototype.setStrokeColor = function( opt_a, opt_b, opt_c, opt_d, opt_e) {}; /** * @return {!Array<number>} * @override */ BaseRenderingContext2D.prototype.getLineDash = function() {}; /** * @param {Array<number>} segments * @return {undefined} * @override */ BaseRenderingContext2D.prototype.setLineDash = function(segments) {}; /** @type {string} */ BaseRenderingContext2D.prototype.fillColor; /** * @type {string|!CanvasGradient|!CanvasPattern} * @see https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:dom-context-2d-fillstyle * @implicitCast */ BaseRenderingContext2D.prototype.fillStyle; /** @type {string} */ BaseRenderingContext2D.prototype.font; /** @type {number} */ BaseRenderingContext2D.prototype.globalAlpha; /** @type {string} */ BaseRenderingContext2D.prototype.globalCompositeOperation; /** @type {number} */ BaseRenderingContext2D.prototype.lineWidth; /** @type {string} */ BaseRenderingContext2D.prototype.lineCap; /** @type {string} */ BaseRenderingContext2D.prototype.lineJoin; /** @type {number} */ BaseRenderingContext2D.prototype.miterLimit; /** @type {number} */ BaseRenderingContext2D.prototype.shadowBlur; /** @type {string} */ BaseRenderingContext2D.prototype.shadowColor; /** @type {number} */ BaseRenderingContext2D.prototype.shadowOffsetX; /** @type {number} */ BaseRenderingContext2D.prototype.shadowOffsetY; /** @type {boolean} */ BaseRenderingContext2D.prototype.imageSmoothingEnabled; /** * @type {string} * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingQuality */ BaseRenderingContext2D.prototype.imageSmoothingQuality; /** * @type {string|!CanvasGradient|!CanvasPattern} * @see https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:dom-context-2d-strokestyle * @implicitCast */ BaseRenderingContext2D.prototype.strokeStyle; /** @type {string} */ BaseRenderingContext2D.prototype.strokeColor; /** @type {string} */ BaseRenderingContext2D.prototype.textAlign; /** @type {string} */ BaseRenderingContext2D.prototype.textBaseline; /** @type {string} */ BaseRenderingContext2D.prototype.letterSpacing; /** @type {number} */ BaseRenderingContext2D.prototype.lineDashOffset; /** * @type {string} * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/direction */ BaseRenderingContext2D.prototype.direction; /** * @type {string} * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter */ BaseRenderingContext2D.prototype.filter; /** * @constructor * @extends {BaseRenderingContext2D} * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d */ function CanvasRenderingContext2D() {} /** @const {!HTMLCanvasElement} */ CanvasRenderingContext2D.prototype.canvas; /** * @constructor * @extends {BaseRenderingContext2D} * @see http://www.w3.org/TR/2dcontext/#canvasrenderingcontext2d */ function OffscreenCanvasRenderingContext2D() {} /** @const {!OffscreenCanvas} */ OffscreenCanvasRenderingContext2D.prototype.canvas; /** * @constructor */ function CanvasGradient() {} /** * @param {number} offset * @param {string} color * @return {undefined} */ CanvasGradient.prototype.addColorStop = function(offset, color) {}; /** * @constructor */ function CanvasPattern() {} /** * @see https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform-dev * @param {DOMMatrixReadOnly} matrix * @return {undefined} */ CanvasPattern.prototype.setTransform = function(matrix) {}; /** * @constructor * https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics */ function TextMetrics() {} /** @const {number} */ TextMetrics.prototype.width; /** @const {number|undefined} */ TextMetrics.prototype.actualBoundingBoxAscent; /** @const {number|undefined} */ TextMetrics.prototype.actualBoundingBoxDescent; /** @const {number|undefined} */ TextMetrics.prototype.actualBoundingBoxLeft; /** @const {number|undefined} */ TextMetrics.prototype.actualBoundingBoxRight; /** @const {number|undefined} */ TextMetrics.prototype.fontBoundingBoxAscent; /** @const {number|undefined} */ TextMetrics.prototype.fontBoundingBoxDescent; /** @const {number|undefined} */ TextMetrics.prototype.emHeightAscent; /** @const {number|undefined} */ TextMetrics.prototype.emHeightDescent; /** @const {number|undefined} */ TextMetrics.prototype.hangingBaseline; /** @const {number|undefined} */ TextMetrics.prototype.alphabeticBaseline; /** @const {number|undefined} */ TextMetrics.prototype.ideographicBaseline; /** * @param {!Uint8ClampedArray|number} dataOrWidth In the first form, this is the * array of pixel data. In the second form, this is the image width. * @param {number} widthOrHeight In the first form, this is the image width. In * the second form, this is the image height. * @param {number=} opt_height In the first form, this is the optional image * height. The second form omits this argument. * @see https://html.spec.whatwg.org/multipage/scripting.html#imagedata * @constructor */ function ImageData(dataOrWidth, widthOrHeight, opt_height) {} /** @const {!Uint8ClampedArray} */ ImageData.prototype.data; /** @const {number} */ ImageData.prototype.width; /** @const {number} */ ImageData.prototype.height; /** * @see https://www.w3.org/TR/html51/webappapis.html#webappapis-images * @interface */ function ImageBitmap() {} /** * @const {number} */ ImageBitmap.prototype.width; /** * @const {number} */ ImageBitmap.prototype.height; /** * Releases ImageBitmap's underlying bitmap data. * @return {undefined} * @see https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#images-2 */ ImageBitmap.prototype.close = function() {}; /** * @typedef {!CanvasImageSource | !Blob | !ImageData} * @see https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#imagebitmapsource */ var ImageBitmapSource; /** * @typedef {{ * imageOrientation: (string|undefined), * premultiplyAlpha: (string|undefined), * colorSpaceConversion: (string|undefined), * resizeWidth: (number|undefined), * resizeHeight: (number|undefined), * resizeQuality: (string|undefined) * }} * @see https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#images-2 */ var ImageBitmapOptions; /** * @param {!ImageBitmapSource} image * @param {(number|!ImageBitmapOptions)=} sxOrOptions * @param {number=} sy * @param {number=} sw * @param {number=} sh * @param {!ImageBitmapOptions=} options * @return {!Promise<!ImageBitmap>} * @see https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap * @see https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope-mixin */ function createImageBitmap(image, sxOrOptions, sy, sw, sh, options) {} /** * @constructor */ function ClientInformation() {} /** @type {boolean} */ ClientInformation.prototype.onLine; /** * @param {string} protocol * @param {string} uri * @param {string} title * @return {undefined} */ ClientInformation.prototype.registerProtocolHandler = function( protocol, uri, title) {}; /** * @param {string} mimeType * @param {string} uri * @param {string} title * @return {undefined} */ ClientInformation.prototype.registerContentHandler = function( mimeType, uri, title) {}; // HTML5 Database objects /** * @constructor */ function Database() {} /** * @type {string} */ Database.prototype.version; /** * @param {function(!SQLTransaction) : void} callback * @param {(function(!SQLError) : void)=} opt_errorCallback * @param {Function=} opt_Callback * @return {undefined} */ Database.prototype.transaction = function( callback, opt_errorCallback, opt_Callback) {}; /** * @param {function(!SQLTransaction) : void} callback * @param {(function(!SQLError) : void)=} opt_errorCallback * @param {Function=} opt_Callback * @return {undefined} */ Database.prototype.readTransaction = function( callback, opt_errorCallback, opt_Callback) {}; /** * @param {string} oldVersion * @param {string} newVersion * @param {function(!SQLTransaction) : void} callback * @param {function(!SQLError) : void} errorCallback * @param {Function} successCallback * @return {undefined} */ Database.prototype.changeVersion = function( oldVersion, newVersion, callback, errorCallback, successCallback) {}; /** * @interface */ function DatabaseCallback() {} /** * @param {!Database} db * @return {undefined} */ DatabaseCallback.prototype.handleEvent = function(db) {}; /** * @constructor */ function SQLError() {} /** * @type {number} */ SQLError.prototype.code; /** * @type {string} */ SQLError.prototype.message; /** * @constructor */ function SQLTransaction() {} /** * @param {string} sqlStatement * @param {Array<*>=} opt_queryArgs * @param {SQLStatementCallback=} opt_callback * @param {(function(!SQLTransaction, !SQLError) : (boolean|void))=} * opt_errorCallback * @return {undefined} */ SQLTransaction.prototype.executeSql = function( sqlStatement, opt_queryArgs, opt_callback, opt_errorCallback) {}; /** * @typedef {(function(!SQLTransaction, !SQLResultSet) : void)} */ var SQLStatementCallback; /** * @constructor */ function SQLResultSet() {} /** * @type {number} */ SQLResultSet.prototype.insertId; /** * @type {number} */ SQLResultSet.prototype.rowsAffected; /** * @type {!SQLResultSetRowList} */ SQLResultSet.prototype.rows; /** * @constructor * @implements {IArrayLike<!Object>} * @see http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist */ function SQLResultSetRowList() {} /** * @type {number} */ SQLResultSetRowList.prototype.length; /** * @param {number} index * @return {Object} * @nosideeffects */ SQLResultSetRowList.prototype.item = function(index) {}; /** * @param {string} name * @param {string} version * @param {string} description * @param {number} size * @param {(DatabaseCallback|function(Database))=} opt_callback * @return {!Database} */ function openDatabase(name, version, description, size, opt_callback) {} /** * @param {string} name * @param {string} version * @param {string} description * @param {number} size * @param {(DatabaseCallback|function(Database))=} opt_callback * @return {!Database} */ Window.prototype.openDatabase = function( name, version, description, size, opt_callback) {}; /** * @type {boolean} * @see https://www.w3.org/TR/html5/embedded-content-0.html#dom-img-complete */ HTMLImageElement.prototype.complete; /** * @type {number} * @see https://www.w3.org/TR/html5/embedded-content-0.html#dom-img-naturalwidth */ HTMLImageElement.prototype.naturalWidth; /** * @type {number} * @see https://www.w3.org/TR/html5/embedded-content-0.html#dom-img-naturalheight */ HTMLImageElement.prototype.naturalHeight; /** * @type {string} * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#attr-img-crossorigin */ HTMLImageElement.prototype.crossOrigin; /** * @type {string} * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc */ HTMLImageElement.prototype.currentSrc; /** * @type {string} * @see https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint */ HTMLImageElement.prototype.decoding; /** * @return {!Promise<undefined>} * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode */ HTMLImageElement.prototype.decode; /** * @record * @see https://html.spec.whatwg.org/multipage/web-messaging.html#structuredserializeoptions */ function StructuredSerializeOptions() {} /** * @type {!Array<!Transferable>|undefined} * @see https://html.spec.whatwg.org/multipage/web-messaging.html#dom-structuredserializeoptions-transfer */ StructuredSerializeOptions.prototype.transfer; /** * @record * @extends {StructuredSerializeOptions} * @see https://html.spec.whatwg.org/multipage/window-object.html#windowpostmessageoptions */ function WindowPostMessageOptions() {} /** * @type {string|undefined} * @see https://html.spec.whatwg.org/multipage/window-object.html#dom-windowpostmessageoptions-targetorigin */ WindowPostMessageOptions.prototype.targetOrigin; /** * This is a superposition of the Window and Worker postMessage methods. * @param {*} message * @param {(string|!StructuredSerializeOptions|!WindowPostMessageOptions|!Array<!Transferable>)=} * targetOriginOrOptionsOrTransfer * @param {(string|!Array<!MessagePort>|!Array<!Transferable>)=} * targetOriginOrPortsOrTransfer * @return {void} */ function postMessage( message, targetOriginOrOptionsOrTransfer, targetOriginOrPortsOrTransfer) {} /** * Takes the input value and returns a deep copy by performing the structured * clone algorithm. Transferable objects listed in the transfer array are * transferred, not just cloned, meaning that they are no longer usable in the * input value. * @see https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning * @param {*} value * @param {!StructuredSerializeOptions=} options * @throws {DOMException} * @return {*} */ function structuredClone(value, options) {} /** * @param {*} message * @param {(string|!WindowPostMessageOptions)=} targetOriginOrOptions * @param {(!Array<!Transferable>)=} transfer * @return {void} * @see https://html.spec.whatwg.org/multipage/web-messaging.html#posting-messages */ Window.prototype.postMessage = function( message, targetOriginOrOptions, transfer) {}; /** * The postMessage method (as implemented in Opera). * @param {string} message */ Document.prototype.postMessage = function(message) {}; /** * Document head accessor. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#the-head-element-0 * @type {HTMLHeadElement} */ Document.prototype.head; /** * @type {string} * @see https://html.spec.whatwg.org/multipage/dom.html#current-document-readiness */ Document.prototype.readyState; /** * @see https://html.spec.whatwg.org/#application-cache-api * @constructor * @implements {EventTarget} */ function ApplicationCache() {} /** @override */ ApplicationCache.prototype.addEventListener = function( type, listener, opt_options) {}; /** @override */ ApplicationCache.prototype.removeEventListener = function( type, listener, opt_options) {}; /** @override */ ApplicationCache.prototype.dispatchEvent = function(evt) {}; /** * The object isn't associated with an application cache. This can occur if the * update process fails and there is no previous cache to revert to, or if there * is no manifest file. * @const {number} */ ApplicationCache.prototype.UNCACHED; /** * The object isn't associated with an application cache. This can occur if the * update process fails and there is no previous cache to revert to, or if there * is no manifest file. * @const {number} */ ApplicationCache.UNCACHED; /** * The cache is idle. * @const {number} */ ApplicationCache.prototype.IDLE; /** * The cache is idle. * @const {number} */ ApplicationCache.IDLE; /** * The update has started but the resources are not downloaded yet - for * example, this can happen when the manifest file is fetched. * @const {number} */ ApplicationCache.prototype.CHECKING; /** * The update has started but the resources are not downloaded yet - for * example, this can happen when the manifest file is fetched. * @const {number} */ ApplicationCache.CHECKING; /** * The resources are being downloaded into the cache. * @const {number} */ ApplicationCache.prototype.DOWNLOADING; /** * The resources are being downloaded into the cache. * @const {number} */ ApplicationCache.DOWNLOADING; /** * Resources have finished downloading and the new cache is ready to be used. * @const {number} */ ApplicationCache.prototype.UPDATEREADY; /** * Resources have finished downloading and the new cache is ready to be used. * @const {number} */ ApplicationCache.UPDATEREADY; /** * The cache is obsolete. * @const {number} */ ApplicationCache.prototype.OBSOLETE; /** * The cache is obsolete. * @const {number} */ ApplicationCache.OBSOLETE; /** * The current status of the application cache. * @type {number} */ ApplicationCache.prototype.status; /** * Sent when the update process finishes for the first time; that is, the first * time an application cache is saved. * @type {?function(!Event): void} */ ApplicationCache.prototype.oncached; /** * Sent when the cache update process begins. * @type {?function(!Event): void} */ ApplicationCache.prototype.onchecking; /** * Sent when the update process begins downloading resources in the manifest * file. * @type {?function(!Event): void} */ ApplicationCache.prototype.ondownloading; /** * Sent when an error occurs. * @type {?function(!Event): void} */ ApplicationCache.prototype.onerror; /** * Sent when the update process finishes but the manifest file does not change. * @type {?function(!Event): void} */ ApplicationCache.prototype.onnoupdate; /** * Sent when each resource in the manifest file begins to download. * @type {?function(!Event): void} */ ApplicationCache.prototype.onprogress; /** * Sent when there is an existing application cache, the update process * finishes, and there is a new application cache ready for use. * @type {?function(!Event): void} */ ApplicationCache.prototype.onupdateready; /** * Replaces the active cache with the latest version. * @throws {DOMException} * @return {undefined} */ ApplicationCache.prototype.swapCache = function() {}; /** * Manually triggers the update process. * @throws {DOMException} * @return {undefined} */ ApplicationCache.prototype.update = function() {}; /** @type {?ApplicationCache} */ var applicationCache; /** @type {ApplicationCache} */ Window.prototype.applicationCache; /** * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers * @param {...!TrustedScriptURL|!URL|string} urls * @return {undefined} */ Window.prototype.importScripts = function(urls) {}; /** * Decodes a string of data which has been encoded using base-64 encoding. * * @param {string} encodedData * @return {string} * @nosideeffects * @see https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob */ function atob(encodedData) {} /** * @param {string} stringToEncode * @return {string} * @nosideeffects * @see https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa */ function btoa(stringToEncode) {} /** * @see https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers * @param {...!TrustedScriptURL|!URL|string} urls * @return {undefined} */ function importScripts(urls) {} /** * @see http://dev.w3.org/html5/workers/ * @param {!TrustedScriptURL|!URL|string} scriptURL * @param {!WorkerOptions=} opt_options * @constructor * @implements {EventTarget} */ function Worker(scriptURL, opt_options) {} /** @override */ Worker.prototype.addEventListener = function(type, listener, opt_options) {}; /** @override */ Worker.prototype.removeEventListener = function(type, listener, opt_options) {}; /** @override */ Worker.prototype.dispatchEvent = function(evt) {}; /** * Stops the worker process * @return {undefined} */ Worker.prototype.terminate = function() {}; /** * Posts a message to the worker thread. * @see https://html.spec.whatwg.org/multipage/workers.html#dom-worker-postmessage * @param {*} message * @param {(Array<!Transferable>|!StructuredSerializeOptions)=} * transferOrOptions * @return {undefined} */ Worker.prototype.postMessage = function(message, transferOrOptions) {}; /** * Posts a message to the worker thread. * @param {*} message * @param {(Array<!Transferable>|!StructuredSerializeOptions)=} * transferOrOptions * @return {undefined} */ Worker.prototype.webkitPostMessage = function(message, transferOrOptions) {}; /** * Sent when the worker thread posts a message to its creator. * @type {?function(!MessageEvent<*>): void} */ Worker.prototype.onmessage; /** * @type {?function(!MessageEvent)} * @see https://developer.mozilla.org/docs/Web/API/Worker/messageerror_event */ Worker.prototype.onmessageerror; /** * Sent when the worker thread encounters an error. * @type {?function(!ErrorEvent): void} */ Worker.prototype.onerror; /** * @see http://dev.w3.org/html5/workers/ * @record */ function WorkerOptions() {} /** * Defines a name for the new global environment of the worker, primarily for * debugging purposes. * @type {string|undefined} */ WorkerOptions.prototype.name; /** * 'classic' or 'module'. Default: 'classic'. * Specifying 'module' ensures the worker environment supports JavaScript * modules. * @type {string|undefined} */ WorkerOptions.prototype.type; // WorkerOptions.prototype.credentials is defined in fetchapi.js. // if type = 'module', it specifies how scriptURL is fetched. /** * @see http://dev.w3.org/html5/workers/ * @param {!TrustedScriptURL|!URL|string} scriptURL The URL of the script to run * in the SharedWorker. * @param {(string|!WorkerOptions)=} options A name that can * later be used to obtain a reference to the same SharedWorker or a * WorkerOptions object which can be be used to specify how scriptURL is * fetched through the credentials option. * @constructor * @implements {EventTarget} */ function SharedWorker(scriptURL, options) {} /** @override */ SharedWorker.prototype.addEventListener = function( type, listener, opt_options) {}; /** @override */ SharedWorker.prototype.removeEventListener = function( type, listener, opt_options) {}; /** @override */ SharedWorker.prototype.dispatchEvent = function(evt) {}; /** * @type {!MessagePort} */ SharedWorker.prototype.port; /** * Called on network errors for loading the initial script. * @type {?function(!ErrorEvent): void} */ SharedWorker.prototype.onerror; /** * @see http://dev.w3.org/html5/workers/ * @see http://www.w3.org/TR/url-1/#dom-urlutilsreadonly * @interface */ function WorkerLocation() {} /** @type {string} */ WorkerLocation.prototype.href; /** @type {string} */ WorkerLocation.prototype.origin; /** @type {string} */ WorkerLocation.prototype.protocol; /** @type {string} */ WorkerLocation.prototype.host; /** @type {string} */ WorkerLocation.prototype.hostname; /** @type {string} */ WorkerLocation.prototype.port; /** @type {string} */ WorkerLocation.prototype.pathname; /** @type {string} */ WorkerLocation.prototype.search; /** @type {string} */ WorkerLocation.prototype.hash; /** * @see http://dev.w3.org/html5/workers/ * @interface * @extends {EventTarget} */ function WorkerGlobalScope() {} /** @type {!WorkerGlobalScope} */ WorkerGlobalScope.prototype.self; /** @type {!WorkerLocation} */ WorkerGlobalScope.prototype.location; /** * @const {string} * @see https://html.spec.whatwg.org/#windoworworkerglobalscope-mixin */ WorkerGlobalScope.prototype.origin; /** * @const {string} * Duplicate definition, since we don't model WindowOrWorkerGlobalScope. * @see https://html.spec.whatwg.org/#windoworworkerglobalscope-mixin */ Window.prototype.origin; /** * Closes the worker represented by this WorkerGlobalScope. * @return {undefined} */ WorkerGlobalScope.prototype.close = function() {}; /** * Sent when the worker encounters an error. * @type {?function(string, string, number, number, !Error): void} */ WorkerGlobalScope.prototype.onerror; /** * Sent when the worker goes offline. * @type {?function(!Event): void} */ WorkerGlobalScope.prototype.onoffline; /** * Sent when the worker goes online. * @type {?function(!Event): void} */ WorkerGlobalScope.prototype.ononline; /** @type {!WorkerPerformance} */ WorkerGlobalScope.prototype.performance; /** @type {!WorkerNavigator} */ WorkerGlobalScope.prototype.navigator; /** * Worker postMessage method. * @see https://html.spec.whatwg.org/multipage/workers.html#dom-dedicatedworkerglobalscope-postmessage * @param {*} message * @param {(!Array<!Transferable>|!StructuredSerializeOptions)=} * transferOrOptions * @return {void} */ WorkerGlobalScope.prototype.postMessage = function( message, transferOrOptions) {}; /** * @see http://dev.w3.org/html5/workers/ * @interface * @extends {WorkerGlobalScope} */ function DedicatedWorkerGlobalScope() {} /** * Posts a message to creator of this worker. * @see https://html.spec.whatwg.org/multipage/workers.html#dom-dedicatedworkerglobalscope-postmessage * @param {*} message * @param {(Array<!Transferable>|!StructuredSerializeOptions)=} * transferOrOptions * @return {undefined} */ DedicatedWorkerGlobalScope.prototype.postMessage = function( message, transferOrOptions) {}; /** * Posts a message to creator of this worker. * @param {*} message * @param {(Array<!Transferable>|!StructuredSerializeOptions)=} * transferOrOptions * @return {undefined} */ DedicatedWorkerGlobalScope.prototype.webkitPostMessage = function( message, transferOrOptions) {}; /** * Sent when the creator posts a message to this worker. * @type {?function(!MessageEvent<*>): void} */ DedicatedWorkerGlobalScope.prototype.onmessage; /** * @see http://dev.w3.org/html5/workers/ * @interface * @extends {WorkerGlobalScope} */ function SharedWorkerGlobalScope() {} /** @type {string} */ SharedWorkerGlobalScope.prototype.name; /** * Sent when a connection to this worker is opened. * @type {?function(!MessageEvent)} */ SharedWorkerGlobalScope.prototype.onconnect; /** @type {!Array<string>|undefined} */ HTMLElement.observedAttributes; /** * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example * @type {boolean|undefined} */ HTMLElement.formAssociated; /** * @param {!Document} oldDocument * @param {!Document} newDocument */ HTMLElement.prototype.adoptedCallback = function(oldDocument, newDocument) {}; /** * @param {!ShadowRootInit} options * @return {!ShadowRoot} */ HTMLElement.prototype.attachShadow = function(options) {}; /** * @return {!ElementInternals} */ HTMLElement.prototype.attachInternals = function() {}; /** * @param {string} attributeName * @param {?string} oldValue * @param {?string} newValue * @param {?string} namespace */ HTMLElement.prototype.attributeChangedCallback = function( attributeName, oldValue, newValue, namespace) {}; /** @type {function()|undefined} */ HTMLElement.prototype.connectedCallback; /** @type {Element} */ HTMLElement.prototype.contextMenu; /** @type {function()|undefined} */ HTMLElement.prototype.disconnectedCallback; /** @type {boolean} */ HTMLElement.prototype.draggable; /** * This is actually a DOMSettableTokenList property. However since that * interface isn't currently defined and no known browsers implement this * feature, just define the property for now. * * @const {Object} */ HTMLElement.prototype.dropzone; /** @type {boolean} */ HTMLElement.prototype.hidden; /** @type {boolean} */ HTMLElement.prototype.inert; /** @type {boolean} */ HTMLElement.prototype.spellcheck; /** * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example * @param {HTMLFormElement} form */ HTMLElement.prototype.formAssociatedCallback = function(form) {}; /** * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example * @param {boolean} disabled */ HTMLElement.prototype.formDisabledCallback = function(disabled) {}; /** * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example * @type {function()|undefined} */ HTMLElement.prototype.formResetCallback; /** * @param {null|string|!File|!Array<!Array<string|!File>>} state * @param {string} reason */ HTMLElement.prototype.formStateRestoreCallback = function(state, reason) {}; /** * @see https://dom.spec.whatwg.org/#dictdef-