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

Side by Side Diff: Source/WebCore/inspector/front-end/TextViewer.js

Issue 7037012: Merge 86683 - 2011-05-17 Pavel Feldman <pfeldman@google.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 this._gutterPanel.removeDecoration(lineNumber, decoration); 101 this._gutterPanel.removeDecoration(lineNumber, decoration);
102 }, 102 },
103 103
104 markAndRevealRange: function(range) 104 markAndRevealRange: function(range)
105 { 105 {
106 this._mainPanel.markAndRevealRange(range); 106 this._mainPanel.markAndRevealRange(range);
107 }, 107 },
108 108
109 highlightLine: function(lineNumber) 109 highlightLine: function(lineNumber)
110 { 110 {
111 if (typeof lineNumber !== "number" || lineNumber < 0)
112 return;
113
111 this._mainPanel.highlightLine(lineNumber); 114 this._mainPanel.highlightLine(lineNumber);
112 }, 115 },
113 116
114 clearLineHighlight: function() 117 clearLineHighlight: function()
115 { 118 {
116 this._mainPanel.clearLineHighlight(); 119 this._mainPanel.clearLineHighlight();
117 }, 120 },
118 121
119 freeCachedElements: function() 122 freeCachedElements: function()
120 { 123 {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 402
400 this._repaintAll(); 403 this._repaintAll();
401 404
402 this.endDomUpdates(); 405 this.endDomUpdates();
403 }, 406 },
404 407
405 makeLineAChunk: function(lineNumber) 408 makeLineAChunk: function(lineNumber)
406 { 409 {
407 var chunkNumber = this._chunkNumberForLine(lineNumber); 410 var chunkNumber = this._chunkNumberForLine(lineNumber);
408 var oldChunk = this._textChunks[chunkNumber]; 411 var oldChunk = this._textChunks[chunkNumber];
412
413 if (!oldChunk) {
414 console.error("No chunk for line number: " + lineNumber);
415 return;
416 }
417
409 if (oldChunk.linesCount === 1) 418 if (oldChunk.linesCount === 1)
410 return oldChunk; 419 return oldChunk;
411 420
412 return this._splitChunkOnALine(lineNumber, chunkNumber); 421 return this._splitChunkOnALine(lineNumber, chunkNumber);
413 }, 422 },
414 423
415 _splitChunkOnALine: function(lineNumber, chunkNumber) 424 _splitChunkOnALine: function(lineNumber, chunkNumber)
416 { 425 {
417 this.beginDomUpdates(); 426 this.beginDomUpdates();
418 427
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 lines.push(this._textModel.line(i)); 1903 lines.push(this._textModel.line(i));
1895 1904
1896 this.element.removeChildren(); 1905 this.element.removeChildren();
1897 this.element.textContent = lines.join("\n"); 1906 this.element.textContent = lines.join("\n");
1898 1907
1899 // The last empty line will get swallowed otherwise. 1908 // The last empty line will get swallowed otherwise.
1900 if (!lines[lines.length - 1]) 1909 if (!lines[lines.length - 1])
1901 this.element.appendChild(document.createElement("br")); 1910 this.element.appendChild(document.createElement("br"));
1902 } 1911 }
1903 } 1912 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698