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

Unified Diff: third_party/WebKit/Source/devtools/front_end/common/TextRange.js

Issue 1943763002: DevTools: [SASS] fix CSSWorkspaceBinding.propertyUILocation to account for comments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@super-sass
Patch Set: fix tests 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/common/TextRange.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js
index 8728e05825f64122e78c53f4e2c0ab0633b25fe6..e411b6157fee2af3713760bfa3d211f634f25178 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js
+++ b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js
@@ -311,32 +311,6 @@ WebInspector.SourceRange = function(offset, length)
this.length = length;
}
-WebInspector.SourceRange.prototype = {
- /**
- * @param {!WebInspector.Text} text
- * @return {!WebInspector.TextRange}
- */
- toTextRange: function(text)
- {
- var p1 = fromOffset(text, this.offset);
- var p2 = fromOffset(text, this.offset + this.length);
- return new WebInspector.TextRange(p1.lineNumber, p1.columnNumber, p2.lineNumber, p2.columnNumber);
-
- /**
- * @param {!WebInspector.Text} text
- * @param {number} offset
- * @return {!{lineNumber: number, columnNumber: number}}
- */
- function fromOffset(text, offset)
- {
- var lineEndings = text.lineEndings();
- var lineNumber = lineEndings.lowerBound(offset);
- var columnNumber = lineNumber === 0 ? offset : offset - lineEndings[lineNumber - 1] - 1;
- return {lineNumber: lineNumber, columnNumber: columnNumber};
- }
- }
-}
-
/**
* @constructor
* @param {string} sourceURL

Powered by Google App Engine
This is Rietveld 408576698