Closed Bug 1186799 Opened 9 years ago Closed 9 years ago

composition string in contenteditable element isn't committed when you click outside of the editor

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox39 --- affected
firefox40 --- affected
firefox41 --- affected
firefox42 --- fixed
firefox-esr31 --- affected
firefox-esr38 --- affected

People

(Reporter: masayuki, Assigned: masayuki)

Details

(Keywords: inputmethod, regression)

Attachments

(2 files)

STR:

1. Set focus to a contenteditable element (e.g., tweet input box of twitter.com)
2. Click outside of the editor

Then, composition string should be committed and IME selection has gone.
Oops, this is not an e10s-specific bug...
No longer blocks: e10s-ime
Component: DOM: Content Processes → Event Handling
Keywords: regression
Summary: [e10s] composition string in contenteditable element isn't committed when you click outside of the editor → composition string in contenteditable element isn't committed when you click outside of the editor
Hmm, this regression has been already released :-(
Hmm, the cause of this bug is, selection is moved by mousedown. The selection is in non-editable element. Then, nsHTMLEditRules::IsModifiableNode() returns false and nsHTMLEditRules::WillDoAction() fails to modify the existing composition.
Component: Event Handling → Editor
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Hmm, look like that Ehsan is on vacation or something. Smaug, could you review this?

nsEditorEventListener::MouseDown() calls mEditor->ForceCompositionEnd() for committing composition when user clicks in the focused editor.

However, in HTML editor case, user may click outside of the focused editor. In such case, nsHTMLEditorEventListener::MouseDown() doesn't call nsEditorEventListener::MouseDown(). Therefore, if mousedown event is fired outside of the editor, i.e., htmlEditor->IsAcceptableInputEvent(aMouseEvent) returns false, nsHTMLEditorEventListener should call mEditor->ForceCompositionEnd() by itself.
Attachment #8644813 - Flags: review?(bugs)
This test checks if IME selections are correctly removed at committing composition.
Attachment #8644815 - Flags: review?(bugs)
CCing Ehsan, although, he may be on vacation or something.
Comment on attachment 8644813 [details] [diff] [review]
part.1 nsHTMLEditorEventListener should commit composition when it receives unacceptable mousedown event

I would just call nsEditorEventListener::MouseDown(aMouseEvent);
which happens to do exactly the same thing.
Attachment #8644813 - Flags: review?(bugs) → review+
Attachment #8644815 - Flags: review?(bugs) → review+
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/8ad9b87bac4da23ff549ecb2d2b602341f769f40
changeset:  8ad9b87bac4da23ff549ecb2d2b602341f769f40
user:       Masayuki Nakano <masayuki@d-toybox.com>
date:       Sat Aug 08 09:23:04 2015 +0900
description:
Bug 1186799 part.1 nsHTMLEditorEventListener should commit composition when it receives unacceptable mousedown event r=smaug

url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/e0a8c1d52ab9e0fa0bf133350e096b9400d8e0fd
changeset:  e0a8c1d52ab9e0fa0bf133350e096b9400d8e0fd
user:       Masayuki Nakano <masayuki@d-toybox.com>
date:       Sat Aug 08 09:23:04 2015 +0900
description:
Bug 1186799 part.2 Add test to check if IME selections are removed by committing composition caused by clicking outside of the focused contenteditable editor r=smaug
https://hg.mozilla.org/mozilla-central/rev/8ad9b87bac4d
https://hg.mozilla.org/mozilla-central/rev/e0a8c1d52ab9
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: