Changeset 91169 in webkit


Ignore:
Timestamp:
Jul 17, 2011 6:47:28 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Patch by Lukasz Slachciak <l.slachciak@samsung.com> on 2011-07-17
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.

Location:
trunk/Source/WebKit2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r91163 r91169  
     12011-07-17  Lukasz Slachciak  <l.slachciak@samsung.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5         [GTK] [WK2] Fix for getting editor client commands.
     6         https://bugs.webkit.org/show_bug.cgi?id=63081
     7
     8         Editor client commands intepretation was incorrect. It was based on the NativeWebKeyboardEvent only.
     9         In fact EventHandler is generating interpreted events - keypress and keydown. These event types
     10         are now passed from UIProcess to WebProcess so KeyBindingTranslator can correctly find editor commands.
     11         Also build break for Debug build was fixed.
     12
     13        * UIProcess/API/gtk/PageClientImpl.cpp: KeyboardEvent type is used for KeyBindingTranslator.
     14        (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): getEditorCommandsForKeyEvent now has additional
     15        parameter describing KeyboardEvent type.
     16        * UIProcess/API/gtk/PageClientImpl.h:
     17        * UIProcess/PageClient.h:
     18        * UIProcess/WebPageProxy.h:
     19        * UIProcess/WebPageProxy.messages.in:
     20        * UIProcess/gtk/WebPageProxyGtk.cpp:
     21        (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): KeyboardEvent type passed to PageClient.
     22        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
     23        (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Sync message send with KeyboardEvent type.
     24
    1252011-07-16  Daniel Bates  <dbates@webkit.org>
    226
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp

    r91097 r91169  
    5656}
    5757
    58 void PageClientImpl::getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent& event, Vector<WTF::String>& commandList)
    59 {
    60     ASSERT(event.type == WebEvent::KeyDown || event.type == WebEvent.KeyPress);
    61     KeyBindingTranslator::EventType type = WebEvent::KeyDown ?
     58void PageClientImpl::getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent& event, const AtomicString& eventType, Vector<WTF::String>& commandList)
     59{
     60    ASSERT(eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent);
     61
     62    KeyBindingTranslator::EventType type = eventType == eventNames().keydownEvent ?
    6263        KeyBindingTranslator::KeyDown : KeyBindingTranslator::KeyPress;
    6364    m_keyBindingTranslator.getEditorCommandsForKeyEvent(const_cast<GdkEventKey*>(&event.nativeEvent()->key), type, commandList);
  • trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h

    r91097 r91169  
    8888    virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
    8989    virtual float userSpaceScaleFactor() const { return 1; }
    90     virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, Vector<WTF::String>&);
     90    virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&);
    9191    virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
    9292    virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r91097 r91169  
    131131#endif
    132132#if PLATFORM(GTK)
    133     virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, Vector<WTF::String>&) = 0;
     133    virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&) = 0;
    134134#endif
    135135    virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r91097 r91169  
    690690#endif
    691691
    692 #if PLATFORM(GTK) || PLATFORM(EFL)
     692#if PLATFORM(GTK)
     693    void getEditorCommandsForKeyEvent(const AtomicString&, Vector<String>&);
     694#endif
     695#if PLATFORM(EFL)
    693696    void getEditorCommandsForKeyEvent(Vector<String>&);
    694697#endif
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r91097 r91169  
    140140#if PLATFORM(GTK)
    141141    # Support for GTK+ platform keybindings
    142     GetEditorCommandsForKeyEvent() -> (Vector<WTF::String> commandsList)
     142    GetEditorCommandsForKeyEvent(AtomicString eventType) -> (Vector<WTF::String> commandsList)
    143143#endif
    144144
  • trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp

    r86612 r91169  
    4545}
    4646
    47 void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& commandsList)
     47void WebPageProxy::getEditorCommandsForKeyEvent(const AtomicString& eventType, Vector<WTF::String>& commandsList)
    4848{
    49     m_pageClient->getEditorCommandsForKeyEvent(m_keyEventQueue.first(), commandsList);
     49    m_pageClient->getEditorCommandsForKeyEvent(m_keyEventQueue.first(), eventType, commandsList);
    5050}
    5151
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp

    r82929 r91169  
    3737    ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent);
    3838
    39     // First try to interpret the command in the UI and get the commands.
    40     WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetEditorCommandsForKeyEvent(),
     39    /* First try to interpret the command in the UI and get the commands.
     40       UI needs to receive event type because only knows current NativeWebKeyboardEvent.*/
     41    WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetEditorCommandsForKeyEvent(event->type()),
    4142                                                Messages::WebPageProxy::GetEditorCommandsForKeyEvent::Reply(pendingEditorCommands),
    4243                                                m_page->pageID(), CoreIPC::Connection::NoTimeout);
Note: See TracChangeset for help on using the changeset viewer.