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

Should we clear image data or not after the image is adopted into a data document. #3226

Open
allstarschh opened this issue Nov 14, 2017 · 3 comments

Comments

@allstarschh
Copy link

See the test in http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=5501

Firefox/Edge/IE still keeps the width/height and the image can be drawn into canvas,
whereas Safari and Chrome reset the image data, and the width/height are both 0 and the canvas is empty.

@bzbarsky
Copy link
Contributor

@annevk

@annevk
Copy link
Member

annevk commented Nov 14, 2017

I don't know much about the img element, but reading through it I get the impression Edge and Firefox might be correct. Currently "adopting steps" are a "relevant mutation". That triggers "update the image data" which would hang in step 1.2 given that this img element's node document is not the active document. So no internal state would be updated. I'm not sure it's ideal for the algorithm to just hang though, that seems rather crappy.

@zcorpan?

@zcorpan
Copy link
Member

zcorpan commented Dec 4, 2017

Indeed the spec doesn't copy internal state. I don't know if that should change. Are there any known web compat issues?

The 1.2 step I tried to model after Gecko I believe. See ResponsiveImagesCG/picture-element@ee68507

In particular before that change the algorithm would just abort if the document is not active, and then nothing would happen when the document became active. But there could be better ways to specify that logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants