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

Unified Diff: third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js

Issue 1894343002: DevTools: pretty-print HTML (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
index 3d1d266e87bf651ba976c86638bff39fec856255..109f3eac5a6cc11d98f7ce62b4a094967fd305b9 100644
--- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
+++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormattedContentBuilder.js
@@ -62,6 +62,9 @@ WebInspector.FormattedContentBuilder.prototype = {
*/
addNewLine: function(noSquash)
{
+ // Avoid leading newlines.
+ if (!this._formattedContentLength)
+ return;
if (noSquash)
++this._newLines;
else

Powered by Google App Engine
This is Rietveld 408576698