2 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 // WebKit Web Facing API
33 /** @param {...*} vararg */
34 console.warn = function(vararg) {}
35 /** @param {...*} vararg */
36 console.assert = function(vararg) {}
37 /** @param {...*} vararg */
38 console.error = function(vararg) {}
39 console.trace = function() {}
41 /** @type {boolean} */
42 Event.prototype.isMetaOrCtrlForTest = false;
43 /** @param {...*} vararg */
44 Event.prototype.initWebKitWheelEvent = function(vararg) {}
45 Event.prototype.stopImmediatePropagation = function() {}
49 * @extends {KeyboardEvent}
50 * @param {string} eventType
51 * @param {Object=} properties
53 window.KeyboardEvent = function(eventType, properties) {}
55 /** @param {Element} element */
56 window.getComputedStyle = function(element) {}
57 /** @param {*} message */
58 function postMessage(message) {}
61 window.testRunner = null;
66 function WebKitMutation(callback)
69 /** @type {Node} */ this.target = null;
70 /** @type {Array.<Node>} */ this.addedNodes = [];
71 /** @type {Array.<Node>} */ this.removedNodes = [];
76 * @param {function(Array.<WebKitMutation>)} callback
78 function WebKitMutationObserver(callback) {}
80 * @param {Node} container
81 * @param {Object} options
83 WebKitMutationObserver.prototype.observe = function(container, options) {}
84 WebKitMutationObserver.prototype.disconnect = function() {}
87 * @param {string} eventName
88 * @param {Function} listener
89 * @param {boolean=} capturing
91 function addEventListener(eventName, listener, capturing) {}
95 * @param {boolean=} onlyFirst
99 Array.prototype.remove = function(value, onlyFirst) {}
101 * @return {!Object.<string, boolean>}
104 Array.prototype.keySet = function() {}
106 * @param {number} index
107 * @return {!Array.<T>}
111 Array.prototype.rotate = function(index) {}
114 * @param {function(T,S):number=} comparator
119 Array.prototype.lowerBound = function(object, comparator) {}
122 * @param {function(T,S):number=} comparator
127 Array.prototype.upperBound = function(object, comparator) {}
130 * @param {function(T,S):number} comparator
135 Array.prototype.binaryIndexOf = function(value, comparator) {}
137 * @param {function(number, number): number} comparator
138 * @param {number} leftBound
139 * @param {number} rightBound
140 * @param {number} sortWindowLeft
141 * @param {number} sortWindowRight
142 * @return {!Array.<number>}
143 * @this {Array.<number>}
145 Array.prototype.sortRange = function(comparator, leftBound, rightBound, sortWindowLeft, sortWindowRight) {}
148 * @this {Array.<number>}
149 * @param {function(number,number):boolean} comparator
150 * @param {number} left
151 * @param {number} right
152 * @param {number} pivotIndex
155 Array.prototype.partition = function(comparator, left, right, pivotIndex) {}
158 * @this {Array.<number>}
160 * @param {function(number,number):boolean=} comparator
163 Array.prototype.qselect = function(k, comparator) {}
166 * @param {string} field
167 * @return {!Array.<T>}
168 * @this {Array.<Object.<string,T>>}
171 Array.prototype.select = function(field) {}
174 * @return {T|undefined}
178 Array.prototype.peekLast = function() {}
180 DOMApplicationCache.prototype.UNCACHED = 0;
181 DOMApplicationCache.prototype.IDLE = 1;
182 DOMApplicationCache.prototype.CHECKING = 2;
183 DOMApplicationCache.prototype.DOWNLOADING = 3;
184 DOMApplicationCache.prototype.UPDATEREADY = 4;
185 DOMApplicationCache.prototype.OBSOLETE = 5;
191 function DOMFileSystem() {}
194 * @type {DirectoryEntry}
196 DOMFileSystem.prototype.root = null;
199 Range.prototype.startContainer;
202 var InspectorBackend = {}
203 InspectorBackend.runAfterPendingDispatches = function(message) {}
206 function InspectorFrontendHostAPI() {}
207 /** @param {Function=} callback callback */
208 InspectorFrontendHostAPI.prototype.addFileSystem = function(callback) {}
209 /** @param {Function=} callback callback */
210 InspectorFrontendHostAPI.prototype.append = function(url, content, callback) {}
211 /** @param {Function=} callback callback */
212 InspectorFrontendHostAPI.prototype.indexPath = function(requestId, fileSystemPath, callback) {}
213 /** @param {Function=} callback callback */
214 InspectorFrontendHostAPI.prototype.setWindowBounds = function(x, y, callback) {}
215 /** @param {Function=} callback callback */
216 InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y, callback) {}
217 /** @param {Function=} callback callback */
218 InspectorFrontendHostAPI.prototype.openInNewTab = function(url, callback) {}
219 /** @param {Function=} callback callback */
220 InspectorFrontendHostAPI.prototype.removeFileSystem = function(fileSystemPath, callback) {}
221 /** @param {Function=} callback callback */
222 InspectorFrontendHostAPI.prototype.requestFileSystems = function(callback) {}
223 /** @param {Function=} callback callback */
224 InspectorFrontendHostAPI.prototype.save = function(url, content, forceSaveAs, callback) {}
225 /** @param {Function=} callback callback */
226 InspectorFrontendHostAPI.prototype.searchInPath = function(requestId, fileSystemPath, query, callback) {}
227 /** @param {Function=} callback callback */
228 InspectorFrontendHostAPI.prototype.stopIndexing = function(requestId, callback) {}
230 InspectorFrontendHostAPI.prototype.bringToFront = function() {}
231 InspectorFrontendHostAPI.prototype.close = function(url) {}
232 InspectorFrontendHostAPI.prototype.closeWindow = function() {}
233 InspectorFrontendHostAPI.prototype.copyText = function(text) {}
234 InspectorFrontendHostAPI.prototype.inspectedURLChanged = function(url) {}
235 InspectorFrontendHostAPI.prototype.isolatedFileSystem = function(fileSystemId, registeredName) {}
236 InspectorFrontendHostAPI.prototype.loaded = function() {}
237 InspectorFrontendHostAPI.prototype.localizedStringsURL = function() {}
238 InspectorFrontendHostAPI.prototype.platform = function() {}
239 InspectorFrontendHostAPI.prototype.port = function() {}
240 InspectorFrontendHostAPI.prototype.recordActionTaken = function(actionCode) {}
241 InspectorFrontendHostAPI.prototype.recordPanelShown = function(panelCode) {}
242 InspectorFrontendHostAPI.prototype.recordSettingChanged = function(settingCode) {}
243 InspectorFrontendHostAPI.prototype.requestSetDockSide = function(dockSide) {}
244 InspectorFrontendHostAPI.prototype.sendMessageToBackend = function(message) {}
245 InspectorFrontendHostAPI.prototype.sendMessageToEmbedder = function(message) {}
246 InspectorFrontendHostAPI.prototype.setInjectedScriptForOrigin = function(origin, script) {}
247 InspectorFrontendHostAPI.prototype.setZoomFactor = function(zoom) {}
248 InspectorFrontendHostAPI.prototype.supportsFileSystems = function() {}
249 /** @type {InspectorFrontendHostAPI} */
250 var InspectorFrontendHost;
253 function SourceMapV3()
255 /** @type {number} */ this.version;
256 /** @type {string} */ this.file;
257 /** @type {Array.<string>} */ this.sources;
258 /** @type {Array.<SourceMapV3.Section>} */ this.sections;
259 /** @type {string} */ this.mappings;
260 /** @type {string} */ this.sourceRoot;
264 SourceMapV3.Section = function()
266 /** @type {SourceMapV3} */ this.map;
267 /** @type {SourceMapV3.Offset} */ this.offset;
271 SourceMapV3.Offset = function()
273 /** @type {number} */ this.line;
274 /** @type {number} */ this.column;
277 // FIXME: remove everything below.
278 var FormatterWorker = {}
279 var WebInspector = {}
281 WebInspector.queryParamsObject = {}
282 WebInspector.toggleSearchingForNode = function() {}
283 WebInspector.panels = {};
286 * @param {string=} messageLevel
287 * @param {boolean=} showConsole
289 WebInspector.log = function(message, messageLevel, showConsole) {}
291 WebInspector.showErrorMessage = function(error) {}
293 WebInspector.addMainEventListeners = function(doc) {}
295 WebInspector.openResource = function(url, external) {}
297 WebInspector.showConsole = function() {}
300 * @param {string} expression
301 * @param {boolean=} showResultOnly
303 WebInspector.evaluateInConsole = function(expression, showResultOnly) {}
305 WebInspector.queryParamsObject = {}
308 * @param {Element} element
311 WebInspector.showAnchorLocation = function(element) {}
313 WebInspector.Events = {
314 InspectorLoaded: "InspectorLoaded",
315 InspectorClosing: "InspectorClosing"
318 /** @type {WebInspector.SettingsController} */
319 WebInspector.settingsController;
321 /** Extensions API */
324 function AuditCategory() {}
326 function AuditResult() {}
328 function EventSink() {}
330 function ExtensionSidebarPane() {}
334 function PanelWithSidebar() {}
336 function Request() {}
338 function Resource() {}
340 function Timeline() {}
344 /** @type {string} */
345 Location.prototype.origin = "";
350 function ExtensionDescriptor() {
358 function ExtensionReloadOptions() {
359 this.ignoreCache = false;
360 this.injectedScript = "";
361 this.preprocessingScript = "";
365 WebInspector.showPanel = function(panel)
370 * @param {ExtensionDescriptor} extensionInfo
373 function buildPlatformExtensionAPI(extensionInfo) {}
378 WebInspector.inspectedPageDomain;
380 WebInspector.SourceJavaScriptTokenizer = {}
381 WebInspector.SourceJavaScriptTokenizer.Keywords = {}
386 WebInspector.isInspectingDevice = function() {}
388 var InspectorTest = {}
392 difflib.stringAsLines = function(text) { return []; }
394 difflib.SequenceMatcher = function(baseText, newText) { }
395 difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; }
398 var CodeMirror = function() { }
399 CodeMirror.on = function(obj, type, handler) { }
400 CodeMirror.prototype = {
401 addKeyMap: function(map) { },
402 addLineClass: function(handle, where, cls) { },
403 addLineWidget: function(handle, node, options) { },
405 * @param {string|Object} spec
406 * @param {Object=} options
408 addOverlay: function(spec, options) { },
409 addWidget: function(pos, node, scroll, vert, horiz) { },
410 charCoords: function(pos, mode) { },
411 clearGutter: function(gutterID) { },
412 clearHistory: function() { },
413 clipPos: function(pos) { },
414 coordsChar: function(coords, mode) { },
415 cursorCoords: function(start, mode) { },
416 defaultCharWidth: function() { },
417 defaultTextHeight: function() { },
418 deleteH: function(dir, unit) { },
419 eachLine: function(from, to, op) { },
420 execCommand: function(cmd) { },
421 extendSelection: function(from, to) { },
422 findMarksAt: function(pos) { },
423 findMatchingBracket: function() { },
424 findPosH: function(from, amount, unit, visually) { },
425 findPosV: function(from, amount, unit, goalColumn) { },
426 firstLine: function() { },
427 focus: function() { },
428 getAllMarks: function() { },
429 /** @param {string=} start */
430 getCursor: function(start) { },
431 getDoc: function() { },
432 getGutterElement: function() { },
433 getHistory: function() { },
434 getInputField: function(){ },
435 getLine: function(line) { },
437 * @return {{wrapClass: string}}
439 getLineHandle: function(line) { },
440 getLineNumber: function(line) { },
441 getMode: function() { },
442 getOption: function(option) { },
443 getRange: function(from, to, lineSep) { },
445 * @return {{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
447 getScrollInfo: function() { },
448 getScrollerElement: function() { },
449 getSelection: function() { },
450 getStateAfter: function(line) { },
451 getTokenAt: function(pos) { },
452 getValue: function(lineSep) { },
453 getViewport: function() { },
454 getWrapperElement: function() { },
455 hasFocus: function() { },
456 historySize: function() { },
457 indentLine: function(n, dir, aggressive) { },
458 indentSelection: function(how) { },
459 indexFromPos: function(coords) { },
460 isClean: function() { },
461 iterLinkedDocs: function(f) { },
462 lastLine: function() { },
463 lineCount: function() { },
464 lineInfo: function(line) { },
466 * @param {number} height
467 * @param {string=} mode
469 lineAtHeight: function(height, mode) { },
470 linkedDoc: function(options) { },
471 markClean: function() { },
472 markText: function(from, to, options) { },
473 moveH: function(dir, unit) { },
474 moveV: function(dir, unit) { },
475 off: function(type, f) { },
476 on: function(type, f) { },
477 operation: function(f) { },
478 posFromIndex: function(off) { },
479 redo: function() { },
480 refresh: function() { },
481 removeKeyMap: function(map) { },
482 removeLine: function(line) { },
483 removeLineClass: function(handle, where, cls) { },
484 removeLineWidget: function(widget) { },
485 removeOverlay: function(spec) { },
486 replaceRange: function(code, from, to, origin) { },
487 replaceSelection: function(code, collapse, origin) { },
488 scrollIntoView: function(pos, margin) { },
489 scrollTo: function(x, y) { },
490 setBookmark: function(pos, options) { },
491 setCursor: function(line, ch, extend) { },
492 setExtending: function(val) { },
493 setGutterMarker: function(line, gutterID, value) { },
494 setHistory: function(histData) { },
495 setLine: function(line, text) { },
496 setOption: function(option, value) { },
497 setSelection: function(anchor, head) { },
498 setSize: function(width, height) { },
499 setValue: function(code) { },
500 somethingSelected: function() { },
501 swapDoc: function(doc) { },
502 undo: function() { },
503 unlinkDoc: function(other) { }
505 /** @type {number} */
506 CodeMirror.prototype.lineCount;
508 CodeMirror.showHint = function(codeMirror, hintintFunction) { };
509 CodeMirror.commands = {};
510 CodeMirror.modes = {};
511 CodeMirror.mimeModes = {};
512 CodeMirror.getMode = function(options, spec) { };
513 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) { };
514 CodeMirror.defineMode = function(modeName, modeConstructor) { };
515 CodeMirror.startState = function(mode) { };
518 CodeMirror.Pos = function(line, ch) { }
520 CodeMirror.Pos.prototype.line;
522 CodeMirror.Pos.prototype.ch;
525 CodeMirror.StringStream = function(line)
530 CodeMirror.StringStream.prototype = {
531 backUp: function (n) { },
532 column: function () { },
533 current: function () { },
534 eat: function (match) { },
535 eatSpace: function () { },
536 eatWhile: function (match) { },
537 eol: function () { },
538 indentation: function () { },
540 * @param {RegExp|string} pattern
541 * @param {boolean=} consume
542 * @param {boolean=} caseInsensitive
544 match: function (pattern, consume, caseInsensitive) { },
545 next: function () { },
546 peek: function () { },
547 skipTo: function (ch) { },
548 skipToEnd: function () { },
552 /** @type {Object.<string, Object.<string, string>>} */
555 WebInspector.suggestReload = function() { }
556 WebInspector.reload = function() { }
558 WebInspector.settings.continuousPainting = /** type {WebInspector.Setting} */ { }
559 WebInspector.settings.showDebugBorders = /** type {WebInspector.Setting} */ { }
560 WebInspector.settings.showScrollBottleneckRects = /** type {WebInspector.Setting} */ { }
561 WebInspector.settings.forceCompositingMode = /** type {WebInspector.Setting} */ { }
562 WebInspector.settings.showFPSCounter = /** type {WebInspector.Setting} */ { }
563 WebInspector.settings.showPaintRects = /** type {WebInspector.Setting} */ { }
565 /** @type {boolean} */
566 window.dispatchStandaloneTestRunnerMessages;