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

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

Issue 2023183002: DevTools: fix css pretty-print. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dfc4efae869fe0549ff0b3ef39ffdb949d9d8be4 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();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698