OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 { | 339 { |
340 this._viewport.refresh(); | 340 this._viewport.refresh(); |
341 if (!this._prompt.isCaretInsidePrompt()) | 341 if (!this._prompt.isCaretInsidePrompt()) |
342 this._prompt.moveCaretToEndOfPrompt(); | 342 this._prompt.moveCaretToEndOfPrompt(); |
343 }, | 343 }, |
344 | 344 |
345 focus: function() | 345 focus: function() |
346 { | 346 { |
347 if (this._promptElement === WebInspector.currentFocusElement()) | 347 if (this._promptElement === WebInspector.currentFocusElement()) |
348 return; | 348 return; |
| 349 // Set caret position before setting focus in order to avoid scrolling |
| 350 // by focus(). |
| 351 this._prompt.moveCaretToEndOfPrompt(); |
349 WebInspector.setCurrentFocusElement(this._promptElement); | 352 WebInspector.setCurrentFocusElement(this._promptElement); |
350 this._prompt.moveCaretToEndOfPrompt(); | |
351 }, | 353 }, |
352 | 354 |
353 restoreScrollPositions: function() | 355 restoreScrollPositions: function() |
354 { | 356 { |
355 if (this._viewport.scrolledToBottom()) | 357 if (this._viewport.scrolledToBottom()) |
356 this._immediatelyScrollToBottom(); | 358 this._immediatelyScrollToBottom(); |
357 else | 359 else |
358 WebInspector.Widget.prototype.restoreScrollPositions.call(this); | 360 WebInspector.Widget.prototype.restoreScrollPositions.call(this); |
359 }, | 361 }, |
360 | 362 |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 return true; | 1322 return true; |
1321 } | 1323 } |
1322 return false; | 1324 return false; |
1323 } | 1325 } |
1324 } | 1326 } |
1325 | 1327 |
1326 /** | 1328 /** |
1327 * @typedef {{messageIndex: number, matchIndex: number}} | 1329 * @typedef {{messageIndex: number, matchIndex: number}} |
1328 */ | 1330 */ |
1329 WebInspector.ConsoleView.RegexMatchRange; | 1331 WebInspector.ConsoleView.RegexMatchRange; |
OLD | NEW |