Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Broken image size #13

Open
valtlai opened this issue Feb 18, 2019 · 1 comment
Open

Broken image size #13

valtlai opened this issue Feb 18, 2019 · 1 comment

Comments

@valtlai
Copy link

valtlai commented Feb 18, 2019

Some browsers ignore the image size (set with HTML attributes or CSS) when rendering broken images (Chrome always and Firefox when a non-empty alt text is provided).

Should browsers preserve the image size? Or should we require that when intrinsicsize attribute is specified?

@valtlai valtlai changed the title Broken image behavior Broken image size Feb 18, 2019
@cathiechen
Copy link

Hi,
It seems reasonable to me that we apply intrinsicSize to broken image. I.e., the behavior of broken image is same to normal image. Otherwise, there's a user visible reflow.
For instance:

<img intrinsicSize='100 x 50' style='width: 200px;' src='errorImg.png'> text

The first render size of image would be 200 x 100. (intrinsicSize applied).
After detecting image error, the image ratio will be set to 1.
So the render size of image would become 200 x 200.
The text after image would be moved to a new position too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants