Closed Bug 128394 Opened 23 years ago Closed 23 years ago

Cursor position widely off from actual text when selection is made.

Categories

(MailNews Core :: Internationalization, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: tarahim, Assigned: shanjian)

Details

(Keywords: regression, Whiteboard: [adt1])

Attachments

(4 files, 1 obsolete file)

2002022508 trunk for MacOS9.x In mail or news messages, text selection by click and drag shows that the cursor position is far left to the point where the actual text being selected is. The cursor position matches with the text only at the beginning of the line. This happens with single-byte text, but not with 2-byte text. If the text is encoded in iso-20022-JP, even the single-byte text is selected correctly without wrong cursor position. For example, if you first place the cursor at the beginning of the line and start selecting toward the end of the line, the actual selection reaches the end of the line by the time your corsor position has proceeded to 80 to 90%.
Is this about mail composer or message view? >This happens with single-byte text, but not with 2-byte text. >If the text is encoded in iso-20022-JP, even the single-byte text is selected >correctly without wrong cursor position. Does this mean problem if "us-ascii" or "ISO-8859-1"?
I am seeing this in message view only. Composer window is not affected. Both ISO-8899-1 and us-ascii show this bug.
Then probably this is not international bug. Need more info. Are you using Japanese MacOS 9? Do you see the problem for both html and plain text mail? What fonts do you set for Western language?
Status: NEW → ASSIGNED
I do not have a good example for HTML mail now, but I suppose it does not happen since browser window is OK including textarea of forms, though I see some problem with URL bar(separate bug, I guess). I have tested OSX10.1.3, and it happens the same way as OS9(Japanese). For Western monospace fonts, I tested Courier, Courier New, and Monaco. They all showed this bug. When I changed the font for mono-space to Helvetica, the error became reversed: this time, selection laged the cursor in rightward movement, and the selection was ahead in leftwardmovement.
How about plain text file in browser? Do you also see the problem? I actually cannot reproduce the problem (with us-ascii plain text mail like bugzilla bug) on MacOS X. Do I need to set the default language to Japanese?
I have default language for viewing mail/news set as Western ISO-8859-1. Is the text in this bugzilla form a plain text in your context? If so, I see no problem with plain texts in Browser window.
>Do I need to set the default language to Japanese? This, I meant for the language of MacOS X. >with us-ascii plain text mail like bugzilla bug This was a mistake, I meant for reading bugzilla mails in the mail client. I don't see the selection problem.
I do not know how to change the default language in OSX, but mine is Japanese version, I suppose. Due to e-mail address change, I do not receive the bugzilla mails. But I have several plain text mails in us-ascii and iso-8859-1 in addition to mozilla news group messages which all show this problem. I have just downloaded 0304 build for MacOS9.x, and it still shows this bug. I am sure this is relatively new, (probably started around 20020220 build), since it does not happen in 20011206 trunk build which I sometimes use as a reference.
I used today's commercial trunk but cannot see the problem. I tried the newsgroup netscape.public.mozilla.macosx. My font for western is helvetica 16 and courier 13. Used OS X 10.1.3, I set my system default to Japanese (by using the system preference).
Then, this may be a Mozilla-only problem. 2002030508 trunk Fizilla is still affected. Another way to demonstrate this problem is double clicking on a word in a line, which should select the word. If this bug is present, double clicking on a word at the beginning of a line selects the word correctly. However, when you try it on a word near the end of a long line, the selection is made for the next word.(BTW this is for fixed-width font)
Cc to marina, ylong, I need IQA help for this.
I checked it on 03-06 trunk build/Mac OS X and 02-28 build build / Mac9.1-JA: 1. Mac9.1-JA & Mac OS 10.1.3 with JA default locale: When charset set to iso-2022-jp will work fine, and when charset set to western or Chinese then will see the problem. 2. Mac OS 10.1.3 with US locale: When charset is marked as western, it works fine, but when I set to iso-2022-JP or other double byte charset then will see the problem. Seems like if we use charsets that not followed the OS locale, then will has the problem.
Keywords: nsbeta1
Is this a regression? does this only happen in plain text ? nsbeta1+ reassign to ftang
Assignee: nhotta → ftang
Status: ASSIGNED → NEW
Keywords: nsbeta1nsbeta1+
assign
Status: NEW → ASSIGNED
I cannot reproduce this issue. need help from ylong.
The problem is related to the 'lang' attribute used for mail view. The selection is wrong when 'lang' is specified.
OS: Mac System 9.x → All
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.0
P2. nhotta- which fix cause this regression ?
Priority: -- → P2
Immediate cause was by bug 102623 which changed to specify lang for the message display. But there is a generic selection problem with lang attribute specified because it is reproducible by browser (using the attachment #73320 [details]). NS6.2 does not have the selection problem with the attachment.
reassign to shanjian
Assignee: ftang → shanjian
Status: ASSIGNED → NEW
There is another text selection problem caused by an attribute, align="justify". (Bug 11682.)
Whiteboard: adt1
Attached patch patch (obsolete) — Splinter Review
Attached file a simplified testcase
As shown in the simplified testcase, we failed to utilize langGroup info when prepare font for locating cursor position within text frame. My patch correct this. I thought about change the definition of nsIPresContext::GetMetricsFor. There are 2 reasons that makes me not do so. First, there are many reference to this method, so extensive changes need to be made. Second, almost all the calls except the one I modified are used to render things like bullet, br, and so on. They don't really care about langGroup.
Status: NEW → ASSIGNED
rbs, could you review my patch?
Comment on attachment 76424 [details] [diff] [review] patch r=rbs >Use nsCOMPtr + nsIFontMetrics* fm; [...] + NS_IF_RELEASE(fm);
rbs, nsIDeviceContext::GetMetricsFor takes nsIFontMetrics*& instead of nsIFontMetrics**, and add_ref is done inside GetMetricsFor. That's why I did not use nsCOMPtr.
-> nsCOMPtr<nsIFontMetrics> fm; deviceContext->GetMetricsFor(font->mFont, langGroup, *getter_AddRefs(fm));
Attached patch update patchSplinter Review
Attachment #76424 - Attachment is obsolete: true
Attachment #76451 - Flags: review+
Marc, could you sr?
Comment on attachment 76451 [details] [diff] [review] update patch sr=attinasi (you might want to check for |visibility| not being null before you check for |visibility->mLanguage| though)
Attachment #76451 - Flags: superreview+
Comment on attachment 76451 [details] [diff] [review] update patch a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #76451 - Flags: approval+
Impact Summery Impact Platform: ALL Impact language users: 650M 100% Probability of hitting the problem: HIGH, selection in all the mail messages and some web page have this problem Severity if hit the problem in the worst case: Selection is totaly off, it will be very difficult for user to perform select&cut/copy action. Way of recover after hit the problem: None Risk of the fix: MID Potential benefit of fix this problem: Other display problems? regression, suggest adt1
Keywords: regression
adt1.0.0 high impact bug please test against mail viewing.
Keywords: adt1.0.0
Tested with mail, I could not see any problem after the patch.
adt1.0.0+ (on ADT's behalf) for checkin into 1.0, but pls test it on all platforms before we check it in.
Whiteboard: adt1 → [adt1]
Keywords: adt1.0.0adt1.0.0+
I verified my patch on Linux. It works as expected.
I tested (attachments id=73320, id=76425) on MacOS X with the patch I did not see the selection problem. Does the patch affects for viewing only? No editor testing is needed?
Yes, this patch only affect display. If there is problem in editor, that will be a different issue.
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified as fixed.
Status: RESOLVED → VERIFIED
I did not see this problem in Mozilla 1.21 for OS X. Running 1.3b, all of a sudden it shows up.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: