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

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

Issue 18347003: DevTools: Implement CSS pretty-printing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 7 years, 2 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
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 23 matching lines...) Expand all
34 WebInspector.Formatter = function() 34 WebInspector.Formatter = function()
35 { 35 {
36 } 36 }
37 37
38 /** 38 /**
39 * @param {WebInspector.ResourceType} contentType 39 * @param {WebInspector.ResourceType} contentType
40 * @return {?WebInspector.Formatter} 40 * @return {?WebInspector.Formatter}
41 */ 41 */
42 WebInspector.Formatter.createFormatter = function(contentType) 42 WebInspector.Formatter.createFormatter = function(contentType)
43 { 43 {
44 if (contentType === WebInspector.resourceTypes.Script || contentType === Web Inspector.resourceTypes.Document) 44 if (contentType === WebInspector.resourceTypes.Script || contentType === Web Inspector.resourceTypes.Document || contentType === WebInspector.resourceTypes.S tylesheet)
45 return new WebInspector.ScriptFormatter(); 45 return new WebInspector.ScriptFormatter();
46 return new WebInspector.IdentityFormatter(); 46 return new WebInspector.IdentityFormatter();
47 } 47 }
48 48
49 /** 49 /**
50 * @param {Array.<number>} lineEndings 50 * @param {Array.<number>} lineEndings
51 * @param {number} lineNumber 51 * @param {number} lineNumber
52 * @param {number} columnNumber 52 * @param {number} columnNumber
53 * @return {number} 53 * @return {number}
54 */ 54 */
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 */ 261 */
262 _convertPosition: function(positions1, positions2, position) 262 _convertPosition: function(positions1, positions2, position)
263 { 263 {
264 var index = positions1.upperBound(position) - 1; 264 var index = positions1.upperBound(position) - 1;
265 var convertedPosition = positions2[index] + position - positions1[index] ; 265 var convertedPosition = positions2[index] + position - positions1[index] ;
266 if (index < positions2.length - 1 && convertedPosition > positions2[inde x + 1]) 266 if (index < positions2.length - 1 && convertedPosition > positions2[inde x + 1])
267 convertedPosition = positions2[index + 1]; 267 convertedPosition = positions2[index + 1];
268 return convertedPosition; 268 return convertedPosition;
269 } 269 }
270 } 270 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/JavaScriptFormatter.js ('k') | Source/devtools/front_end/ScriptFormatterWorker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698