diff --git a/lighthouse-core/report/v2/renderer/details-renderer.js b/lighthouse-core/report/v2/renderer/details-renderer.js index 507a377531b4..1c8a870e9457 100644 --- a/lighthouse-core/report/v2/renderer/details-renderer.js +++ b/lighthouse-core/report/v2/renderer/details-renderer.js @@ -38,8 +38,6 @@ class DetailsRenderer { return this._renderURL(details); case 'thumbnail': return this._renderThumbnail(details); - case 'block': - return this._renderBlock(details); case 'cards': return this._renderCards(/** @type {!DetailsRenderer.CardsDetailsJSON} */ (details)); case 'table': @@ -72,12 +70,12 @@ class DetailsRenderer { } /** - * @param {!DetailsRenderer.ThumbnailDetails} obj - * @return {!DocumentFragment} + * @param {!DetailsRenderer.ThumbnailDetails} value + * @return {!Element} */ _renderThumbnail(value) { if (/^image/.test(value.mimeType) === false) { - return this.dom.createDocumentFragment(); + return this._dom.createElement('span'); } const element = this._dom.createElement('img', 'lh-thumbnail'); @@ -87,19 +85,6 @@ class DetailsRenderer { return element; } - /** - * @param {!DetailsRenderer.DetailsJSON} block - * @return {!Element} - */ - _renderBlock(block) { - const element = this._dom.createElement('div', 'lh-block'); - const items = block.items || []; - for (const item of items) { - element.appendChild(this.render(item)); - } - return element; - } - /** * @param {!DetailsRenderer.ListDetailsJSON} list * @return {!Element} @@ -123,10 +108,10 @@ class DetailsRenderer { /** * @param {!DetailsRenderer.TableDetailsJSON} details - * @return {!DocumentFragment} + * @return {!Element} */ _renderTable(details) { - if (!details.items.length) return this._dom.createDocumentFragment(); + if (!details.items.length) return this._dom.createElement('span'); const element = this._dom.createElement('details', 'lh-details'); if (details.header) { @@ -216,7 +201,7 @@ DetailsRenderer.CardsDetailsJSON; // eslint-disable-line no-unused-expressions /** @typedef {{ * type: string, * header: ({text: string}|undefined), - * items: !Array, + * items: !Array>, * itemHeaders: !Array * }} */ diff --git a/lighthouse-core/report/v2/renderer/dom.js b/lighthouse-core/report/v2/renderer/dom.js index 3647bd14943c..3b96b4b28460 100644 --- a/lighthouse-core/report/v2/renderer/dom.js +++ b/lighthouse-core/report/v2/renderer/dom.js @@ -63,13 +63,6 @@ class DOM { return element; } - /** - * @return {!DocumentFragment} - */ - createDocumentFragment() { - return this._document.createDocumentFragment(); - } - /** * @param {string} selector * @param {!Node} context