[TSF] TSF isn't available on designMode editor

RESOLVED FIXED in mozilla19

Status

()

defect
--
major
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({inputmethod})

Trunk
mozilla19
x86
Windows 7
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

()

Attachments

(3 obsolete attachments)

TSF isn't available on designMode editor if focus is moved from another document. If Fx is activated when designMode editor has focus, then, it's available.

The cause is nsFocusManager doesn't call nsIMEStateManager::OnFocusChange() from here:

http://mxr.mozilla.org/mozilla-central/source/dom/base/nsFocusManager.cpp#1766

Then, nsIMEStateManager will try to create nsTextStateManager with old focused presContext and fail it.
The patch for this also fixes bug 789881!
Blocks: 789881
Posted patch Patch (obsolete) — Splinter Review
I found a bug when I wrote the tests. checkbox, radio button, file input and both types of <select> are focusable even in contenteditable element, but focus event is never fired on the elements.
Attachment #676838 - Flags: review?(enndeakin)

Comment 3

7 years ago
Comment on attachment 676838 [details] [diff] [review]
Patch

You shouldn't be calling CheckIfFocusable here as it can be expensive as it flushes (see bug 792297). You don't need to though, as it should always return true.
Attachment #676838 - Flags: review?(enndeakin) → review-
Posted patch Patch (obsolete) — Splinter Review
Is this enough?
Attachment #676838 - Attachment is obsolete: true
Attachment #677358 - Flags: review?(enndeakin)

Comment 5

7 years ago
I'm a bit unclear what this patch is doing. The code you changed only focuses the document and may not focus aContent, yet you pass aContent to OnChangeFocus. Did you mean to pass null?
Posted patch Patch (obsolete) — Splinter Review
(In reply to Neil Deakin from comment #5)
> I'm a bit unclear what this patch is doing. The code you changed only
> focuses the document and may not focus aContent, yet you pass aContent to
> OnChangeFocus. Did you mean to pass null?

Ah, okay. How about this.

The problem is, editor's focus event handler try creating nsTextStateManager instance. At this time, IME state must match with the new IME state which is expected by the new focused content.

If the getting focus editor is a designMode editor, the document's focus event would be used by the editor for doing above. At this time, the blurred content is stored in nsIMEStateManager since nsFocusManager doesn't call nsIMEStateManager::OnFocusChange() before dispatching the focus event of document.
Attachment #677358 - Attachment is obsolete: true
Attachment #677358 - Flags: review?(enndeakin)
Attachment #677678 - Flags: review?(enndeakin)

Updated

7 years ago
Attachment #677678 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/mozilla-central/rev/5042f0a60460
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED

Updated

7 years ago
Depends on: 808287

Comment 9

7 years ago
This seems to have caused bug 808287, which is pretty serious.  I've backed this patch out for now to see if the backout fixes bug 808287.

https://hg.mozilla.org/integration/mozilla-inbound/rev/70f7e6ce95b8
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Ehsan Akhgari [:ehsan] from comment #9)
> This seems to have caused bug 808287, which is pretty serious.  I've backed
> this patch out for now to see if the backout fixes bug 808287.
> 
> https://hg.mozilla.org/integration/mozilla-inbound/rev/70f7e6ce95b8

Merge of backout:
https://hg.mozilla.org/mozilla-central/rev/70f7e6ce95b8
Attachment #677678 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/b6bd99bf0c1f
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.