Last Comment Bug 622247 - Remove the hack for bug 23558
: Remove the hack for bug 23558
Status: RESOLVED FIXED
[inbound]
: inputmethod
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla13
Assigned To: Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured)
:
Mentors:
Depends on:
Blocks: 23558 271815 543789 725233
  Show dependency treegraph
 
Reported: 2010-12-31 01:22 PST by Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured)
Modified: 2012-02-15 09:16 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (11.77 KB, patch)
2012-02-08 00:02 PST, Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured)
no flags Details | Diff | Review
Patch (11.67 KB, patch)
2012-02-08 01:21 PST, Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured)
ehsan: review+
Details | Diff | Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2010-12-31 01:22:53 PST
Bug 23558 fixed the bug by hacky code. That makes a problem for implementing DOM3 composition event.

If first composition string in a transaction is empty string, editor does nothing. See nsPlaintextEditor::UpdateIMEComposition(). Against this, nsTextStore dispatches dummy text event. This will cause wrong composition event behavior. Therefore, I need to remove the hack first.
Comment 1 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2012-02-08 00:02:38 PST
Created attachment 595332 [details] [diff] [review]
Patch
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2012-02-08 01:21:53 PST
Created attachment 595342 [details] [diff] [review]
Patch
Comment 3 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2012-02-08 07:08:39 PST
Comment on attachment 595342 [details] [diff] [review]
Patch

Now, aTextRangeList must not be NULL even if OOM happened.

mIMETextNode is already NULL after InsertText. If the composition string is empty, nsEditor::InsertTextIntoTextNodeImpl() sets NULL.
http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/base/nsEditor.cpp#2490

By this change, empty text event causes deleting selected text even if it's fired immediately after compositionstart event. This is important for implementing TSF of Windows. And also, such behavior is better for consistency with other actions.

The bugs which caused current hacky implementation are tested by the new automated tests.
Comment 4 :Ehsan Akhgari (busy, don't ask for review please) 2012-02-14 07:42:01 PST
Comment on attachment 595342 [details] [diff] [review]
Patch

Review of attachment 595342 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the blow.

::: editor/libeditor/text/nsPlaintextEditor.cpp
@@ +978,2 @@
>  
> +  if (true) {

Please remove this.
Comment 5 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2012-02-14 07:46:15 PST
(In reply to Ehsan Akhgari [:ehsan] from comment #4)
> ::: editor/libeditor/text/nsPlaintextEditor.cpp
> @@ +978,2 @@
> >  
> > +  if (true) {
> 
> Please remove this.

Did you mean, should I use just |{}| instead of |if () {}|? The block is needed for nsAutoPlaceHolderBatch. After it's destroyed, we need to call NotifyEditorObservers().
Comment 6 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2012-02-14 21:55:26 PST
I removed |if (true)|, it's not just |{}|.
https://hg.mozilla.org/integration/mozilla-inbound/rev/2eaea6a86276
Comment 7 Marco Bonardo [::mak] 2012-02-15 09:16:34 PST
https://hg.mozilla.org/mozilla-central/rev/2eaea6a86276

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