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

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

Issue 1835783002: DevTools: simplify WI.FormattedContentBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline tests Created 4 years, 9 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/CSSFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js
index 5743e0deb583ba6a9354772beda0e18f997a0bbb..3476327b90b092d2e41802884529879bd07c5746 100644
--- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/CSSFormatter.js
@@ -59,14 +59,11 @@ WebInspector.CSSFormatter.prototype = {
* @param {string} token
* @param {?string} type
* @param {number} startPosition
- * @param {number} endPosition
*/
- _tokenCallback: function(token, type, startPosition, endPosition)
+ _tokenCallback: function(token, type, startPosition)
{
startPosition += this._fromOffset;
- endPosition += this._fromOffset;
var startLine = this._lineEndings.lowerBound(startPosition);
- var endLine = this._lineEndings.lowerBound(endPosition);
if (startLine !== this._lastLine)
this._state.eatWhitespace = true;
if (/^property/.test(type) && !this._state.inPropertyValue)
@@ -94,7 +91,7 @@ WebInspector.CSSFormatter.prototype = {
this._state.afterClosingBrace = true;
this._state.inPropertyValue = false;
} else if (token === ":" && !this._state.inPropertyValue && this._state.seenProperty) {
- this._builder.addToken(token, startPosition, startLine, endLine);
+ this._builder.addToken(token, startPosition);
this._builder.addSoftSpace();
this._state.eatWhitespace = true;
this._state.inPropertyValue = true;
@@ -102,13 +99,13 @@ WebInspector.CSSFormatter.prototype = {
return;
} else if (token === "{") {
this._builder.addSoftSpace();
- this._builder.addToken(token, startPosition, startLine, endLine);
+ this._builder.addToken(token, startPosition);
this._builder.addNewLine();
this._builder.increaseNestingLevel();
return;
}
- this._builder.addToken(token, startPosition, startLine, endLine);
+ this._builder.addToken(token, startPosition);
if (type === "comment" && !this._state.inPropertyValue && !this._state.seenProperty)
this._builder.addNewLine();

Powered by Google App Engine
This is Rietveld 408576698