Bug 47273 - [Qt][S60] Junk text is shown in textbox when text is highlighted
Summary: [Qt][S60] Junk text is shown in textbox when text is highlighted
Status: RESOLVED DUPLICATE of bug 39625
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: S60 Hardware S60 3rd edition
: P2 Major
Assignee: QtWebKit Unassigned
Depends on: 39625
  Show dependency treegraph
Reported: 2010-10-06 09:19 PDT by Ankur Baranwal
Modified: 2010-11-01 06:37 PDT (History)
8 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ankur Baranwal 2010-10-06 09:19:59 PDT
Qt: 4.7
QtWebkit: 2.1
OS: Symbian^3

Steps to reproduce the error -
1. Open www.google.com in Anomaly Browser.
2. Select the search text box. Virtual keypad opens.
3. Enter "hello" and highlight the word.
4. Now press ok button on virtual keypad.

Expected Result -
After step 4, "hello" word is displayed in text box.

Actual Result -
After step 4, "hellohello" is displayed in the text box.

Additional Info -
This bug is not reproducible on native applications and in sample Qt application.
Comment 1 Ramesh 2010-10-08 05:18:21 PDT
This is a Blocker issue for us.Can you raise this priority to P0-Blocker and work on it?
Comment 2 Suresh Voruganti 2010-10-11 08:38:55 PDT
This error is moved from wrt team Boston Defect -6537
 and the analysis in 6537 doesnt prove that it is Qtwebkit error. Wrt team need to analyse and prove that it is Qtwebkit error, so ignoring the error as now. Re-open the error after analysis if the problem seems to be in QtWebkit.
Comment 3 Ankur Baranwal 2010-10-14 02:00:33 PDT
This bug is reproducible using QtTestBrowser.

I debugged this further and found that following piece of code which, it seems, was introduced in Webkit2.1. Whenever control passes through this code, text is getting repeated.

void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)

#if QT_VERSION >= 0x040600
        if (hasSelection) {
            QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString();
            if (preedit.isEmpty() && selection.start + selection.length > 0)
                preedit = text;
            editor->setComposition(preedit, underlines,
                                   (selection.length < 0) ? selection.start + selection.length : selection.start,
                                   (selection.length < 0) ? selection.start : selection.start + selection.length);
        } else

It seems text is getting appended to older string every time in QString(renderTextControl->text()).

Also, this happens even if we simply click on empty area in the virtual keypad.

This behavior is not seen with the Address bar text field. It happens only within the html text field.
Comment 4 Andreas Kling 2010-10-14 07:04:40 PDT
CC'ing Robert since he introduced this code block in <http://trac.webkit.org/changeset/58218>
Comment 5 Suresh Voruganti 2010-10-14 07:20:05 PDT
Adding dependency to 39121 as it is top issue for services.
Comment 6 Robert Hogan 2010-10-14 11:15:56 PDT
(In reply to comment #4)
> CC'ing Robert since he introduced this code block in <http://trac.webkit.org/changeset/58218>

What we need to do is outlined by Simon in:


Unfortunately I never got round to implementing it. I can look at it this weekend, but if the priority needs to be higher then someone should do it before me.
Comment 7 Robert Hogan 2010-10-17 10:10:30 PDT
There is a patch up for review at:


Let me know if it works for you.

Also, as someone who only has the unit tests to go on, can you provide a unit test for this case similar to those in tst_qwebpage?
Comment 8 neelkanth 2010-10-18 01:36:35 PDT
Please provide the LE?
Comment 9 Andreas Kling 2010-10-18 03:41:15 PDT
(In reply to comment #8)
> Please provide the LE?

Please refrain from using Nokia jargon on public issue trackers.
Comment 10 Robert Hogan 2010-10-22 12:36:52 PDT
Hi Ankur,

Is this fixed for you in trunk now?
Comment 11 Ankur Baranwal 2010-10-30 04:05:30 PDT
Hi Robert, the problem is fixed in trunk now. Thanks.
Comment 12 Suresh Voruganti 2010-11-01 06:36:15 PDT
Duplicating this error to 39625
as the patch for 39625 fixed this issue.

*** This bug has been marked as a duplicate of bug 39625 ***