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.offsetRight;
52 Element.prototype.offsetBottom;
55 Element.prototype.textContent;
57 /** @type {DOMTokenList} */
58 Element.prototype.classList;
60 /** @type {boolean} */
61 Element.prototype.checked;
65 HTMLIFrameElement.prototype.contentWindow;
68 * @param {string} selector
69 * @return {?HTMLElement}.
71 HTMLElement.prototype.querySelector = function(selector) {};
74 * @param {string} name
77 Node.prototype.getAttribute = function(name) { };
82 /** @type {{top: string, left: string, bottom: string, right: string}} */
85 /** @type {boolean} */
86 Node.prototype.hidden;
89 /** @type {{getRandomValues: function(!ArrayBufferView):!ArrayBufferView}} */
90 Window.prototype.crypto;
94 * @type {DataTransfer}
96 Event.prototype.dataTransfer = null;
101 Event.prototype.movementX = 0;
106 Event.prototype.movementY = 0;
109 * @param {string} type
110 * @param {boolean} canBubble
111 * @param {boolean} cancelable
112 * @param {Window} view
113 * @param {number} detail
114 * @param {number} screenX
115 * @param {number} screenY
116 * @param {number} clientX
117 * @param {number} clientY
118 * @param {boolean} ctrlKey
119 * @param {boolean} altKey
120 * @param {boolean} shiftKey
121 * @param {boolean} metaKey
122 * @param {number} button
123 * @param {EventTarget} relatedTarget
125 Event.prototype.initMouseEvent = function(
126 type, canBubble, cancelable, view, detail,
127 screenX, screenY, clientX, clientY,
128 ctrlKey, altKey, shiftKey, metaKey,
129 button, relatedTarget) {};
131 /** @type {Object} */
132 Event.prototype.data = {};
136 * @return {boolean} whether value is an integer or not.
138 Number.isInteger = function(value) {};
140 // Chrome implements XMLHttpRequest.responseURL starting from Chrome 37.
141 /** @type {string} */
142 XMLHttpRequest.prototype.responseURL = "";