[Webkit-unassigned] [Bug 35933] [Qt] [Symbian] Can not backward select (highlight) text using virtual keyboard

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 9 11:55:19 PST 2010


--- Comment #2 from shen yi <shenyi2006 at gmail.com>  2010-03-09 11:55:19 PST ---
This issue is Qt only, and the root cause is that webcore assumes the
selection's start position is always before the end position.

In RenderTextControl.cpp;

void RenderTextControl::setSelectionEnd(int end)
    setSelectionRange(min(end, selectionStart()), end);

The setSelectionEnd(int) function was called from
QWebPagePrivate::inputMethodEvent(QInputMethodEvent*) at qwebpage.cpp

  case QInputMethodEvent::Selection: {
     if (renderTextControl) {
         renderTextControl->setSelectionEnd(a.start + a.length);

However, in above code, the a.length, which is from QcoeFepInputContext, is
negative when doing backward selection:

void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection&) {
    int pos = aCursorSelection.iAnchorPos;
    int length = aCursorSelection.iCursorPos - pos;
    QList<QInputMethodEvent::Attribute> attributes;
    attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection,
pos, length, QVariant());

It can explain why the backward selection doesn't work, that is,

when start position is larger than end position,

setSelectionRange(min(end, selectionStart()), end);
setSelectionRange(end, end);

The patch I attached would check/adjust the start & end position before calling
the setSelectionStart & setSelectionEnd. I have tested it on both s60 emulator
& target.

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