Index: Source/core/html/HTMLPlugInElement.cpp |
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp |
index f2aaf0418bfc21ba56688e9ef998e4426212792f..0b2df23c31693eb216d32f4f308cd4248aba55c8 100644 |
--- a/Source/core/html/HTMLPlugInElement.cpp |
+++ b/Source/core/html/HTMLPlugInElement.cpp |
@@ -28,6 +28,7 @@ |
#include "bindings/v8/ScriptController.h" |
#include "bindings/v8/npruntime_impl.h" |
#include "core/dom/Document.h" |
+#include "core/dom/Node.h" |
#include "core/dom/PostAttachCallbacks.h" |
#include "core/dom/shadow/ShadowRoot.h" |
#include "core/events/Event.h" |
@@ -410,6 +411,8 @@ bool HTMLPlugInElement::requestObject(const String& url, const String& mimeType, |
return false; |
KURL completedURL = document().completeURL(url); |
+ if (!pluginIsLoadable(completedURL, mimeType)) |
+ return false; |
bool useFallback; |
if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) |
@@ -429,9 +432,6 @@ bool HTMLPlugInElement::loadPlugin(const KURL& url, const String& mimeType, cons |
if (!frame->loader().allowPlugins(AboutToInstantiatePlugin)) |
return false; |
- if (!pluginIsLoadable(url, mimeType)) |
- return false; |
- |
RenderEmbeddedObject* renderer = renderEmbeddedObject(); |
// FIXME: This code should not depend on renderer! |
if (!renderer || useFallback) |
@@ -477,6 +477,14 @@ bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, |
} |
+void HTMLPlugInElement::dispatchErrorEvent() |
+{ |
+ if (document().isPluginDocument() && document().ownerElement()) |
+ document().ownerElement()->dispatchEvent(Event::create(EventTypeNames::error)); |
+ else |
+ dispatchEvent(Event::create(EventTypeNames::error)); |
+} |
+ |
bool HTMLPlugInElement::pluginIsLoadable(const KURL& url, const String& mimeType) |
{ |
Frame* frame = document().frame(); |