2011-04-19 Stuart Morgan <stuartmorgan@chromium.org>
[WebKit-https.git] / Source / WebKit / chromium / src / WebPluginContainerImpl.cpp
index 40f8625..150f173 100644 (file)
@@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
         return;
 
     if (event->type() == eventNames().mousedownEvent) {
-        // Ensure that the frame containing the plugin has focus.
         Frame* containingFrame = parentView->frame();
         if (Page* currentPage = containingFrame->page())
-            currentPage->focusController()->setFocusedFrame(containingFrame);
-        // Give focus to our containing HTMLPluginElement.
-        containingFrame->document()->setFocusedNode(m_element);
+            currentPage->focusController()->setFocusedNode(m_element, containingFrame);
+        else
+            containingFrame->document()->setFocusedNode(m_element);
     }
 
     WebCursorInfo cursorInfo;