Bug 66514 - [Qt] editing/selection/caret-at-bidi-boundary.html fails
Summary: [Qt] editing/selection/caret-at-bidi-boundary.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 76821
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-18 17:00 PDT by Ryosuke Niwa
Modified: 2012-10-09 02:04 PDT (History)
10 users (show)

See Also:


Attachments
Patch (1.12 KB, patch)
2012-10-08 14:27 PDT, Tullio Lucena
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-08-18 17:00:54 PDT
The test added by http://trac.webkit.org/changeset/93369 is failing on Qt.  Unfortunately, I can't see the diff on http://build.webkit.org/results/Qt%20Linux%20Release/r93369%20(36616)/results.html.

Could either one of you run the test locally tell me what the diff is?
Comment 1 Csaba Osztrogonác 2011-08-19 01:42:18 PDT
Because this test times out.
Comment 2 Csaba Osztrogonác 2011-08-19 01:43:19 PDT
the test introduced in https://trac.webkit.org/changeset/93369
Comment 3 Zoltan Horvath 2011-08-19 04:38:30 PDT
I skipped the test in http://trac.webkit.org/changeset/93394.
Comment 4 Ryosuke Niwa 2011-08-19 09:50:53 PDT
Also see the bug 66551.
Comment 5 Ryosuke Niwa 2011-08-19 09:52:54 PDT
Does the test still time out if you commented out all but the first dt and dd?
Comment 6 Ryosuke Niwa 2011-08-19 18:49:20 PDT
Ah, so this is caused by Qt's DRT actually sleeping for the amount of time leapForward is called upon.  This is not how other ports implement leapForward (except Windows port which apparently has the same behavior).  The point of leapForward is so that you can call it as many time as you want with any delay as you wish without actually delaying or sleeping DRT.
Comment 8 Martin Robinson 2011-08-21 09:56:44 PDT
(In reply to comment #6)
> Ah, so this is caused by Qt's DRT actually sleeping for the amount of time leapForward is called upon.  This is not how other ports implement leapForward (except Windows port which apparently has the same behavior).  The point of leapForward is so that you can call it as many time as you want with any delay as you wish without actually delaying or sleeping DRT.

I tried in vain to remove the actual sleep from the GTK+ DRT. GTK+ internals didn't allow it though -- it broke drag and drop completely. Does this test really need to leap forward one entire second for each loop iteration? Why not just reduce the amount of time for now, since fixing all of these platforms is non-trivial?
Comment 9 Ryosuke Niwa 2011-08-21 12:16:03 PDT
(In reply to comment #8)
> I tried in vain to remove the actual sleep from the GTK+ DRT. GTK+ internals didn't allow it though -- it broke drag and drop completely. Does this test really need to leap forward one entire second for each loop iteration? Why not just reduce the amount of time for now, since fixing all of these platforms is non-trivial?

So if I reduce the amount of time, to say 100ms, then the test still time outs because my test clicks on every pixel on a text run to verify that the caret is placed on the correct location for several test cases.  Even if the text was only 50 pixels long, it'll take 5 seconds at minimum.  On the other hand, if I reduce the waiting time too much (even 100ms is too small), then DRT thinks I'm double/triple clicking and fail.

We might be able to get away with this problem if we had a way to clear click count in EventHandler.
Comment 10 Martin Robinson 2011-08-22 08:43:10 PDT
(In reply to comment #9)

> We might be able to get away with this problem if we had a way to clear click count in EventHandler.

Another possible solution to avoid leaping forward is to click once at enough distance from the original clicks to reset the internal click counter. This is at least how Windows and GTK+ work. I'm not sure about Mac, Qt and Chromium.
Comment 11 Ryosuke Niwa 2011-08-22 11:02:54 PDT
(In reply to comment #10)
> (In reply to comment #9)
> 
> > We might be able to get away with this problem if we had a way to clear click count in EventHandler.
> 
> Another possible solution to avoid leaping forward is to click once at enough distance from the original clicks to reset the internal click counter. This is at least how Windows and GTK+ work. I'm not sure about Mac, Qt and Chromium.

That IS an brilliant idea! It works on Windows at least.  Let me make a patch.
Comment 12 Martin Robinson 2011-08-22 11:12:39 PDT
(In reply to comment #11)

> That IS an brilliant idea! It works on Windows at least.  Let me make a patch.

I think a long term solution might be to have some EventSender hooks for sending a specific number of clicks. Something like eventSender.doubleClick or eventSender.click(2). That way if there are platform-specific ways to enforce click counts, we can push that to port code.
Comment 13 Ryosuke Niwa 2011-08-22 11:46:38 PDT
(In reply to comment #12)
> (In reply to comment #11)
> 
> > That IS an brilliant idea! It works on Windows at least.  Let me make a patch.
> 
> I think a long term solution might be to have some EventSender hooks for sending a specific number of clicks. Something like eventSender.doubleClick or eventSender.click(2). That way if there are platform-specific ways to enforce click counts, we can push that to port code.

I uploaded a patch on the bug 66551 per your suggestion.
Comment 14 Ryosuke Niwa 2011-08-22 15:03:26 PDT
Apparently, there's some Qt-specific bug here.  Skipped again in http://trac.webkit.org/changeset/93549.
Comment 15 Rafael Brandao 2012-01-24 14:31:34 PST
Jesus patch for bug #76821 seems to fix this one. Marking this bug as dependent of it.
Comment 16 Balazs Kelemen 2012-01-26 07:22:06 PST
It's still failing. See: https://bugs.webkit.org/show_bug.cgi?id=77102
Comment 17 Tullio Lucena 2012-10-08 14:27:45 PDT
Created attachment 167608 [details]
Patch

Unskipping test. The changes in testfonts solved this bug.
Comment 18 Yuta Kitamura 2012-10-09 01:57:13 PDT
Comment on attachment 167608 [details]
Patch

OK.
Comment 19 WebKit Review Bot 2012-10-09 02:04:47 PDT
Comment on attachment 167608 [details]
Patch

Clearing flags on attachment: 167608

Committed r130740: <http://trac.webkit.org/changeset/130740>
Comment 20 WebKit Review Bot 2012-10-09 02:04:52 PDT
All reviewed patches have been landed.  Closing bug.