Skip to content

Commit

Permalink
core(image-size-responsive): remove elidedUrl, elide url property ins…
Browse files Browse the repository at this point in the history
…tead (#13226)

Co-authored-by: Adam Raine <[email protected]>
  • Loading branch information
prerana1821 and adamraine authored Oct 29, 2021
1 parent 0ce0539 commit 4da2012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lighthouse-core/audits/image-size-responsive.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const LARGE_IMAGE_FACTOR = 0.75;
// considered SMALL.
const SMALL_IMAGE_THRESHOLD = 64;

/** @typedef {{url: string, node: LH.Audit.Details.NodeValue, elidedUrl: string, displayedSize: string, actualSize: string, actualPixels: number, expectedSize: string, expectedPixels: number}} Result */
/** @typedef {{url: string, node: LH.Audit.Details.NodeValue, displayedSize: string, actualSize: string, actualPixels: number, expectedSize: string, expectedPixels: number}} Result */

/**
* @param {{top: number, bottom: number, left: number, right: number}} imageRect
Expand Down Expand Up @@ -146,9 +146,8 @@ function getResult(image, DPR) {
const [expectedWidth, expectedHeight] =
expectedImageSize(image.displayedWidth, image.displayedHeight, DPR);
return {
url: image.src,
url: URL.elideDataURI(image.src),
node: Audit.makeNodeItem(image.node),
elidedUrl: URL.elideDataURI(image.src),
displayedSize: `${image.displayedWidth} x ${image.displayedHeight}`,
actualSize: `${image.naturalDimensions.width} x ${image.naturalDimensions.height}`,
actualPixels: image.naturalDimensions.width * image.naturalDimensions.height,
Expand Down Expand Up @@ -265,7 +264,7 @@ class ImageSizeResponsive extends Audit {
/** @type {LH.Audit.Details.Table['headings']} */
const headings = [
{key: 'node', itemType: 'node', text: ''},
{key: 'elidedUrl', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
{key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)},
{key: 'displayedSize', itemType: 'text', text: str_(UIStrings.columnDisplayed)},
{key: 'actualSize', itemType: 'text', text: str_(UIStrings.columnActual)},
{key: 'expectedSize', itemType: 'text', text: str_(UIStrings.columnExpected)},
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@
"text": ""
},
{
"key": "elidedUrl",
"key": "url",
"itemType": "url",
"text": "URL"
},
Expand Down Expand Up @@ -990,7 +990,6 @@
"snippet": "<img src=\"lighthouse-480x318.jpg?isr1\" width=\"360\" height=\"240\" style=\"position: absolute;\">",
"nodeLabel": "body > img"
},
"elidedUrl": "http://localhost:10200/dobetterweb/lighthouse-480x318.jpg?isr1",
"displayedSize": "360 x 240",
"actualSize": "480 x 318",
"actualPixels": 152640,
Expand Down

0 comments on commit 4da2012

Please sign in to comment.