Pass lighthouse image size test

This commit is contained in:
schmelczerandras 2020-11-23 13:43:30 +01:00
parent 66da654192
commit 4e8da9e7f4
2 changed files with 3 additions and 1 deletions

View file

@ -5,7 +5,7 @@ import { html } from '../../types/html';
export const generate = (): html => `
<section id="image-viewer">
<img image-viewer-ignore />
<img height="0" width="0" image-viewer-ignore />
<div tabindex="0" id="cancel">${cancel}</div>
</section>
`;

View file

@ -27,6 +27,8 @@ export class PageImageViewer extends PageElement {
private showImage(source: HTMLImageElement) {
const image = this.query('img') as HTMLImageElement;
image.src = source.src;
image.height = source.height;
image.width = source.width;
this.htmlRoot.style.visibility = 'visible';
}