[Webkit-unassigned] [Bug 63081] [GTK] [WK2] Fix for getting editor client commands.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 26 06:44:31 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63081





--- Comment #5 from Lukasz Slachciak <l.slachciak at samsung.com>  2011-06-26 06:44:31 PST ---
After some investigation I get why GTK port tries to interpret commands only for KeyDown event.
This is because whole command interpretation is done at UIProcess site. But e.g in Qt port it is done at WebProcess site.

But let\s start from the beginning:
exemplary execution log is following:

(I'm putting "d" with keyboard in google search box)


webkitWebViewBaseKeyPressEvent
 WebPageProxy::handleKeyboardEvent: KeyDown
   WebEditorClient::handleKeyboardEvent: keydown
     WebEditorClient::getEditorCommandsForKeyEvent: keydown (message sync)
       WebPageProxy::getEditorCommandsForKeyEvent - commandsList
         PageClientImpl::getEditorCommandsForKeyEvent: KeyDown

  WebEditorClient::handleKeyboardEvent: keypress
    WebEditorClient::getEditorCommandsForKeyEvent: keypress (message sync)
      WebPageProxy::getEditorCommandsForKeyEvent - commandsList
    PageClientImpl::getEditorCommandsForKeyEvent: KeyDown
      WebEditorClient::handleKeyboardEvent inserting text d

  WebPageProxy::didReceiveEvent: KeyDown

webkitWebViewBaseKeyReleaseEvent
  WebPageProxy::handleKeyboardEvent: KeyUp
  WebPageProxy::didReceiveEvent: KeyUp


As you can see for original KeyPress event, two events are generated by  WebPageProxy::handleKeyboardEvent: KeyDown
In fact it is EventHandler::keyEvent who do this. For KeyDown event it generates two events: keydown and keypress which are handled by WebEditorClient::handleKeyboardEvent.

When WebEditorClient sends sync message to UI process (Messages::WebPageProxy::GetEditorCommandsForKeyEvent()) it expects that he will get those commands for current event. In the first communication it is not problem. WebPageProxy takes first event from m_keyEventQueue (KeyDown) and calls PageClientImpl::getEditorCommandsForKeyEvent.
But in the second case, after artificially genereated keypress event by EventHandler::keyEvent WebPageProxy doesn't know about it. He will take first event from the queue m_keyEventQueue (KeyDown).

In short words:
1. UIProcess gets KeyDown
2. WebProces handles calling EventHandler in WebCore
3. WebCore generates two event keydown and key press
4. Both events are handled by WebProcess
5. For each event WebProcess asks to interpret commands UIProcess.
6. WebProcess for command interpretation uses current event stored in m_keyEventQueue (which is KeyDown in both cases) AND THIS IS A PROBLEM
7. UIProcess gets KeyUp
8. For KeyUp event EventHandler::keyEvent says that he will not handle it.  


As for the patch I can add ASSERT checking if events are 
KeyDown or KeyPress
but as I described logic above KeyPress will never be passed to PageClientImpl::getEditorCommandsForKeyEvent.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list