Skip to content

Commit

Permalink
feedback and align with 2002
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Apr 14, 2017
1 parent 74cc732 commit 8bed784
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions lighthouse-core/report/v2/renderer/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class DOM {
*/
constructor(document) {
this._document = document;
this.templatesContext = this._document;
}

/**
Expand All @@ -48,21 +49,13 @@ class DOM {
* @throws {Error}
*/
cloneTemplate(selector) {
const template = this._retrieveTemplate(selector);
const template = this.templatesContext.querySelector(selector);
if (!template) {
throw new Error(`Template not found: template${selector}`);
}
return this._document.importNode(template.content, true);
}

/**
* @param {string} selector
* @return {!DocumentFragment} The original template content
*/
_retrieveTemplate(selector) {
return this._document.querySelector(selector);
}

/**
* @param {string} text
* @return {!HTMLSpanElement}
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/report/v2/renderer/report-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function formatNumber(number) {

class ReportRenderer {
/**
* @param {!DOM} DOM
* @param {!DetailsRenderer} DetailsRenderer
* @param {!DOM} dom
* @param {!DetailsRenderer} detailsRenderer
*/
constructor(dom, detailsRenderer) {
this._dom = dom;
Expand Down

0 comments on commit 8bed784

Please sign in to comment.