Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing the dom of img loaded images #4807

Closed
henke37 opened this issue Jul 29, 2019 · 3 comments
Closed

Accessing the dom of img loaded images #4807

henke37 opened this issue Jul 29, 2019 · 3 comments

Comments

@henke37
Copy link

henke37 commented Jul 29, 2019

The img element displays resources of the "image" kind. Traditionally such resources have been opaque and considered replaced content. However, with the introduction of formats such as SVG the images can now sometimes have a DOM of their own.

The img element should provide access to the DOM of the subresource in the same style as the iframe element already does.

@domenic
Copy link
Member

domenic commented Jul 29, 2019

The way to think about this isn't that images always go in img, and some images have DOM. It's that, if you want an opaque image, you use img. If you want a sub-document such as an SVG image, you use iframe.

So I don't think we'll make any change to the spec here; iframe already covers the use case you want.

We could consider adding a note to the spec, if that would help folks like yourself understand better that iframe is for sub-documents, and img is for rasterized images?

@henke37
Copy link
Author

henke37 commented Jul 29, 2019

If only the img element was the only option other than iframe to display images. But as I hear, it's not. And that's not counting css. This can be seen in #4474.

@domenic
Copy link
Member

domenic commented Jul 29, 2019

Indeed, there are many ways to display images on the web.

@annevk annevk closed this as completed Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants