Auto merge of #24340 - jdm:image-cache-cors, r=Manishearth

Allow using CORS filtered image responses as WebGL textures

More specifically, this makes the "is this image same origin?" check consider the CORS status of the original response, rather than relying on an overly-strict "is this image's response's URL same-origin with a particular global?" check. To do this, we make the image cache double keyed based on the requested URL as well as the requesting origin, and store the CORS status of the eventual response with the final image that eventually gets sent to the HTMLImageElement consumer.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24330 and fix #24368
- [x] There are tests for these changes

<!-- 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/24340)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-10-07 18:39:36 -04:00 committed by GitHub
commit 75548f40c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 531 additions and 419 deletions

View file

@ -159,6 +159,8 @@ impl HTMLVideoElement {
let image_cache = window.image_cache();
let response = image_cache.find_image_or_metadata(
poster_url.clone().into(),
window.origin().immutable().clone(),
None,
UsePlaceholder::No,
CanRequestImages::Yes,
);