Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: third_party/WebKit/Source/core/html/PluginDocument.cpp

Issue 1413603004: Delay embed-element focus until after plugin creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698