Index: Source/core/html/HTMLPlugInImageElement.cpp |
diff --git a/Source/core/html/HTMLPlugInImageElement.cpp b/Source/core/html/HTMLPlugInImageElement.cpp |
index 5b20828da872b4977fbcd139f4e7aa4c84fcb9ef..28bbff3f2e6ef34297f35cc369c2486dadc0c1b1 100644 |
--- a/Source/core/html/HTMLPlugInImageElement.cpp |
+++ b/Source/core/html/HTMLPlugInImageElement.cpp |
@@ -259,8 +259,12 @@ bool HTMLPlugInImageElement::loadPlugin(const KURL& url, const String& mimeType, |
m_loadedUrl = url; |
IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight())); |
- bool loadManually = document().isPluginDocument() && !frame->loader()->containsPlugins() && toPluginDocument(document()).shouldLoadPluginManually(); |
- RefPtr<Widget> widget = frame->loader()->client()->createPlugin(contentSize, this, url, paramNames, paramValues, mimeType, loadManually); |
+ RefPtr<Widget> widget = plugin(); |
+ |
+ if (!widget) { |
+ bool loadManually = document().isPluginDocument() && !frame->loader()->containsPlugins() && toPluginDocument(document()).shouldLoadPluginManually(); |
+ widget = frame->loader()->client()->createPlugin(contentSize, this, url, paramNames, paramValues, mimeType, loadManually); |
+ } |
if (!widget) { |
if (!renderer->showsUnavailablePluginIndicator()) |
@@ -269,6 +273,8 @@ bool HTMLPlugInImageElement::loadPlugin(const KURL& url, const String& mimeType, |
} |
renderer->setWidget(widget); |
+ if (widget->isPluginContainer() && widget->pluginShouldPersist()) |
+ setPlugin(widget); |
frame->loader()->setContainsPlugins(); |
setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer); |
return true; |