[webkit-help] EditorClient*::handleKeyboardEvent()

Stephan Assmus superstippi at gmx.de
Wed Feb 3 10:08:08 PST 2010

Hi all,

working on the Haiku port, I tried to figure out why I cannot input text 
into text fields. Finally, I've found out that the important details happen 
in EditorClientHaiku::handleKeyboardEvent(). The method seems to be very 
similar to the EditorClientQt implementation:

void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event)
    Frame* frame = m_page->focusController()->focusedOrMainFrame();
    if (!frame || !frame->document()->focusedNode())

    const PlatformKeyboardEvent* kevent = event->keyEvent();
    if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp)

    Node* start = frame->selection()->start().node();
    if (!start)

    if (start->isContentEditable()) {
        switch (kevent->windowsVirtualKeyCode()) {

The culprit is that the start node returns 'false' for isContentEditable(). 
If I ignore the result and execute the code as if the condition were true, 
text fields suddenly work just fine. Can anyone give me a clue as to where 
the Haiku port may do something wrong that results into this behavior? The 
previous work on the Haiku port was done by someone else, maybe this even 
used to work at the time the initial port was made.

Best regards,

More information about the webkit-help mailing list