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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld
Behavior bypassBehavior, Element& element) | 199 static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld
Behavior bypassBehavior, Element& element) |
200 { | 200 { |
201 if (bypassBehavior == ImageLoader::BypassMainWorldCSP) | 201 if (bypassBehavior == ImageLoader::BypassMainWorldCSP) |
202 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); | 202 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); |
203 | 203 |
204 AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossorig
inAttr); | 204 AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossorig
inAttr); |
205 if (!crossOriginMode.isNull()) | 205 if (!crossOriginMode.isNull()) |
206 request.setCrossOriginAccessControl(element.document().securityOrigin(),
crossOriginMode); | 206 request.setCrossOriginAccessControl(element.document().securityOrigin(),
crossOriginMode); |
| 207 |
| 208 if (isHTMLImageElement(element)) { |
| 209 FetchRequest::ResourceWidth resourceWidth; |
| 210 resourceWidth.width = toHTMLImageElement(element).sourceSize(element); |
| 211 resourceWidth.isSet = true; |
| 212 request.setResourceWidth(resourceWidth); |
| 213 } |
207 } | 214 } |
208 | 215 |
209 inline void ImageLoader::dispatchErrorEvent() | 216 inline void ImageLoader::dispatchErrorEvent() |
210 { | 217 { |
211 m_hasPendingErrorEvent = true; | 218 m_hasPendingErrorEvent = true; |
212 errorEventSender().dispatchEventSoon(this); | 219 errorEventSender().dispatchEventSoon(this); |
213 } | 220 } |
214 | 221 |
215 inline void ImageLoader::crossSiteOrCSPViolationOccurred(AtomicString imageSourc
eURL) | 222 inline void ImageLoader::crossSiteOrCSPViolationOccurred(AtomicString imageSourc
eURL) |
216 { | 223 { |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 #endif | 612 #endif |
606 } | 613 } |
607 | 614 |
608 #if ENABLE(OILPAN) | 615 #if ENABLE(OILPAN) |
609 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() | 616 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() |
610 { | 617 { |
611 m_loader.willRemoveClient(m_client); | 618 m_loader.willRemoveClient(m_client); |
612 } | 619 } |
613 #endif | 620 #endif |
614 } | 621 } |
OLD | NEW |