Closed
Bug 98434
Opened 23 years ago
Closed 22 years ago
IME does not work correctly at the last characters in the text field
Categories
(Core :: Internationalization, defect, P2)
Core
Internationalization
Tracking
()
VERIFIED
FIXED
mozilla1.2beta
People
(Reporter: teruko, Assigned: mozeditor)
References
()
Details
(Keywords: inputmethod, intl, Whiteboard: fixinhand)
Attachments
(1 file, 2 obsolete files)
6.77 KB,
patch
|
mozeditor
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
IME does not work correctly at the last characters in the text field.
Steps of reproduce
1. Go to above URL
2. Move the cursor to the 5th text field under Customer ID: 2667
Maxlength of this field is 2 which means you can type 2 characters (even
though single byte characters or double byte characters.) - see bug 18284.
3. Turn on IME (Make sure hiragana mode).
4. Type "ke"
Japanese hiragana "け" is displayed with underline (since this is
unconverted, yet.)
5. Hit return to convert
6. Type "ke" again
At this time, Japanese hiragana unconverted "け" with underline is not
displayed.
It should be displayed "け". Once hit the return to convert, Japanese "け"
is displayed.
If you type "ke" and hit space key to select one of the chinese characters from
candidate window, the chinese character sometime are not displayed after you
committed in the last characters of the Max length field.
Tested 9-05 trunk Win32 and Linux build.
Updated•23 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•23 years ago
|
||
I think this should be mine...
096
Assignee: yokoyama → jfrancis
Status: ASSIGNED → NEW
Target Milestone: --- → mozilla0.9.6
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Comment 4•23 years ago
|
||
pushing off 098 to 099
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Assignee | ||
Comment 5•23 years ago
|
||
setting milestones based on reprioritization of buglist
Target Milestone: mozilla0.9.9 → mozilla1.0.1
Comment 6•23 years ago
|
||
*** Bug 109818 has been marked as a duplicate of this bug. ***
Comment 7•23 years ago
|
||
*** Bug 109263 has been marked as a duplicate of this bug. ***
Comment 8•23 years ago
|
||
Marking nsbeta1-.
Comment 10•23 years ago
|
||
This bug is serious for Japanese environment (probably other languages also).
I wrote a patch.
I hope this bug will be fixed soon.
Comment 11•23 years ago
|
||
This patch has been tested on Linux and Win2k.
I know this patch is too rough and not enough modularized hack.
Please refine it.
Assignee | ||
Comment 12•23 years ago
|
||
The trunk is the wave of the future!
Target Milestone: mozilla1.0.1 → mozilla1.1beta
Assignee | ||
Comment 13•22 years ago
|
||
The days of having a half dozen milestones out in front of us to divide bugs
between seem to be gone, though I dont know why. Lumping everything together as
far out as I can. I'll pull back things that I am working on as I go.
Target Milestone: mozilla1.1beta → mozilla1.2beta
Comment 14•22 years ago
|
||
it seems IE allow two characters (in this case of sjis, 4bytes)
http://www.w3.org/TR/html4/index/attributes.html said it is "max chars for text
fields"
what will we break without fixing this ?
remove nsbeta1- and change to nsbeta1 for m1.2final release
Comment 15•22 years ago
|
||
The main reason of this bug is nsTextEditRules::TruncateInsertionIfNeeded().
(see Bug 109818 also)
It truncates inputed string from IME according to MAXLENGTH.
We should do this truncation not when received converting string (underline
displayed), but only when received determined string (no-underline displayed).
Currently there is no way to decide if received string is determined one or not
in nsTextEditRules::TruncateInsertionIfNeeded().
Additionally, this method receives inputed string from IME not only a char you
typed, but all of converting string.
So, you must calculate for the truncation as follows:
acceptable length = MAXLENGTH - ( docLength - selectionLength - (length of
previous converting string))
, where docLength means the length of strings the input field has (containing
previous converting string).
Current implementation lacks this minusing of converting string.
My patch fixes these problem.
It hacks nsEditor and adds a method. I think it is not modularized hack.
Assignee | ||
Comment 16•22 years ago
|
||
Comment on attachment 89029 [details] [diff] [review]
patch
r=jfrancis. thanks for working on this skamio.
Attachment #89029 -
Flags: review+
Assignee | ||
Comment 18•22 years ago
|
||
I want to think about this some more. I believe there is a better way to tell
if we are editting uncommited IME. I'll comment when I know more.
Comment 20•22 years ago
|
||
Comment on attachment 89029 [details] [diff] [review]
patch
kin, please superreview the patch.
jfrancis, have you found the better way?
Attachment #89029 -
Flags: superreview?(kin)
Comment 21•22 years ago
|
||
Comment on attachment 89029 [details] [diff] [review]
patch
I'm a bit backed up on review requests so I'd like to hear feedback from
jfrancis before doing a review.
Assignee | ||
Comment 22•22 years ago
|
||
Kin, go ahead. I don't realy understand the various types of IME Text Range
Lists, and I don't know if there is a more elegant way to detect the state they
need.
Assignee | ||
Updated•22 years ago
|
Whiteboard: fixinhand
Comment 23•22 years ago
|
||
Comment on attachment 89029 [details] [diff] [review]
patch
==== Why do we need to add this to a public interface (nsIEditor.idl) if it's
only use is in the TextEditRules where |mEditor| is an nsPlaintextEditor which
has access to methods that are defined on our nsEditor implementation? If for
some other reason it has to be in a public interface, shouldn't it be in
nsIEditorIMESupport.idl?
+
+ /* -- Hack -- */
+ long getIMEBufferLength();
==== Can we keep |IsComposing()| and |SetIsComposing()| functions next to each
other in the .cpp file? According to the diff they will be roughly 1600 lines
apart.
==== This leaks since |Item()| addrefs the pointer it returns.|rangePtr|
should be a COMPtr and |getter_AddRefs()| should be used.
+ result = mIMETextRangeList->Item(i, &rangePtr);
==== Shouldn't we be clearing |mIsComposing| in |EndComposition()| so that the
following will still work after previously using IME?
+ if ((-1 != aMaxLength) && (mFlags &
nsIPlaintextEditor::eEditorPlaintextMask) && !mEditor->IsComposing())
Attachment #89029 -
Flags: superreview?(kin) → superreview-
Assignee | ||
Comment 24•22 years ago
|
||
Kin's last comment reminds me of what I was thinking about so long ago:
Why can't mIsComposing be driven entirles off of
StartComposition()/EndComposition()?
Comment 25•22 years ago
|
||
BeginComposition()/EndComposition() are triggered when IME is activated/deactivated.
However, Japanese IME has two states in activated mode.
We have no way to distinguish the states in current implementation.
One state is Composition mode. Another is Committed mode.
(I don't know suitable words to call them. See also comment#9 of bug 109818.)
It seems that we can distinguish them according to IME Text Range Lists.
> ==== Shouldn't we be clearing |mIsComposing| in |EndComposition()| so that the
> following will still work after previously using IME?
Although my patch will properly set mIsComposing before using it,
it should be cleared.
Thanks, kin. I will fix my patch.
Comment 26•22 years ago
|
||
I moved GetIMEBufferLength() and other methods into nsEditor class.
There is no needs to define them in public interface.
And I made some changes in names of methods and variables.
Please super-review.
Updated•22 years ago
|
Attachment #89029 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #107767 -
Flags: superreview?(kin)
Comment 27•22 years ago
|
||
Comment on attachment 107767 [details] [diff] [review]
patch v2
Ok, we're close ...
==== If we're not going to use the pre-existing |mIsComposing|, shouldn't it be
removed?
==== |SetIsIMEComposing()| returns an nsresult, but none of the return
statements return values. Should it be changed to have a void return value
since the callers never check it anyways?
==== Wow, the indentation of the IME related memebers is really messed up ...
not your fault though. If you feel like fixing the indentation as part of your
checkin, by all means go ahead. :-)
@@ -563,6 +566,8 @@
nsCOMPtr<nsIDOMCharacterData> mIMETextNode; // current IME text node
PRUint32 mIMETextOffset; //
offset in text node where IME comp string begins
PRUint32 mIMEBufferLength; //
current length of IME comp string
+ PRBool mIsIMEComposing; // is IME in composition state?
+ // This is different from
mInIMEMode. see Bug 98434.
Attachment #107767 -
Flags: superreview?(kin)
Attachment #107767 -
Flags: superreview-
Attachment #107767 -
Flags: review?(jfrancis)
Comment 28•22 years ago
|
||
This will make us happy :->
Attachment #107767 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #108194 -
Flags: superreview?(kin)
Updated•22 years ago
|
Attachment #107767 -
Flags: review?(jfrancis)
Reporter | ||
Comment 29•22 years ago
|
||
Changed QA contact to kasumi@netscape.com.
QA Contact: teruko → kasumi
Comment 30•22 years ago
|
||
Attachment #108194 -
Flags: superreview?(kin) → superreview+
Updated•22 years ago
|
Attachment #108194 -
Flags: review?(jfrancis)
Assignee | ||
Updated•22 years ago
|
Attachment #108194 -
Flags: review?(jfrancis) → review+
Assignee | ||
Comment 31•22 years ago
|
||
fix landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 32•22 years ago
|
||
This problem is fixed with 2002122208-trunk/WinXP.
This problem is important bug for Japanese,
So it should be fixed on 1.0branch and Netscape7.
Updated•22 years ago
|
Attachment #108194 -
Flags: approval1.0.x?
Comment 33•22 years ago
|
||
Verified this specific problem was fixed in 12-26 trunk build on WinXP, WinME
and linux RH7.2. However, the red underline doesn't display with un-commit
mode, open a new bug 186832 and mark this one as verified.
Please nominate as different keyword if want to check-in to other branch build.
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Attachment #108194 -
Flags: approval1.0.x?
Updated•15 years ago
|
Keywords: inputmethod
You need to log in
before you can comment on or make changes to this bug.
Description
•