-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Is HTMLImgElement.decode() a cross-origin info channel? #8709
Comments
Specs currently seem to assume vector images don't need to be decoded, not sure how correct that is:
Also I believe the rendering time is already observable by drawing the image on a canvas (not entirely sure for SVG, but for bitmaps it will block on the rendering, see https://stackoverflow.com/questions/39543290/#39543762). Ps: Running a quick test with this relatively heavy-on-filters image on Firefox, it seems that they do indeed ignore the decoding step in |
Oh interesting, I was not aware of this.
I'm pretty sure that today drawing an image on a canvas is asynchronous in some browsers in some cases. At the very least it's not defined as synchronous, as long as you don't try to get the pixels straight after (which would be tainted in this case). |
Right, Chrome seems to delay the actual painting on canvas, but drawing that canvas over itself afterwards seems to trigger the synchronous painting of the image, even with cross-origin images. Note that |
See w3c/largest-contentful-paint#111 (comment)
IMG
decode()
returns a promise that resolves when an image is fully decoded. Doesn't that leak information about cross-origin no-cors images? e.g. an SVG for a logged-in vs. anonymous user have the same dimensions but the logged-in one is a lot more complex so takes a long time to decode.The text was updated successfully, but these errors were encountered: