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

Consider removing img.onload #2866

Closed
ianb opened this issue May 19, 2017 · 2 comments
Closed

Consider removing img.onload #2866

ianb opened this issue May 19, 2017 · 2 comments
Assignees

Comments

@ianb
Copy link
Contributor

ianb commented May 19, 2017

Because of our onload handler, you can't see a partially loaded image, or other useful things that <img> tags do. We did this because of the alt text, but if we wanted we could style the alt text how we wanted

I think we should consider making the image visible always, changing the alt text, and maybe putting a loading spinner on top that we hide on load.

@ghost ghost added this to the Stretch milestone May 23, 2017
@ianb ianb removed this from the Stretch milestone Jun 13, 2017
@ianb
Copy link
Contributor Author

ianb commented Jun 13, 2017

Related comment

@ghost ghost added this to the General Release 55 milestone Jun 15, 2017
@ianb
Copy link
Contributor Author

ianb commented Jun 20, 2017

Here's a codepen that demonstrates a technique without any Javascript. It puts the loading icon under the image, so it automatically gets hidden when the image loads. The alt text is visible in the codepen, but we can change the color if we want. We could also use aria-label (or maybe there's a better aria attribute) if we want to maintain accessibility without using alt.

jaredhirsch added a commit that referenced this issue Jul 28, 2017
* Makes images viewable without JS.

* Works around lack of CSP nonce support in IE and Edge < 40 (fixes
  #2935).

Fixes #2866.
@ghost ghost assigned jaredhirsch Aug 1, 2017
@ianb ianb closed this as completed in 48f52ed Aug 4, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants