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

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

Issue 2028863002: DevTools: fix css pretty-print. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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 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 109f3eac5a6cc11d98f7ce62b4a094967fd305b9..d11977ae2b55f6cb34219f3af9879179c0c5ed71 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
@@ -25,17 +25,29 @@ WebInspector.FormattedContentBuilder = function(indentString)
this._newLines = 0;
this._softSpace = false;
this._hardSpaces = 0;
+ this._enforceSpaceBetweenWords = true;
}
WebInspector.FormattedContentBuilder.prototype = {
/**
+ * @param {boolean} value
+ * @return {boolean}
+ */
+ setEnforceSpaceBetweenWords: function(value)
+ {
+ var oldValue = this._enforceSpaceBetweenWords;
+ this._enforceSpaceBetweenWords = value;
+ return oldValue;
+ },
+
+ /**
* @param {string} token
* @param {number} offset
*/
addToken: function(token, offset)
{
var last = this._formattedContent.peekLast();
- if (last && /\w/.test(last[last.length - 1]) && /\w/.test(token))
+ if (this._enforceSpaceBetweenWords && last && /\w/.test(last[last.length - 1]) && /\w/.test(token))
this.addSoftSpace();
this._appendFormatting();

Powered by Google App Engine
This is Rietveld 408576698