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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js

Issue 2492343002: Devtools: Pretty print fix for CSS coverage decorations. (Closed)
Patch Set: Pretty print fix for CSS coverage decorations. Created 4 years, 1 month 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/components_lazy/CoverageProfile.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js b/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js
index e397119eae4b77ff588efc95f3269686d0bff4b9..618661506945cd52f83f8d4ab8a312970eccb695 100644
--- a/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js
+++ b/third_party/WebKit/Source/devtools/front_end/components_lazy/CoverageProfile.js
@@ -20,7 +20,7 @@ Components.CoverageProfile = class {
/**
* @param {string} url
- * @param {!Protocol.CSS.SourceRange} range
+ * @param {!Common.TextRange} range
*/
appendUnusedRule(url, range) {
if (!url)
@@ -30,8 +30,9 @@ Components.CoverageProfile = class {
if (!uiSourceCode)
return;
valih 2016/11/15 18:56:24 range.startColumn is the first position after the
- for (var line = range.startLine; line <= range.endLine; ++line)
- uiSourceCode.addLineDecoration(line, Components.CoverageProfile.LineDecorator.type, range.startColumn);
+ if (range.startColumn)
+ range.startColumn--;
+ uiSourceCode.addDecoration(range, Components.CoverageProfile.LineDecorator.type, 0);
}
reset() {
@@ -59,9 +60,11 @@ Components.CoverageProfile.LineDecorator = class {
textEditor.installGutter(gutterType, false);
- for (var decoration of decorations.values()) {
- var element = createElementWithClass('div', 'text-editor-line-marker-coverage');
- textEditor.setGutterDecoration(decoration.line(), gutterType, element);
+ for (var decoration of decorations.keys()) {
+ for (var line = decoration.startLine; line <= decoration.endLine; ++line) {
+ var element = createElementWithClass('div', 'text-editor-line-marker-coverage');
+ textEditor.setGutterDecoration(line, gutterType, element);
+ }
}
}
};

Powered by Google App Engine
This is Rietveld 408576698