Auto merge of #22336 - jdm:image-reload, r=Manishearth
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 -->

szeged/servo,paulrouget/servo,larsbergstrom/servo,DominoTree/servo,splav/servo,paulrouget/servo,paulrouget/servo,szeged/servo,paulrouget/servo,larsbergstrom/servo,splav/servo,KiChjang/servo,peterjoel/servo,saneyuki/servo,pyfisch/servo,nnethercote/servo,notriddle/servo,larsbergstrom/servo,pyfisch/servo,saneyuki/servo,notriddle/servo,splav/servo,saneyuki/servo,emilio/servo,szeged/servo,notriddle/servo,peterjoel/servo,nnethercote/servo,pyfisch/servo,DominoTree/servo,nnethercote/servo,notriddle/servo,szeged/servo,peterjoel/servo,larsbergstrom/servo,splav/servo,larsbergstrom/servo,splav/servo,emilio/servo,KiChjang/servo,KiChjang/servo,paulrouget/servo,nnethercote/servo,szeged/servo,nnethercote/servo,KiChjang/servo,szeged/servo,splav/servo,emilio/servo,emilio/servo,saneyuki/servo,peterjoel/servo,KiChjang/servo,saneyuki/servo,KiChjang/servo,szeged/servo,notriddle/servo,nnethercote/servo,peterjoel/servo,larsbergstrom/servo,notriddle/servo,peterjoel/servo,splav/servo,nnethercote/servo,paulrouget/servo,larsbergstrom/servo,paulrouget/servo,splav/servo,saneyuki/servo,DominoTree/servo,saneyuki/servo,peterjoel/servo,saneyuki/servo,notriddle/servo,emilio/servo,pyfisch/servo,saneyuki/servo,pyfisch/servo,szeged/servo,DominoTree/servo,KiChjang/servo,szeged/servo,notriddle/servo,emilio/servo,emilio/servo,paulrouget/servo,splav/servo,KiChjang/servo,larsbergstrom/servo,DominoTree/servo,KiChjang/servo,paulrouget/servo,notriddle/servo,DominoTree/servo,pyfisch/servo,nnethercote/servo,DominoTree/servo,nnethercote/servo,pyfisch/servo,larsbergstrom/servo,pyfisch/servo,pyfisch/servo,emilio/servo,emilio/servo,emilio/servo,szeged/servo,paulrouget/servo,peterjoel/servo,peterjoel/servo,larsbergstrom/servo,nnethercote/servo,DominoTree/servo,notriddle/servo,DominoTree/servo,splav/servo,DominoTree/servo,KiChjang/servo,saneyuki/servo,peterjoel/servo,pyfisch/servo