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 | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights |
5 * reserved. | 5 * reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 | 307 |
308 if (isHTMLPictureElement(element()->parentNode()) || | 308 if (isHTMLPictureElement(element()->parentNode()) || |
309 !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull()) | 309 !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull()) |
310 resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet); | 310 resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet); |
311 FetchRequest request(resourceRequest, element()->localName(), | 311 FetchRequest request(resourceRequest, element()->localName(), |
312 resourceLoaderOptions); | 312 resourceLoaderOptions); |
313 configureRequest(request, bypassBehavior, *m_element, | 313 configureRequest(request, bypassBehavior, *m_element, |
314 document.clientHintsPreferences()); | 314 document.clientHintsPreferences()); |
315 | 315 |
| 316 if (updateBehavior != UpdateForcedReload && document.settings() && |
| 317 document.settings()->fetchImagePlaceholders()) { |
| 318 request.setAllowImagePlaceholder(); |
| 319 } |
| 320 |
316 newImage = ImageResource::fetch(request, document.fetcher()); | 321 newImage = ImageResource::fetch(request, document.fetcher()); |
317 | 322 |
318 if (!newImage && !pageIsBeingDismissed(&document)) { | 323 if (!newImage && !pageIsBeingDismissed(&document)) { |
319 crossSiteOrCSPViolationOccurred(imageSourceURL); | 324 crossSiteOrCSPViolationOccurred(imageSourceURL); |
320 dispatchErrorEvent(); | 325 dispatchErrorEvent(); |
321 } else { | 326 } else { |
322 clearFailedLoadURL(); | 327 clearFailedLoadURL(); |
323 } | 328 } |
324 } else { | 329 } else { |
325 if (!imageSourceURL.isNull()) { | 330 if (!imageSourceURL.isNull()) { |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } | 640 } |
636 | 641 |
637 void ImageLoader::elementDidMoveToNewDocument() { | 642 void ImageLoader::elementDidMoveToNewDocument() { |
638 if (m_loadDelayCounter) | 643 if (m_loadDelayCounter) |
639 m_loadDelayCounter->documentChanged(m_element->document()); | 644 m_loadDelayCounter->documentChanged(m_element->document()); |
640 clearFailedLoadURL(); | 645 clearFailedLoadURL(); |
641 setImage(0); | 646 setImage(0); |
642 } | 647 } |
643 | 648 |
644 } // namespace blink | 649 } // namespace blink |
OLD | NEW |