Index: third_party/WebKit/Source/core/html/PluginDocument.cpp |
diff --git a/third_party/WebKit/Source/core/html/PluginDocument.cpp b/third_party/WebKit/Source/core/html/PluginDocument.cpp |
index 05fb4040e8d4b3b6a38681db48bb07df43b56454..dc40f1c589e0c2ed4ec680d099a92f69a9229c59 100644 |
--- a/third_party/WebKit/Source/core/html/PluginDocument.cpp |
+++ b/third_party/WebKit/Source/core/html/PluginDocument.cpp |
@@ -109,13 +109,14 @@ void PluginDocumentParser::createDocumentStructure() |
body->appendChild(m_embedElement); |
toPluginDocument(document())->setPluginNode(m_embedElement.get()); |
- m_embedElement->focus(); |
document()->updateLayout(); |
// We need the plugin to load synchronously so we can get the PluginView |
// below so flush the layout tasks now instead of waiting on the timer. |
frame->view()->flushAnyPendingPostLayoutTasks(); |
+ // Focus the plugin here, as the line above is where the plugin is created. |
+ m_embedElement->focus(); |
if (PluginView* view = pluginView()) |
view->didReceiveResponse(document()->loader()->response()); |