It is unclear why img element's srcset handling depends on is-in-document state #416

Closed
smaug---- opened this Issue Dec 17, 2015 · 2 comments

Projects

None yet

3 participants

@smaug----
Collaborator

img's src is loaded whether or not it is in document,
but why, if srcset is used, the image isn't updated when viewport is changing.
Seems like an inconsistency to me.

I would expect something like the following to work:
var im = new Image();
im.srcset = "..."
im.onload = function() {
canvas.getContext("2d").drawImage(im, ...);
}
and response to the changes in the environment.

@zcorpan zcorpan was assigned by domenic Dec 17, 2015
@zcorpan
Member
zcorpan commented Dec 18, 2015

I don't disagree. @yoavweiss any opinion?

@yoavweiss
Collaborator

No strong opinion on my end.

@zcorpan zcorpan added a commit that referenced this issue Jan 13, 2016
@zcorpan zcorpan Fix #416: Make srcset work even for out-of-document <img>s
Don't abort the img-environment-changes algorithm for `img` elements
that are not in a Document, but still require the node document to
be the active document.
afb1d2c
@zcorpan zcorpan added a commit that closed this issue Jan 19, 2016
@zcorpan zcorpan Fix #416: Make srcset work even for out-of-document <img>s
Don't abort the img-environment-changes algorithm for `img` elements
that are not in a Document, but still require the node document to
be the active document.
b1931d9
@zcorpan zcorpan closed this in b1931d9 Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment