1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains various hacks needed to inform JSCompiler of various
6 // WebKit- and Chrome-specific properties and methods. It is used only with
7 // JSCompiler to verify the type-correctness of our code.
9 /** @type {Array<string>} */
10 ClipboardData.prototype.types;
12 /** @type {HTMLElement} */
13 Document.prototype.activeElement;
15 /** @type {Array<HTMLElement>} */
16 Document.prototype.all;
18 /** @type {boolean} */
19 Document.prototype.hidden;
21 /** @return {void} Nothing. */
22 Document.prototype.exitPointerLock = function() {};
24 /** @type {boolean} */
25 Document.prototype.webkitIsFullScreen;
27 /** @type {boolean} */
28 Document.prototype.webkitHidden;
30 /** @type {Element} */
31 Document.prototype.firstElementChild;
33 /** @return {void} Nothing. */
34 Element.prototype.requestPointerLock = function() {};
36 /** @type {boolean} */
37 Element.prototype.disabled;
39 /** @type {boolean} */
40 Element.prototype.hidden;
43 Element.prototype.innerText;
46 Element.prototype.localName;
49 Element.prototype.textContent;
51 /** @type {DOMTokenList} */
52 Element.prototype.classList;
54 /** @type {boolean} */
55 Element.prototype.checked;
59 HTMLIFrameElement.prototype.contentWindow;
62 * @param {string} selector
63 * @return {?HTMLElement}.
65 HTMLElement.prototype.querySelector = function(selector) {};
68 * @param {string} name
71 Node.prototype.getAttribute = function(name) { };
76 /** @type {{top: string, left: string, bottom: string, right: string}} */
79 /** @type {boolean} */
80 Node.prototype.hidden;
83 /** @type {{getRandomValues: function(!ArrayBufferView):!ArrayBufferView}} */
84 Window.prototype.crypto;
88 * @type {DataTransfer}
90 Event.prototype.dataTransfer = null;
95 Event.prototype.movementX = 0;
100 Event.prototype.movementY = 0;
103 * @param {string} type
104 * @param {boolean} canBubble
105 * @param {boolean} cancelable
106 * @param {Window} view
107 * @param {number} detail
108 * @param {number} screenX
109 * @param {number} screenY
110 * @param {number} clientX
111 * @param {number} clientY
112 * @param {boolean} ctrlKey
113 * @param {boolean} altKey
114 * @param {boolean} shiftKey
115 * @param {boolean} metaKey
116 * @param {number} button
117 * @param {EventTarget} relatedTarget
119 Event.prototype.initMouseEvent = function(
120 type, canBubble, cancelable, view, detail,
121 screenX, screenY, clientX, clientY,
122 ctrlKey, altKey, shiftKey, metaKey,
123 button, relatedTarget) {};
125 /** @type {Object} */
126 Event.prototype.data = {};
130 * @return {boolean} whether value is an integer or not.
132 Number.isInteger = function(value) {};
134 // Chrome implements XMLHttpRequest.responseURL starting from Chrome 37.
135 /** @type {string} */
136 XMLHttpRequest.prototype.responseURL = "";