webkit_dom.js (5971B)
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 /** 18 * @fileoverview Definitions for all the extensions over W3C's DOM 19 * specification by WebKit. This file depends on w3c_dom2.js. 20 * All the provided definitions has been type annotated 21 * 22 * @externs 23 */ 24 25 26 /** 27 * @param {boolean=} opt_center 28 * @see https://bugzilla.mozilla.org/show_bug.cgi?id=403510 29 */ 30 Element.prototype.scrollIntoViewIfNeeded = function(opt_center) {}; 31 32 /** 33 * @constructor 34 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.idl 35 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/MemoryInfo.cpp 36 */ 37 function MemoryInfo() {}; 38 39 /** @type {number} */ 40 MemoryInfo.prototype.totalJSHeapSize; 41 42 /** @type {number} */ 43 MemoryInfo.prototype.usedJSHeapSize; 44 45 /** @type {number} */ 46 MemoryInfo.prototype.jsHeapSizeLimit; 47 48 /** 49 * @constructor 50 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfileNode.idl 51 */ 52 function ScriptProfileNode() {}; 53 54 /** @type {string} */ 55 ScriptProfileNode.prototype.functionName; 56 57 /** @type {string} */ 58 ScriptProfileNode.prototype.url; 59 60 /** @type {number} */ 61 ScriptProfileNode.prototype.lineNumber; 62 63 /** @type {number} */ 64 ScriptProfileNode.prototype.totalTime; 65 66 /** @type {number} */ 67 ScriptProfileNode.prototype.selfTime; 68 69 /** @type {number} */ 70 ScriptProfileNode.prototype.numberOfCalls; 71 72 /** @type {Array.<ScriptProfileNode>} */ 73 ScriptProfileNode.prototype.children; 74 75 /** @type {boolean} */ 76 ScriptProfileNode.prototype.visible; 77 78 /** @type {number} */ 79 ScriptProfileNode.prototype.callUID; 80 81 /** 82 * @constructor 83 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/ScriptProfile.idl 84 */ 85 function ScriptProfile() {}; 86 87 /** @type {string} */ 88 ScriptProfile.prototype.title; 89 90 /** @type {number} */ 91 ScriptProfile.prototype.uid; 92 93 /** @type {ScriptProfileNode} */ 94 ScriptProfile.prototype.head; 95 96 /** 97 * @constructor 98 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.idl 99 * @see http://trac.webkit.org/browser/trunk/Source/WebCore/page/Console.cpp 100 */ 101 function Console() {}; 102 103 /** 104 * @param {*} condition 105 * @param {...*} var_args 106 */ 107 Console.prototype.assert = function(condition, var_args) {}; 108 109 /** 110 * @param {...*} var_args 111 */ 112 Console.prototype.error = function(var_args) {}; 113 114 /** 115 * @param {...*} var_args 116 */ 117 Console.prototype.info = function(var_args) {}; 118 119 /** 120 * @param {...*} var_args 121 */ 122 Console.prototype.log = function(var_args) {}; 123 124 /** 125 * @param {...*} var_args 126 */ 127 Console.prototype.warn = function(var_args) {}; 128 129 /** 130 * @param {...*} var_args 131 */ 132 Console.prototype.debug = function(var_args) {}; 133 134 /** 135 * @param {*} value 136 */ 137 Console.prototype.dir = function(value) {}; 138 139 /** 140 * @param {...*} var_args 141 */ 142 Console.prototype.dirxml = function(var_args) {}; 143 144 /** 145 * @param {!Object} data 146 * @param {*=} opt_columns 147 */ 148 Console.prototype.table = function(data, opt_columns) {}; 149 150 /** 151 * @return {undefined} 152 */ 153 Console.prototype.trace = function() {}; 154 155 /** 156 * @param {*} value 157 */ 158 Console.prototype.count = function(value) {}; 159 160 /** 161 * @param {*} value 162 */ 163 Console.prototype.markTimeline = function(value) {}; 164 165 /** 166 * @param {string=} opt_title 167 */ 168 Console.prototype.profile = function(opt_title) {}; 169 170 /** @type {Array.<ScriptProfile>} */ 171 Console.prototype.profiles; 172 173 /** 174 * @param {string=} opt_title 175 */ 176 Console.prototype.profileEnd = function(opt_title) {}; 177 178 /** 179 * @param {string} name 180 */ 181 Console.prototype.time = function(name) {}; 182 183 /** 184 * @param {string} name 185 */ 186 Console.prototype.timeEnd = function(name) {}; 187 188 /** 189 * @param {*} value 190 */ 191 Console.prototype.timeStamp = function(value) {}; 192 193 /** 194 * @param {...*} var_args 195 */ 196 Console.prototype.group = function(var_args) {}; 197 198 /** 199 * @param {...*} var_args 200 */ 201 Console.prototype.groupCollapsed = function(var_args) {}; 202 203 Console.prototype.groupEnd = function() {}; 204 205 Console.prototype.clear = function() {}; 206 207 /** @type {MemoryInfo} */ 208 Console.prototype.memory; 209 210 /** @type {!Console} */ 211 Window.prototype.console; 212 213 /** 214 * @type {!Console} 215 * @suppress {duplicate} 216 */ 217 var console; 218 219 /** 220 * @type {number} 221 * @see http://developer.android.com/reference/android/webkit/WebView.html 222 */ 223 Window.prototype.devicePixelRatio; 224 225 /** @type {Node} */ 226 Selection.prototype.baseNode; 227 228 /** @type {number} */ 229 Selection.prototype.baseOffset; 230 231 /** @type {Node} */ 232 Selection.prototype.extentNode; 233 234 /** @type {number} */ 235 Selection.prototype.extentOffset; 236 237 /** @type {string} */ 238 Selection.prototype.type; 239 240 /** 241 * @return {undefined} 242 */ 243 Selection.prototype.empty = function() {}; 244 245 /** 246 * @param {Node} baseNode 247 * @param {number} baseOffset 248 * @param {Node} extentNode 249 * @param {number} extentOffset 250 * @return {undefined} 251 */ 252 Selection.prototype.setBaseAndExtent = 253 function(baseNode, baseOffset, extentNode, extentOffset) {}; 254 255 /** 256 * @param {string} alter 257 * @param {string} direction 258 * @param {string} granularity 259 * @return {undefined} 260 */ 261 Selection.prototype.modify = function(alter, direction, granularity) {}; 262 263 /** 264 * @param {Element} element 265 * @param {string} pseudoElement 266 * @param {boolean=} opt_authorOnly 267 * @return {CSSRuleList} 268 * @nosideeffects 269 */ 270 ViewCSS.prototype.getMatchedCSSRules = 271 function(element, pseudoElement, opt_authorOnly) {}; 272 273 /** 274 * @param {string} contextId 275 * @param {string} name 276 * @param {number} width 277 * @param {number} height 278 * @nosideeffects 279 */ 280 Document.prototype.getCSSCanvasContext = 281 function(contextId, name, width, height) {};