WebCore:
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Sep 2010 14:38:31 +0000 (14:38 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Sep 2010 14:38:31 +0000 (14:38 +0000)
2010-09-06  Xan Lopez  <xlopez@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Provide Keyboard Events to Windowless plugins
        https://bugs.webkit.org/show_bug.cgi?id=44613

        Fix keyboard event delivery for windowless plugins.

        Based on a patch by Bharathwaaj.

        * plugins/PluginView.cpp:
        (WebCore::PluginView::handleEvent): also take into account
        focused{in,out} events
        * plugins/gtk/PluginViewGtk.cpp:
        (WebCore::PluginView::handleKeyboardEvent): we want the keyval
        here, not the hardware keycode
        (WebCore::PluginView::handleMouseEvent): focus the pluginview on mouse events

LayoutTests:

2010-09-06  Xan Lopez  <xlopez@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Provide Keyboard Events to Windowless plugins
        https://bugs.webkit.org/show_bug.cgi?id=44613

        Unskip passing test.

        * platform/gtk/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@66827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
WebCore/ChangeLog
WebCore/plugins/PluginView.cpp
WebCore/plugins/gtk/PluginViewGtk.cpp

index e4f1328..5fd27a2 100644 (file)
@@ -1,3 +1,14 @@
+2010-09-06  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Provide Keyboard Events to Windowless plugins
+        https://bugs.webkit.org/show_bug.cgi?id=44613
+
+        Unskip passing test.
+
+        * platform/gtk/Skipped:
+
 2010-09-06  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index fee3329..08036e0 100644 (file)
@@ -3243,9 +3243,6 @@ media/video-does-not-loop.html
 #   Tests failing
 plugins/embed-attributes-setting.html
 plugins/get-url-with-blank-target.html
-plugins/mouse-events.html
-plugins/mouse-events-fixedpos.html
-plugins/keyboard-events.html
 plugins/geturlnotify-during-document-teardown.html
 
 # This test is for clients that choose to make the missing plugin indicator a button
index 7701f15..966d1f6 100644 (file)
@@ -1,3 +1,22 @@
+2010-09-06  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Provide Keyboard Events to Windowless plugins
+        https://bugs.webkit.org/show_bug.cgi?id=44613
+
+        Fix keyboard event delivery for windowless plugins.
+
+        Based on a patch by Bharathwaaj.
+
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::handleEvent): also take into account
+        focused{in,out} events
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::handleKeyboardEvent): we want the keyval
+        here, not the hardware keycode
+        (WebCore::PluginView::handleMouseEvent): focus the pluginview on mouse events
+
 2010-09-06  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index b8b80f5..6a9eb13 100644 (file)
@@ -168,9 +168,9 @@ void PluginView::handleEvent(Event* event)
     else if (event->isKeyboardEvent())
         handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
-    else if (event->type() == eventNames().DOMFocusOutEvent)
+    else if (event->type() == eventNames().DOMFocusOutEvent || event->type() == eventNames().focusoutEvent)
         handleFocusOutEvent();
-    else if (event->type() == eventNames().DOMFocusInEvent)
+    else if (event->type() == eventNames().DOMFocusInEvent || event->type() == eventNames().focusinEvent)
         handleFocusInEvent();
 #endif
 }
index 423a05a..6d631e3 100644 (file)
@@ -33,6 +33,7 @@
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
+#include "FocusController.h"
 #include "FrameLoader.h"
 #include "FrameLoadRequest.h"
 #include "FrameTree.h"
@@ -307,7 +308,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event)
     xEvent.xkey.subwindow = 0; // we have no child window
     xEvent.xkey.time = event->timeStamp();
     xEvent.xkey.state = gdkEvent->state; // GdkModifierType mirrors xlib state masks
-    xEvent.xkey.keycode = gdkEvent->hardware_keycode;
+    xEvent.xkey.keycode = gdkEvent->keyval;
     xEvent.xkey.same_screen = true;
 
     // NOTE: As the XEvents sent to the plug-in are synthesized and there is not a native window
@@ -422,6 +423,12 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     if (m_isWindowed)
         return;
 
+    if (event->type() == eventNames().mousedownEvent) {
+        if (Page* page = m_parentFrame->page())
+            page->focusController()->setActive(true);
+        focusPluginElement();
+    }
+
     NPEvent xEvent;
 #if defined(XP_UNIX)
     initXEvent(&xEvent);