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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2863533002: DevTools: Roll lighthouse w/ artifact delivery (Closed)
Patch Set: extra roll of css tweaks 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Tree.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 /** 5 /**
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar { 8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
9 constructor() { 9 constructor() {
10 super('audits2'); 10 super('audits2');
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 this._reportContainer.remove(); 493 this._reportContainer.remove();
494 } 494 }
495 495
496 _renderReport() { 496 _renderReport() {
497 this._resultsView.removeChildren(); 497 this._resultsView.removeChildren();
498 if (this._reportContainer) { 498 if (this._reportContainer) {
499 this._resultsView.appendChild(this._reportContainer); 499 this._resultsView.appendChild(this._reportContainer);
500 return; 500 return;
501 } 501 }
502 502
503 this._reportContainer = this._resultsView.createChild('div', 'report-contain er lh-root'); 503 this._reportContainer = this._resultsView.createChild('div', 'report-contain er lh-vars lh-root');
504 504
505 var dom = new DOM(/** @type {!Document} */ (this._resultsView.ownerDocument) ); 505 var dom = new DOM(/** @type {!Document} */ (this._resultsView.ownerDocument) );
506 var detailsRenderer = new DetailsRenderer(dom); 506 var detailsRenderer = new DetailsRenderer(dom);
507 var categoryRenderer = new CategoryRenderer(dom, detailsRenderer); 507 var categoryRenderer = new CategoryRenderer(dom, detailsRenderer);
508 var renderer = new Audits2.Audits2Panel.ReportRenderer(dom, categoryRenderer ); 508 var renderer = new Audits2.Audits2Panel.ReportRenderer(dom, categoryRenderer );
509 509
510 var templatesHTML = Runtime.cachedResources['audits2/lighthouse/templates.ht ml']; 510 var templatesHTML = Runtime.cachedResources['audits2/lighthouse/templates.ht ml'];
511 var templatesDOM = new DOMParser().parseFromString(templatesHTML, 'text/html '); 511 var templatesDOM = new DOMParser().parseFromString(templatesHTML, 'text/html ');
512 if (!templatesDOM) 512 if (!templatesDOM)
513 return; 513 return;
514 514
515 renderer.setTemplateContext(templatesDOM); 515 renderer.setTemplateContext(templatesDOM);
516 renderer.renderReport(this._lighthouseResult, this._reportContainer); 516 renderer.renderReport(this._lighthouseResult, this._reportContainer);
517 } 517 }
518 }; 518 };
519 519
520 Audits2.Audits2Panel.TreeSubElement = class extends UI.TreeElement { 520 Audits2.Audits2Panel.TreeSubElement = class extends UI.TreeElement {
521 /** 521 /**
522 * @param {string} id 522 * @param {string} id
523 * @param {string} name 523 * @param {string} name
524 * @param {number} score 524 * @param {number} score
525 */ 525 */
526 constructor(id, name, score) { 526 constructor(id, name, score) {
527 super(''); 527 super('');
528 this._id = id; 528 this._id = id;
529 this.listItemElement.textContent = name; 529 this.listItemElement.textContent = name;
530 var label = Util.calculateRating(score); 530 var label = Util.calculateRating(score);
531 var subtitleElement = this.listItemElement.createChild('span', 'lh-root audi ts2-tree-subtitle-' + label); 531 var subtitleElement = this.listItemElement.createChild('span', 'lh-vars audi ts2-tree-subtitle-' + label);
532 subtitleElement.textContent = String(Math.round(score)); 532 subtitleElement.textContent = String(Math.round(score));
533 } 533 }
534 534
535 /** 535 /**
536 * @override 536 * @override
537 * @return {boolean} 537 * @return {boolean}
538 */ 538 */
539 onselect() { 539 onselect() {
540 this.parent._renderReport(); 540 this.parent._renderReport();
541 var node = this.parent._resultsView.querySelector('.lh-category[id=' + this. _id + ']'); 541 var node = this.parent._resultsView.querySelector('.lh-category[id=' + this. _id + ']');
542 if (node) { 542 if (node) {
543 node.scrollIntoView(true); 543 node.scrollIntoView(true);
544 return true; 544 return true;
545 } 545 }
546 return false; 546 return false;
547 } 547 }
548 }; 548 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Tree.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698