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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 if (!m_failedLoadURL.isEmpty() && attr == m_failedLoadURL) | 151 if (!m_failedLoadURL.isEmpty() && attr == m_failedLoadURL) |
152 return; | 152 return; |
153 | 153 |
154 // Do not load any image if the 'src' attribute is missing or if it is | 154 // Do not load any image if the 'src' attribute is missing or if it is |
155 // an empty string. | 155 // an empty string. |
156 ResourcePtr<ImageResource> newImage = 0; | 156 ResourcePtr<ImageResource> newImage = 0; |
157 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { | 157 if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { |
158 FetchRequest request(ResourceRequest(document.completeURL(sourceURI(attr
))), element()->localName()); | 158 FetchRequest request(ResourceRequest(document.completeURL(sourceURI(attr
))), element()->localName()); |
159 | 159 |
160 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr
ossoriginAttr); | 160 AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::cr
ossoriginAttr); |
161 if (!crossOriginMode.isNull()) { | 161 if (!crossOriginMode.isNull()) |
162 StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMo
de, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials; | 162 request.setCrossOriginAccessControl(document.securityOrigin(), cross
OriginMode); |
163 request.setCrossOriginAccessControl(document.securityOrigin(), allow
Credentials); | |
164 } | |
165 | 163 |
166 if (m_loadManually) { | 164 if (m_loadManually) { |
167 bool autoLoadOtherImages = document.fetcher()->autoLoadImages(); | 165 bool autoLoadOtherImages = document.fetcher()->autoLoadImages(); |
168 document.fetcher()->setAutoLoadImages(false); | 166 document.fetcher()->setAutoLoadImages(false); |
169 newImage = new ImageResource(request.resourceRequest()); | 167 newImage = new ImageResource(request.resourceRequest()); |
170 newImage->setLoading(true); | 168 newImage->setLoading(true); |
171 document.fetcher()->m_documentResources.set(newImage->url(), newImag
e.get()); | 169 document.fetcher()->m_documentResources.set(newImage->url(), newImag
e.get()); |
172 document.fetcher()->setAutoLoadImages(autoLoadOtherImages); | 170 document.fetcher()->setAutoLoadImages(autoLoadOtherImages); |
173 } else { | 171 } else { |
174 newImage = document.fetcher()->fetchImage(request); | 172 newImage = document.fetcher()->fetchImage(request); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 handle->notifyImageSourceChanged(); | 464 handle->notifyImageSourceChanged(); |
467 } | 465 } |
468 } | 466 } |
469 | 467 |
470 inline void ImageLoader::clearFailedLoadURL() | 468 inline void ImageLoader::clearFailedLoadURL() |
471 { | 469 { |
472 m_failedLoadURL = AtomicString(); | 470 m_failedLoadURL = AtomicString(); |
473 } | 471 } |
474 | 472 |
475 } | 473 } |
OLD | NEW |