Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 198759 - [PATCH] wrong cursor movement between lines
Summary: [PATCH] wrong cursor movement between lines
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Christopher Aillon
QA Contact:
Depends On:
Blocks: FC6Target
TreeView+ depends on / blocked
Reported: 2006-07-13 11:05 UTC by Akira TAGOH
Modified: 2007-11-30 22:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-09-12 02:52:16 UTC

Attachments (Terms of Use)
proposed patch (deleted)
2006-08-30 13:37 UTC, Akira TAGOH
no flags Details | Diff
Better Patch (deleted)
2006-09-06 07:08 UTC, Christopher Aillon
no flags Details | Diff

System ID Priority Status Summary Last Updated
Mozilla Foundation 335810 None None None Never

Description Akira TAGOH 2006-07-13 11:05:01 UTC
Description of problem:
When press Up/Down key to move the cursor up/down, the cursor should keeps the
current column if the above/below line has the same length of text or more. but
the cursor goes to the top of line or the end of line.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.move the cursor up/down on the textarea.
Actual results:
the cursor is moved to the top of line or the end of line.

Expected results:
should be the same column if the moved line has same length or more.

Additional info:
this issue is gone if I run firefox with MOZ_DISABLE_PANGO=1.

Comment 1 Lawrence Lim 2006-07-13 11:18:19 UTC
I can reproduce the bug as well. 

Comment 2 Akira TAGOH 2006-08-30 13:37:46 UTC
Created attachment 135207 [details]
proposed patch

after some debugging, this issue was introduced by the misuse of the return
value from pango_layout_xy_to_index. after applying this patch, it works fine.

Comment 3 Behdad Esfahbod 2006-09-05 22:57:29 UTC
The patch has a couple of problems.

Just removing that "if (found)" block completely fixes the problem.

Comment 4 Akira TAGOH 2006-09-06 03:30:28 UTC
You mean "if (!found)"?  it just works without even "if (!found)" block though,
I'm not quite sure what problems it has.

Comment 5 Christopher Aillon 2006-09-06 07:06:11 UTC
The problems the old patch had were that it got the direction for the context,
but it should have gotten the context for the line as they could be different. 
Also, your getting the direction didn't actually effect the program at all since
you did the same thing for both the if (dir == PANGO_DIRECTION_LTR) part and the
else part.

But all that said, there was no adjustment needed.  Pango does the right thing
with the positioning, and the return value is more informative than anything in
this specific case.

Comment 6 Christopher Aillon 2006-09-06 07:08:33 UTC
Created attachment 135626 [details]
Better Patch

Better patch.  Thanks for tracking the main issue down, tagoh!

Comment 7 Akira TAGOH 2006-09-06 10:00:00 UTC
I see. you're right. getting the direction didn't effect anything indeed. and
your patch is working fine.  Thanks for the clarification.

Comment 8 Christopher Aillon 2006-09-12 02:52:16 UTC
Fixed in latest versions in rawhide.

Note You need to log in before you can comment on or make changes to this bug.