Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 4, 2017
1 parent b2b18fe commit f12c6a8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
23 changes: 15 additions & 8 deletions lighthouse-core/audits/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Audit {
* Table cells will use the type specified in headings[x].itemType. However a custom type
* can be provided: results[x].propName = {type: 'code', text: '...'}
* @param {!Audit.Headings} headings
* @param {!Array<!Object<string, string>>} results
* @param {!Array<!Object<string, *>>} results
* @return {!Array<!DetailsRenderer.DetailsJSON>}
*/
static makeV2TableRows(headings, results) {
Expand Down Expand Up @@ -157,13 +157,20 @@ class Audit {

module.exports = Audit;

/** @typedef {
* !Array<{
* key: string,
* itemType: string,
* text: string,
* }>}
*/
Audit.Headings; // eslint-disable-line no-unused-expressions

/** @typedef {{
* key: string,
* itemType: string,
* text: string,
* results: !Array<!Object<string, string>>,
* headings: !Audit.Headings,
* passes: boolean,
* debugString: (string|undefined)
* }}
*/
Audit.Heading; // eslint-disable-line no-unused-expressions

/** @typedef {!Array<!Audit.Heading>} */
Audit.Headings; // eslint-disable-line no-unused-expressions
Audit.HeadingsResult; // eslint-disable-line no-unused-expressions
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class UnusedBytes extends Audit {
}

/**
* @param {!{debugString: string=, passes: boolean=, headings: !Audit.Headings,
* results: !Array<!Object<string, string>>}} result
* @param {!Audit.HeadingsResult} result
* @param {number} networkThroughput
* @return {!AuditResult}
*/
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/byte-efficiency/offscreen-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class OffscreenImages extends ByteEfficiencyAudit {

/**
* @param {!Artifacts} artifacts
* @return {{results: !Array<Object>, headings: !Audit.Headings, debugString: string=}}
* @return {!Audit.HeadingsResult}
*/
static audit_(artifacts) {
const images = artifacts.ImageUsage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class UsesOptimizedImages extends ByteEfficiencyAudit {

/**
* @param {!Artifacts} artifacts
* @return {{results: !Array<Object>, headings: !Audit.Headings, passes: boolean=, debugString: string=}}
* @return {!Audit.HeadingsResult}
*/
static audit_(artifacts) {
const images = artifacts.OptimizedImages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ResponsesAreCompressed extends ByteEfficiencyAudit {
/**
* @param {!Artifacts} artifacts
* @param {number} networkThroughput
* @return {{results: !Array<Object>, passes: boolean=, headings: !Audit.Headings, debugString: string=}}
* @return {!Audit.HeadingsResult}
*/
static audit_(artifacts) {
const uncompressedResponses = artifacts.ResponseCompression;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class UsesResponsiveImages extends ByteEfficiencyAudit {

/**
* @param {!Artifacts} artifacts
* @return {{results: !Array<Object>, headings: !Audit.Headings, passes: boolean=, debugString: string=}}
* @return {!Audit.HeadingsResult}
*/
static audit_(artifacts) {
const images = artifacts.ImageUsage;
Expand Down
4 changes: 3 additions & 1 deletion lighthouse-core/report/v2/renderer/details-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class DetailsRenderer {
}

/**
* Create small thumbnail with scaled down image asset.
* If the supplied details doesn't have an image/* mimeType, then an empty span is returned.
* @param {!DetailsRenderer.ThumbnailDetails} value
* @return {!Element}
*/
Expand All @@ -80,7 +82,7 @@ class DetailsRenderer {

const element = this._dom.createElement('img', 'lh-thumbnail');
element.src = value.url;
element.alt = 'Image preview';
element.alt = '';
element.title = value.url;
return element;
}
Expand Down

0 comments on commit f12c6a8

Please sign in to comment.