RESOLVED FIXED Bug 64813
HTMLImageElement::crossOrigin is hard to use because of caching
https://bugs.webkit.org/show_bug.cgi?id=64813
Summary HTMLImageElement::crossOrigin is hard to use because of caching
Adam Barth
Reported 2011-07-19 11:05:21 PDT
The crossorigin attribute of HTMLImageElement is hard to use correctly because image responses are often cached. For example, consider the case where the server always response with the following header: Access-Control-Allow-Origin: * If we request the image first without the crossorigin attribute, then we'll send credentials and cache the response in the MemoryCache. Later, if we request the image with the crossorigin attribute, we'll grab the response out of the MemoryCache, but the CORS check will fail because we'll remember that we sent credentials the first time. This behavior can be frustrating for web developers who don't understand why the second request isn't allowed. After all, they said their image was allowed by *. One possible solution to this problem is to examine the allowCredentials flag when deciding whether the resource in the MemoryCache is appropriate for the given request. The CachedResourceLoader and CachedResource have a bunch of logic for deciding whether an existing CachedResource is valid for a new request or whether we should evict it and request the resource again. We could try fixing this issue by including logic to compare the allowCredentials flag in this code path.
Attachments
Patch (7.42 KB, patch)
2011-07-22 15:32 PDT, Kenneth Russell
no flags
Kenneth Russell
Comment 1 2011-07-21 17:59:53 PDT
Looking into this.
Kenneth Russell
Comment 2 2011-07-22 15:32:06 PDT
Adam Barth
Comment 3 2011-07-22 15:34:19 PDT
Comment on attachment 101779 [details] Patch Look great. Thanks!
WebKit Review Bot
Comment 4 2011-07-22 17:18:49 PDT
Comment on attachment 101779 [details] Patch Clearing flags on attachment: 101779 Committed r91626: <http://trac.webkit.org/changeset/91626>
WebKit Review Bot
Comment 5 2011-07-22 17:18:53 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.