Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1575)

Side by Side Diff: Source/devtools/front_end/externs.js

Issue 334393004: DevTools: Always construct CodeMirror explicitly, via "new" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 // WebKit Web Facing API 31 // WebKit Web Facing API
32 32
33 /** @type {boolean} */ 33 /** @type {boolean} */
34 Event.prototype.isMetaOrCtrlForTest; 34 Event.prototype.isMetaOrCtrlForTest;
35 35
36 /** 36 /**
37 * @constructor
38 * @extends {KeyboardEvent}
39 * @param {string} eventType
40 * @param {!Object=} properties
41 */
42 window.KeyboardEvent = function(eventType, properties) {}
43
44 /**
45 * @type {number} 37 * @type {number}
46 */ 38 */
47 KeyboardEvent.DOM_KEY_LOCATION_NUMPAD; 39 KeyboardEvent.DOM_KEY_LOCATION_NUMPAD;
48 40
41 // FIXME: Remove after the Closure compiler roll.
49 /** @param {*} message */ 42 /** @param {*} message */
50 function postMessage(message) {} 43 function postMessage(message) {}
51 44
52 /** 45 /**
53 * @param {string} eventName 46 * @param {string} eventName
54 * @param {!Function} listener 47 * @param {!Function} listener
55 * @param {boolean=} capturing 48 * @param {boolean=} capturing
56 */ 49 */
57 function addEventListener(eventName, listener, capturing) {} 50 function addEventListener(eventName, listener, capturing) {}
58 51
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 301 }
309 302
310 /* jsdifflib API */ 303 /* jsdifflib API */
311 var difflib = {}; 304 var difflib = {};
312 difflib.stringAsLines = function(text) { return []; } 305 difflib.stringAsLines = function(text) { return []; }
313 /** @constructor */ 306 /** @constructor */
314 difflib.SequenceMatcher = function(baseText, newText) { } 307 difflib.SequenceMatcher = function(baseText, newText) { }
315 difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; } 308 difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; }
316 309
317 /** @constructor */ 310 /** @constructor */
318 var CodeMirror = function() { } 311 var Doc = function() { }
312 Doc.prototype = {
313 /** @type {number} */
314 scrollLeft: 0,
315 /** @type {number} */
316 scrollTop: 0
317 }
318
319 /** @constructor */
320 var CodeMirror = function(element, config) { }
319 CodeMirror.on = function(obj, type, handler) { } 321 CodeMirror.on = function(obj, type, handler) { }
320 CodeMirror.prototype = { 322 CodeMirror.prototype = {
323 /** @type {!Doc} */
324 doc: null,
321 addKeyMap: function(map) { }, 325 addKeyMap: function(map) { },
322 addLineClass: function(handle, where, cls) { }, 326 addLineClass: function(handle, where, cls) { },
327 /** @param {?Object=} options */
323 addLineWidget: function(handle, node, options) { }, 328 addLineWidget: function(handle, node, options) { },
324 /** 329 /**
325 * @param {string|!Object} spec 330 * @param {string|!Object} spec
326 * @param {!Object=} options 331 * @param {!Object=} options
327 */ 332 */
328 addOverlay: function(spec, options) { }, 333 addOverlay: function(spec, options) { },
329 addWidget: function(pos, node, scroll, vert, horiz) { }, 334 addWidget: function(pos, node, scroll, vert, horiz) { },
330 charCoords: function(pos, mode) { }, 335 charCoords: function(pos, mode) { },
331 clearGutter: function(gutterID) { }, 336 clearGutter: function(gutterID) { },
332 clearHistory: function() { }, 337 clearHistory: function() { },
333 clipPos: function(pos) { }, 338 clipPos: function(pos) { },
339 /** @param {string=} mode */
334 coordsChar: function(coords, mode) { }, 340 coordsChar: function(coords, mode) { },
341 /** @param {string=} mode */
335 cursorCoords: function(start, mode) { }, 342 cursorCoords: function(start, mode) { },
336 defaultCharWidth: function() { }, 343 defaultCharWidth: function() { },
337 defaultTextHeight: function() { }, 344 defaultTextHeight: function() { },
338 deleteH: function(dir, unit) { }, 345 deleteH: function(dir, unit) { },
346 /**
347 * @param {*=} to
348 * @param {*=} op
349 */
339 eachLine: function(from, to, op) { }, 350 eachLine: function(from, to, op) { },
340 execCommand: function(cmd) { }, 351 execCommand: function(cmd) { },
341 extendSelection: function(from, to) { }, 352 extendSelection: function(from, to) { },
342 findMarksAt: function(pos) { }, 353 findMarksAt: function(pos) { },
343 findMatchingBracket: function() { }, 354 findMatchingBracket: function() { },
344 findPosH: function(from, amount, unit, visually) { }, 355 findPosH: function(from, amount, unit, visually) { },
345 findPosV: function(from, amount, unit, goalColumn) { }, 356 findPosV: function(from, amount, unit, goalColumn) { },
346 firstLine: function() { }, 357 firstLine: function() { },
347 focus: function() { }, 358 focus: function() { },
348 getAllMarks: function() { }, 359 getAllMarks: function() { },
349 /** @param {string=} start */ 360 /** @param {string=} start */
350 getCursor: function(start) { }, 361 getCursor: function(start) { },
351 getDoc: function() { }, 362 getDoc: function() { },
352 getGutterElement: function() { }, 363 getGutterElement: function() { },
353 getHistory: function() { }, 364 getHistory: function() { },
354 getInputField: function(){ }, 365 getInputField: function(){ },
355 getLine: function(line) { }, 366 getLine: function(line) { },
356 /** 367 /**
357 * @return {!{wrapClass: string}} 368 * @return {!{wrapClass: string}}
358 */ 369 */
359 getLineHandle: function(line) { }, 370 getLineHandle: function(line) { },
360 getLineNumber: function(line) { }, 371 getLineNumber: function(line) { },
361 getMode: function() { }, 372 getMode: function() { },
362 getOption: function(option) { }, 373 getOption: function(option) { },
374 /** @param {*=} lineSep */
363 getRange: function(from, to, lineSep) { }, 375 getRange: function(from, to, lineSep) { },
364 /** 376 /**
365 * @return {!{left: number, top: number, width: number, height: number, clie ntWidth: number, clientHeight: number}} 377 * @return {!{left: number, top: number, width: number, height: number, clie ntWidth: number, clientHeight: number}}
366 */ 378 */
367 getScrollInfo: function() { }, 379 getScrollInfo: function() { },
368 getScrollerElement: function() { }, 380 getScrollerElement: function() { },
369 getSelection: function() { }, 381 getSelection: function() { },
370 getSelections: function() { }, 382 getSelections: function() { },
371 getStateAfter: function(line) { }, 383 getStateAfter: function(line) { },
372 getTokenAt: function(pos) { }, 384 getTokenAt: function(pos) { },
385 /** @param {*=} lineSep */
373 getValue: function(lineSep) { }, 386 getValue: function(lineSep) { },
374 getViewport: function() { }, 387 getViewport: function() { },
375 getWrapperElement: function() { }, 388 getWrapperElement: function() { },
376 hasFocus: function() { }, 389 hasFocus: function() { },
377 historySize: function() { }, 390 historySize: function() { },
378 indentLine: function(n, dir, aggressive) { }, 391 indentLine: function(n, dir, aggressive) { },
379 indentSelection: function(how) { }, 392 indentSelection: function(how) { },
380 indexFromPos: function(coords) { }, 393 indexFromPos: function(coords) { },
381 isClean: function() { }, 394 isClean: function() { },
382 iterLinkedDocs: function(f) { }, 395 iterLinkedDocs: function(f) { },
(...skipping 15 matching lines...) Expand all
398 on: function(type, f) { }, 411 on: function(type, f) { },
399 operation: function(f) { }, 412 operation: function(f) { },
400 posFromIndex: function(off) { }, 413 posFromIndex: function(off) { },
401 redo: function() { }, 414 redo: function() { },
402 refresh: function() { }, 415 refresh: function() { },
403 removeKeyMap: function(map) { }, 416 removeKeyMap: function(map) { },
404 removeLine: function(line) { }, 417 removeLine: function(line) { },
405 removeLineClass: function(handle, where, cls) { }, 418 removeLineClass: function(handle, where, cls) { },
406 removeLineWidget: function(widget) { }, 419 removeLineWidget: function(widget) { },
407 removeOverlay: function(spec) { }, 420 removeOverlay: function(spec) { },
421 /** @param {*=} origin */
408 replaceRange: function(code, from, to, origin) { }, 422 replaceRange: function(code, from, to, origin) { },
409 replaceSelection: function(code, collapse, origin) { }, 423 replaceSelection: function(code, collapse, origin) { },
424 /** @param {*=} margin */
410 scrollIntoView: function(pos, margin) { }, 425 scrollIntoView: function(pos, margin) { },
411 scrollTo: function(x, y) { }, 426 scrollTo: function(x, y) { },
412 setBookmark: function(pos, options) { }, 427 setBookmark: function(pos, options) { },
413 setCursor: function(line, ch, extend) { }, 428 setCursor: function(line, ch, extend) { },
414 setExtending: function(val) { }, 429 setExtending: function(val) { },
415 setGutterMarker: function(line, gutterID, value) { }, 430 setGutterMarker: function(line, gutterID, value) { },
416 setHistory: function(histData) { }, 431 setHistory: function(histData) { },
417 setLine: function(line, text) { }, 432 setLine: function(line, text) { },
418 setOption: function(option, value) { }, 433 setOption: function(option, value) { },
419 setSelection: function(anchor, head) { }, 434 setSelection: function(anchor, head) { },
420 setSelections: function(selections) { }, 435 /**
436 * @param {number=} primaryIndex
437 * @param {?Object=} config
438 */
439 setSelections: function(selections, primaryIndex, config) { },
421 setSize: function(width, height) { }, 440 setSize: function(width, height) { },
422 setValue: function(code) { }, 441 setValue: function(code) { },
423 somethingSelected: function() { }, 442 somethingSelected: function() { },
424 swapDoc: function(doc) { }, 443 swapDoc: function(doc) { },
425 undo: function() { }, 444 undo: function() { },
426 unlinkDoc: function(other) { } 445 unlinkDoc: function(other) { }
427 } 446 }
428 /** @type {!{cursorDiv: Element}} */ 447 /** @type {!{cursorDiv: Element}} */
429 CodeMirror.prototype.display; 448 CodeMirror.prototype.display;
449 /** @type {!Object} */
430 CodeMirror.Pass; 450 CodeMirror.Pass;
431 CodeMirror.showHint = function(codeMirror, hintintFunction) { }; 451 CodeMirror.showHint = function(codeMirror, hintintFunction) { };
432 CodeMirror.commands = {}; 452 CodeMirror.commands = {};
433 CodeMirror.modes = {}; 453 CodeMirror.modes = {};
434 CodeMirror.mimeModes = {}; 454 CodeMirror.mimeModes = {};
435 CodeMirror.getMode = function(options, spec) { }; 455 CodeMirror.getMode = function(options, spec) { };
436 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) { }; 456 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) { };
437 CodeMirror.defineMode = function(modeName, modeConstructor) { }; 457 CodeMirror.defineMode = function(modeName, modeConstructor) { };
438 CodeMirror.startState = function(mode) { }; 458 CodeMirror.startState = function(mode) { };
439 459
440 /** @constructor */ 460 /** @constructor */
441 CodeMirror.Pos = function(line, ch) { } 461 CodeMirror.Pos = function(line, ch) { }
442 /** type {number} */ 462 /** @type {number} */
443 CodeMirror.Pos.prototype.line; 463 CodeMirror.Pos.prototype.line;
444 /** type {number} */ 464 /** @type {number} */
445 CodeMirror.Pos.prototype.ch; 465 CodeMirror.Pos.prototype.ch;
446 466
447 /** @constructor */ 467 /** @constructor */
448 CodeMirror.StringStream = function(line) 468 CodeMirror.StringStream = function(line)
449 { 469 {
450 this.pos = 0; 470 this.pos = 0;
451 this.start = 0; 471 this.start = 0;
452 } 472 }
453 CodeMirror.StringStream.prototype = { 473 CodeMirror.StringStream.prototype = {
454 backUp: function (n) { }, 474 backUp: function (n) { },
(...skipping 27 matching lines...) Expand all
482 * @constructor 502 * @constructor
483 * @extends {Event} 503 * @extends {Event}
484 */ 504 */
485 function ErrorEvent() {} 505 function ErrorEvent() {}
486 506
487 /** @type {string} */ 507 /** @type {string} */
488 ErrorEvent.prototype.message; 508 ErrorEvent.prototype.message;
489 509
490 /** @type {boolean} */ 510 /** @type {boolean} */
491 window.dispatchStandaloneTestRunnerMessages; 511 window.dispatchStandaloneTestRunnerMessages;
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698