Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #22336 - jdm:image-reload, r=Manishearth
Fix missing textures on reloading three.js image content The fundamental problem is that three.js sets the crossOrigin property of an image, which kicks off an image microtask, and then sets the src. When the image URL is in the image cache (such as when reloading a page), this causes the shortcut to be taken and the image data is made available immediately, but the queued image task is unaware of this and asks the image cache to feed the image data. The existing code then ended up in an unexpected state when trying to deal with this data, such that when three.js received the image load notification and performed the texImage2D operation on the image data, it would discover that the image element did not claim to have a URL, and it would treat this as a broken image. Ultimately, this caused the texture that three.js obtained to be completely black. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22152. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22336) <!-- Reviewable:end -->
- Loading branch information