Thai language selection broken.

RESOLVED WORKSFORME

Status

()

defect
RESOLVED WORKSFORME
18 years ago
8 years ago

People

(Reporter: prabhat.hegde, Assigned: smontagu)

Tracking

(Blocks 1 bug, {intl})

Trunk
Sun
Solaris
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

()

Attachments

(1 attachment)

For a description about this bug, please see:
http://bugzilla.mozilla.org/show_bug.cgi?id=100170

Have filed a separate bug for clarity.

Once again patch attached below :
Index: nsTextFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/base/src/nsTextFrame.cpp,v
retrieving revision 1.318
diff -u -r1.318 nsTextFrame.cpp
--- nsTextFrame.cpp 2001/08/21 01:47:08 1.318
+++ nsTextFrame.cpp 2001/09/17 21:39:43
@@ -83,6 +83,10 @@
 //ahmed end
 #endif // IBMBIDI

+#ifdef SUNCTL
+#include "nsILE.h"
+#endif
+
 #ifndef PR_ABS
 #define PR_ABS(x) ((x) < 0 ? -(x) : (x))
 #endif
@@ -2239,6 +2243,37 @@
   while (sdptr){
     sdptr->mStart = ip[sdptr->mStart] - mContentOffset;
     sdptr->mEnd = ip[sdptr->mEnd]  - mContentOffset;
+
+#ifdef SUNCTL
+    static NS_DEFINE_CID(kLECID, NS_ULE_CID);
+
+    nsCOMPtr<nsILE> mCtlObj;
+    mCtlObj = do_CreateInstance(kLECID, &rv);
+    if (NS_FAILED(rv)) {
+      NS_WARNING("Cell based Cursor Movement Will Not Be Supported\n");
+      mCtlObj = nsnull;
+    }
+    else {
+      PRInt32 mStart, mEnd;
+
+      if (sdptr->mEnd < textLength) {
+    mCtlObj->GetRangeOfCluster(text, PRInt32(textLength), sdptr->mEnd,
+                   &mStart, &mEnd);
+    if (sdptr->mStart > sdptr->mEnd) /* Left Edge */
+      sdptr->mEnd = mStart;
+    else
+      sdptr->mEnd = mEnd;
+      }
+
+      /* Always start selection from a Right Edge */
+      if (sdptr->mStart > 0) {
+    mCtlObj->GetRangeOfCluster(text, PRInt32(textLength), sdptr->mStart
,
+                   &mStart, &mEnd);
+    sdptr->mStart = mEnd;
+      }
+    }
+#endif
+
 #ifdef IBMBIDI // Simon - display substrings RTL in RTL frame on non-Bidi platf
orm
     if ((level & 1) && !(isRightToLeftOnBidiPlatform)) {
       PRInt32 swap  = sdptr->mStart;
@@ -3894,12 +3929,31 @@
 #endif
         aPos->mContentOffset = 0;
     PRInt32 i;

Please review and comment.

prabhat.
bstell/shanjian: can one of you review the patch?
Switching QA contact to katakai for now, please re-assign further as appropriate.
Keywords: intl
QA Contact: andreasb → katakai
assiging to bstell
Assignee: yokoyama → bstell
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.7
--> ftang
Assignee: bstell → ftang
Status: ASSIGNED → NEW
smontagu- please take a look at this one.
Assignee: ftang → smontagu
nsILE is not ready for all platform yet. move to m98
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Thanks to Roland Mainz this feature has been putback into trunk (Ref: Bugzilla 
#84380)
Marking fixed since the patch has been checked in. Who can verify that the
current Thai selection behaviour is correct?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
On my Solaris build, it seems working fine for me. But
I'll assign prabhat to QA person for verification.
Prabhat, can you try on your build?
QA Contact: katakai → prabhat.hegde
Verified on Solaris with --enable-ctl flag, Checked that selection is by
"cluster". Arthit could you independently verify this as thai user and
also Mark bug as VERIFIED?
i can't verify this prabhat,
since it still has a bug.

please see details in bug 167983.
[CTL-Thai] text with Thai/non-Thai combination, highlighting is not match with
selection
Blocks: thai
can i reopen this?
also this guaranteed the cell-based selection with keyboard only
(<shift>+arrow keys)

but NOT covers the case of selection by dragging mouse.

i've tested by dragging mouse to select Thai text,
still able to select only part of cell.

i will reopen this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Component: Internationalization → Complex Text Layout
Target Milestone: mozilla0.9.8 → ---
Depends on: grapheme-breaker
You can test the selection problem with this minimal HTML test case. See also
bug 283416 - Windows : Selection must be done by grapheme cluster boundaries
Tested on Mac OS X 10.5.2 with Minefield nightly trunk build 2008030111 seems this bug has been fixed.
I reproduce the step posted in bug 283416, can confirm Patipat comment #15 that this bug has been fixed.

Nightly build 2008030204 Mac OS X 10.5.2
no problem with Firefox 3 beta 3 on Linux (Ubuntu 8.04 Alpha 4)

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3) Gecko/2008021416 Firefox/3.0b3
Works fine on Windows XP.

Tested with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008030305 Minefield/3.0b4pre
seems to already works fine on Windows XP, Mac OS X, and Linux.

we should be able to close this,
but as this bug is originally filed as bug on Solaris, should wait response from Solaris side.
BugAThon Bangkok.

all confirmed this works ok. close.
Status: REOPENED → RESOLVED
Closed: 18 years ago12 years ago
Resolution: --- → WORKSFORME
Component: Layout: CTL → Layout: Text
QA Contact: prabhat.hegde → layout.fonts-and-text
You need to log in before you can comment on or make changes to this bug.