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 30 matching lines...) Expand all Loading... |
41 #include "core/html/HTMLImageElement.h" | 41 #include "core/html/HTMLImageElement.h" |
42 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
43 #include "core/inspector/InspectorInstrumentation.h" | 43 #include "core/inspector/InspectorInstrumentation.h" |
44 #include "core/layout/LayoutImage.h" | 44 #include "core/layout/LayoutImage.h" |
45 #include "core/layout/LayoutVideo.h" | 45 #include "core/layout/LayoutVideo.h" |
46 #include "core/layout/svg/LayoutSVGImage.h" | 46 #include "core/layout/svg/LayoutSVGImage.h" |
47 #include "core/svg/graphics/SVGImage.h" | 47 #include "core/svg/graphics/SVGImage.h" |
48 #include "platform/Logging.h" | 48 #include "platform/Logging.h" |
49 #include "platform/weborigin/SecurityOrigin.h" | 49 #include "platform/weborigin/SecurityOrigin.h" |
50 #include "platform/weborigin/SecurityPolicy.h" | 50 #include "platform/weborigin/SecurityPolicy.h" |
| 51 #include "public/platform/WebCachePolicy.h" |
51 #include "public/platform/WebURLRequest.h" | 52 #include "public/platform/WebURLRequest.h" |
52 | 53 |
53 namespace blink { | 54 namespace blink { |
54 | 55 |
55 static ImageEventSender& loadEventSender() | 56 static ImageEventSender& loadEventSender() |
56 { | 57 { |
57 DEFINE_STATIC_LOCAL(Persistent<ImageEventSender>, sender, (ImageEventSender:
:create(EventTypeNames::load))); | 58 DEFINE_STATIC_LOCAL(Persistent<ImageEventSender>, sender, (ImageEventSender:
:create(EventTypeNames::load))); |
58 return *sender; | 59 return *sender; |
59 } | 60 } |
60 | 61 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 299 |
299 AtomicString imageSourceURL = m_element->imageSourceURL(); | 300 AtomicString imageSourceURL = m_element->imageSourceURL(); |
300 KURL url = imageSourceToKURL(imageSourceURL); | 301 KURL url = imageSourceToKURL(imageSourceURL); |
301 RawPtr<ImageResource> newImage = nullptr; | 302 RawPtr<ImageResource> newImage = nullptr; |
302 RawPtr<Element> protectElement(m_element.get()); | 303 RawPtr<Element> protectElement(m_element.get()); |
303 if (!url.isNull()) { | 304 if (!url.isNull()) { |
304 // Unlike raw <img>, we block mixed content inside of <picture> or <img
srcset>. | 305 // Unlike raw <img>, we block mixed content inside of <picture> or <img
srcset>. |
305 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe
sourceOptions(); | 306 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe
sourceOptions(); |
306 ResourceRequest resourceRequest(url); | 307 ResourceRequest resourceRequest(url); |
307 if (updateBehavior == UpdateForcedReload) { | 308 if (updateBehavior == UpdateForcedReload) { |
308 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::Bypassing
Cache); | 309 resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); |
309 resourceRequest.setLoFiState(WebURLRequest::LoFiOff); | 310 resourceRequest.setLoFiState(WebURLRequest::LoFiOff); |
310 // ImageLoader defers the load of images when in an ImageDocument. | 311 // ImageLoader defers the load of images when in an ImageDocument. |
311 // Don't defer this load on a forced reload. | 312 // Don't defer this load on a forced reload. |
312 m_loadingImageDocument = false; | 313 m_loadingImageDocument = false; |
313 } | 314 } |
314 | 315 |
315 if (referrerPolicy != ReferrerPolicyDefault) | 316 if (referrerPolicy != ReferrerPolicyDefault) |
316 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref
errerPolicy, url, document.outgoingReferrer())); | 317 resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(ref
errerPolicy, url, document.outgoingReferrer())); |
317 | 318 |
318 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet
Attribute(HTMLNames::srcsetAttr).isNull()) | 319 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet
Attribute(HTMLNames::srcsetAttr).isNull()) |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 637 |
637 void ImageLoader::elementDidMoveToNewDocument() | 638 void ImageLoader::elementDidMoveToNewDocument() |
638 { | 639 { |
639 if (m_loadDelayCounter) | 640 if (m_loadDelayCounter) |
640 m_loadDelayCounter->documentChanged(m_element->document()); | 641 m_loadDelayCounter->documentChanged(m_element->document()); |
641 clearFailedLoadURL(); | 642 clearFailedLoadURL(); |
642 setImage(0); | 643 setImage(0); |
643 } | 644 } |
644 | 645 |
645 } // namespace blink | 646 } // namespace blink |
OLD | NEW |