| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 if (!document.isActive()) | 207 if (!document.isActive()) |
| 208 return; | 208 return; |
| 209 | 209 |
| 210 AtomicString imageSourceURL = m_element->imageSourceURL(); | 210 AtomicString imageSourceURL = m_element->imageSourceURL(); |
| 211 KURL url = imageSourceToKURL(imageSourceURL); | 211 KURL url = imageSourceToKURL(imageSourceURL); |
| 212 ResourcePtr<ImageResource> newImage = 0; | 212 ResourcePtr<ImageResource> newImage = 0; |
| 213 if (!url.isNull()) { | 213 if (!url.isNull()) { |
| 214 // Unlike raw <img>, we block mixed content inside of <picture> or <img
srcset>. | 214 // Unlike raw <img>, we block mixed content inside of <picture> or <img
srcset>. |
| 215 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe
sourceOptions(); | 215 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe
sourceOptions(); |
| 216 ResourceRequest resourceRequest(url); | 216 ResourceRequest resourceRequest(url); |
| 217 if (isHTMLPictureElement(element()->parentNode()) || !element()->getAttr
ibute(HTMLNames::srcsetAttr).isNull()) | 217 if (!element()->getAttribute(HTMLNames::srcsetAttr).isNull()) |
| 218 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage
Set); | 218 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage
Set); |
| 219 FetchRequest request(ResourceRequest(url), element()->localName(), resou
rceLoaderOptions); | 219 FetchRequest request(ResourceRequest(url), element()->localName(), resou
rceLoaderOptions); |
| 220 | 220 |
| 221 newImage = document.fetcher()->fetchImage(request); | 221 newImage = document.fetcher()->fetchImage(request); |
| 222 | 222 |
| 223 if (!newImage && !pageIsBeingDismissed(&document)) | 223 if (!newImage && !pageIsBeingDismissed(&document)) |
| 224 crossSiteOrCSPViolationOccured(imageSourceURL); | 224 crossSiteOrCSPViolationOccured(imageSourceURL); |
| 225 else | 225 else |
| 226 clearFailedLoadURL(); | 226 clearFailedLoadURL(); |
| 227 } else if (!imageSourceURL.isNull()) { | 227 } else if (!imageSourceURL.isNull()) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 void ImageLoader::sourceImageChanged() | 500 void ImageLoader::sourceImageChanged() |
| 501 { | 501 { |
| 502 HashSet<ImageLoaderClient*>::iterator end = m_clients.end(); | 502 HashSet<ImageLoaderClient*>::iterator end = m_clients.end(); |
| 503 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end
; ++it) { | 503 for (HashSet<ImageLoaderClient*>::iterator it = m_clients.begin(); it != end
; ++it) { |
| 504 ImageLoaderClient* handle = *it; | 504 ImageLoaderClient* handle = *it; |
| 505 handle->notifyImageSourceChanged(); | 505 handle->notifyImageSourceChanged(); |
| 506 } | 506 } |
| 507 } | 507 } |
| 508 | 508 |
| 509 } | 509 } |
| OLD | NEW |