Diff
Modified: trunk/Source/WebKit2/ChangeLog (91168 => 91169)
--- trunk/Source/WebKit2/ChangeLog 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/ChangeLog 2011-07-18 01:47:28 UTC (rev 91169)
@@ -1,3 +1,27 @@
+2011-07-17 Lukasz Slachciak <[email protected]>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] [WK2] Fix for getting editor client commands.
+ https://bugs.webkit.org/show_bug.cgi?id=63081
+
+ Editor client commands intepretation was incorrect. It was based on the NativeWebKeyboardEvent only.
+ In fact EventHandler is generating interpreted events - keypress and keydown. These event types
+ are now passed from UIProcess to WebProcess so KeyBindingTranslator can correctly find editor commands.
+ Also build break for Debug build was fixed.
+
+ * UIProcess/API/gtk/PageClientImpl.cpp: KeyboardEvent type is used for KeyBindingTranslator.
+ (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): getEditorCommandsForKeyEvent now has additional
+ parameter describing KeyboardEvent type.
+ * UIProcess/API/gtk/PageClientImpl.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/gtk/WebPageProxyGtk.cpp:
+ (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): KeyboardEvent type passed to PageClient.
+ * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
+ (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Sync message send with KeyboardEvent type.
+
2011-07-16 Daniel Bates <[email protected]>
Fix Win Cairo Debug build after <http://trac.webkit.org/changeset/91085>.
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp 2011-07-18 01:47:28 UTC (rev 91169)
@@ -55,10 +55,11 @@
{
}
-void PageClientImpl::getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent& event, Vector<WTF::String>& commandList)
+void PageClientImpl::getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent& event, const AtomicString& eventType, Vector<WTF::String>& commandList)
{
- ASSERT(event.type == WebEvent::KeyDown || event.type == WebEvent.KeyPress);
- KeyBindingTranslator::EventType type = WebEvent::KeyDown ?
+ ASSERT(eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent);
+
+ KeyBindingTranslator::EventType type = eventType == eventNames().keydownEvent ?
KeyBindingTranslator::KeyDown : KeyBindingTranslator::KeyPress;
m_keyBindingTranslator.getEditorCommandsForKeyEvent(const_cast<GdkEventKey*>(&event.nativeEvent()->key), type, commandList);
}
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h 2011-07-18 01:47:28 UTC (rev 91169)
@@ -87,7 +87,7 @@
virtual void didChangeScrollbarsForMainFrame() const;
virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
virtual float userSpaceScaleFactor() const { return 1; }
- virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, Vector<WTF::String>&);
+ virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&);
virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2011-07-18 01:47:28 UTC (rev 91169)
@@ -130,7 +130,7 @@
virtual void compositionSelectionChanged(bool) = 0;
#endif
#if PLATFORM(GTK)
- virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, Vector<WTF::String>&) = 0;
+ virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&) = 0;
#endif
virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-07-18 01:47:28 UTC (rev 91169)
@@ -689,7 +689,10 @@
void executeSavedCommandBySelector(const String& selector, bool& handled);
#endif
-#if PLATFORM(GTK) || PLATFORM(EFL)
+#if PLATFORM(GTK)
+ void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
+#endif
+#if PLATFORM(EFL)
void getEditorCommandsForKeyEvent(Vector<String>&);
#endif
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2011-07-18 01:47:28 UTC (rev 91169)
@@ -139,7 +139,7 @@
#if PLATFORM(GTK)
# Support for GTK+ platform keybindings
- GetEditorCommandsForKeyEvent() -> (Vector<WTF::String> commandsList)
+ GetEditorCommandsForKeyEvent(AtomicString eventType) -> (Vector<WTF::String> commandsList)
#endif
# BackForward messages
Modified: trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp (91168 => 91169)
--- trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp 2011-07-18 01:47:28 UTC (rev 91169)
@@ -44,9 +44,9 @@
return "Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.7 (KHTML, like Gecko) Version/5.0 Safari/534.7";
}
-void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& commandsList)
+void WebPageProxy::getEditorCommandsForKeyEvent(const AtomicString& eventType, Vector<WTF::String>& commandsList)
{
- m_pageClient->getEditorCommandsForKeyEvent(m_keyEventQueue.first(), commandsList);
+ m_pageClient->getEditorCommandsForKeyEvent(m_keyEventQueue.first(), eventType, commandsList);
}
void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&)
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp (91168 => 91169)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp 2011-07-17 09:02:26 UTC (rev 91168)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp 2011-07-18 01:47:28 UTC (rev 91169)
@@ -36,8 +36,9 @@
{
ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent);
- // First try to interpret the command in the UI and get the commands.
- WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetEditorCommandsForKeyEvent(),
+ /* First try to interpret the command in the UI and get the commands.
+ UI needs to receive event type because only knows current NativeWebKeyboardEvent.*/
+ WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetEditorCommandsForKeyEvent(event->type()),
Messages::WebPageProxy::GetEditorCommandsForKeyEvent::Reply(pendingEditorCommands),
m_page->pageID(), CoreIPC::Connection::NoTimeout);
}