| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 | 286 |
| 287 if (referrerPolicy != ReferrerPolicyDefault) | 287 if (referrerPolicy != ReferrerPolicyDefault) |
| 288 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref
errerPolicy, url, document.outgoingReferrer())); | 288 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref
errerPolicy, url, document.outgoingReferrer())); |
| 289 | 289 |
| 290 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet
Attribute(HTMLNames::srcsetAttr).isNull()) | 290 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet
Attribute(HTMLNames::srcsetAttr).isNull()) |
| 291 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage
Set); | 291 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage
Set); |
| 292 FetchRequest request(resourceRequest, element()->localName(), resourceLo
aderOptions); | 292 FetchRequest request(resourceRequest, element()->localName(), resourceLo
aderOptions); |
| 293 configureRequest(request, bypassBehavior, *m_element, document.clientHin
tsPreferences()); | 293 configureRequest(request, bypassBehavior, *m_element, document.clientHin
tsPreferences()); |
| 294 | 294 |
| 295 newImage = ImageResource::fetch(request, document.fetcher()); | 295 ImageResource::PlaceholderRequestType placeholderRequestType = document.
settings() && document.settings()->fetchImagePlaceholders() && updateBehavior !=
UpdateForcedReload |
| 296 ? ImageResource::PlaceholderRequestType::AllowPlaceholder |
| 297 : ImageResource::PlaceholderRequestType::DisallowPlaceholder; |
| 298 newImage = ImageResource::fetch(request, document.fetcher(), placeholder
RequestType); |
| 296 | 299 |
| 297 if (!newImage && !pageIsBeingDismissed(&document)) { | 300 if (!newImage && !pageIsBeingDismissed(&document)) { |
| 298 crossSiteOrCSPViolationOccurred(imageSourceURL); | 301 crossSiteOrCSPViolationOccurred(imageSourceURL); |
| 299 dispatchErrorEvent(); | 302 dispatchErrorEvent(); |
| 300 } else { | 303 } else { |
| 301 clearFailedLoadURL(); | 304 clearFailedLoadURL(); |
| 302 } | 305 } |
| 303 } else { | 306 } else { |
| 304 if (!imageSourceURL.isNull()) { | 307 if (!imageSourceURL.isNull()) { |
| 305 // Fire an error event if the url string is not empty, but the KURL
is. | 308 // Fire an error event if the url string is not empty, but the KURL
is. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 608 |
| 606 void ImageLoader::elementDidMoveToNewDocument() | 609 void ImageLoader::elementDidMoveToNewDocument() |
| 607 { | 610 { |
| 608 if (m_loadDelayCounter) | 611 if (m_loadDelayCounter) |
| 609 m_loadDelayCounter->documentChanged(m_element->document()); | 612 m_loadDelayCounter->documentChanged(m_element->document()); |
| 610 clearFailedLoadURL(); | 613 clearFailedLoadURL(); |
| 611 setImage(0); | 614 setImage(0); |
| 612 } | 615 } |
| 613 | 616 |
| 614 } // namespace blink | 617 } // namespace blink |
| OLD | NEW |