summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/ImageLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/loader/ImageLoader.cpp')
-rw-r--r--Source/WebCore/loader/ImageLoader.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/WebCore/loader/ImageLoader.cpp b/Source/WebCore/loader/ImageLoader.cpp
index e897f8a4e..8745346da 100644
--- a/Source/WebCore/loader/ImageLoader.cpp
+++ b/Source/WebCore/loader/ImageLoader.cpp
@@ -197,8 +197,14 @@ void ImageLoader::updateFromElement()
newImage = document()->cachedResourceLoader()->requestImage(request);
// If we do not have an image here, it means that a cross-site
- // violation occurred.
- m_failedLoadURL = !newImage ? attr : AtomicString();
+ // violation occurred, or that the image was blocked via Content
+ // Security Policy. Either way, trigger an error event.
+ if (!newImage) {
+ m_failedLoadURL = attr;
+ m_hasPendingErrorEvent = true;
+ errorEventSender().dispatchEventSoon(this);
+ } else
+ m_failedLoadURL = AtomicString();
} else if (!attr.isNull()) {
// Fire an error event if the url is empty.
// FIXME: Should we fire this event asynchronoulsy via errorEventSender()?