Index: Source/core/html/HTMLPlugInElement.cpp |
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp |
index 5f5dd4f0eeab0b089444ad2e45ad77b2df31c1d0..227eb35d67fef7049f9d0367bda1644f4258f1d6 100644 |
--- a/Source/core/html/HTMLPlugInElement.cpp |
+++ b/Source/core/html/HTMLPlugInElement.cpp |
@@ -129,7 +129,9 @@ void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) |
bool HTMLPlugInElement::canProcessDrag() const |
{ |
- return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(pluginWidget())->canProcessDrag(); |
+ if (Widget* widget = existingPluginWidget()) |
+ return widget->isPluginView() && toPluginView(widget)->canProcessDrag(); |
+ return false; |
} |
bool HTMLPlugInElement::willRespondToMouseClickEvents() |
@@ -310,7 +312,7 @@ SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() |
if (m_persistedPluginWidget) |
plugin = m_persistedPluginWidget.get(); |
else |
- plugin = pluginWidget(); |
+ plugin = pluginWidgetForJSBindings(); |
if (plugin) |
m_pluginWrapper = frame->script().createPluginWrapper(plugin); |
@@ -318,7 +320,14 @@ SharedPersistent<v8::Object>* HTMLPlugInElement::pluginWrapper() |
return m_pluginWrapper.get(); |
} |
-Widget* HTMLPlugInElement::pluginWidget() const |
+Widget* HTMLPlugInElement::existingPluginWidget() const |
+{ |
+ if (RenderPart* renderPart = existingRenderPart()) |
+ return renderPart->widget(); |
+ return nullptr; |
+} |
+ |
+Widget* HTMLPlugInElement::pluginWidgetForJSBindings() |
{ |
if (RenderPart* renderPart = renderPartForJSBindings()) |
return renderPart->widget(); |
@@ -390,14 +399,21 @@ RenderPart* HTMLPlugInElement::renderPartForJSBindings() const |
bool HTMLPlugInElement::isKeyboardFocusable() const |
{ |
+ if (useFallbackContent() || usePlaceholderContent()) |
+ return HTMLElement::isKeyboardFocusable(); |
+ |
if (!document().isActive()) |
return false; |
- return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(pluginWidget())->supportsKeyboardFocus(); |
+ |
+ if (Widget* widget = existingPluginWidget()) |
+ return widget->isPluginView() && toPluginView(widget)->supportsKeyboardFocus(); |
+ |
+ return false; |
} |
bool HTMLPlugInElement::hasCustomFocusLogic() const |
{ |
- return !hasAuthorShadowRoot(); |
+ return !useFallbackContent() && !usePlaceholderContent(); |
} |
bool HTMLPlugInElement::isPluginElement() const |