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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/coverage/CoverageListView.js

Issue 2861393004: DevTools/Coverage: fix decorations in HTML (Closed)
Patch Set: reverted toFixedIfFloating() changes Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Coverage.CoverageListView = class extends UI.VBox { 5 Coverage.CoverageListView = class extends UI.VBox {
6 constructor() { 6 constructor() {
7 super(true); 7 super(true);
8 /** @type {!Map<!Coverage.URLCoverageInfo, !Coverage.CoverageListView.GridNo de>} */ 8 /** @type {!Map<!Coverage.URLCoverageInfo, !Coverage.CoverageListView.GridNo de>} */
9 this._nodeForCoverageInfo = new Map(); 9 this._nodeForCoverageInfo = new Map();
10 this.registerRequiredCSS('coverage/coverageListView.css'); 10 this.registerRequiredCSS('coverage/coverageListView.css');
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 case 'unusedSize': 236 case 'unusedSize':
237 var unusedSize = this._coverageInfo.unusedSize() || 0; 237 var unusedSize = this._coverageInfo.unusedSize() || 0;
238 var unusedSizeSpan = cell.createChild('span'); 238 var unusedSizeSpan = cell.createChild('span');
239 var unusedPercentsSpan = cell.createChild('span', 'percent-value'); 239 var unusedPercentsSpan = cell.createChild('span', 'percent-value');
240 unusedSizeSpan.textContent = Number.withThousandsSeparator(unusedSize); 240 unusedSizeSpan.textContent = Number.withThousandsSeparator(unusedSize);
241 unusedPercentsSpan.textContent = Common.UIString('%.1f\xa0%%', unusedSiz e / this._coverageInfo.size() * 100); 241 unusedPercentsSpan.textContent = Common.UIString('%.1f\xa0%%', unusedSiz e / this._coverageInfo.size() * 100);
242 break; 242 break;
243 case 'bars': 243 case 'bars':
244 var barContainer = cell.createChild('div', 'bar-container'); 244 var barContainer = cell.createChild('div', 'bar-container');
245 var unusedSizeBar = barContainer.createChild('div', 'bar bar-unused-size '); 245 var unusedSizeBar = barContainer.createChild('div', 'bar bar-unused-size ');
246 unusedSizeBar.style.width = Math.ceil(100 * this._coverageInfo.unusedSiz e() / this._maxSize) + '%'; 246 unusedSizeBar.style.width = (100 * this._coverageInfo.unusedSize() / thi s._maxSize).toFixed(4) + '%';
247 var usedSizeBar = barContainer.createChild('div', 'bar bar-used-size'); 247 var usedSizeBar = barContainer.createChild('div', 'bar bar-used-size');
248 usedSizeBar.style.width = Math.floor(100 * this._coverageInfo.usedSize() / this._maxSize) + '%'; 248 usedSizeBar.style.width = (100 * this._coverageInfo.usedSize() / this._m axSize).toFixed(4) + '%';
249 } 249 }
250 return cell; 250 return cell;
251 } 251 }
252 }; 252 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698