Open Bug 1207713 Opened 9 years ago Updated 2 years ago

Dictionary selection shows the wrong "current" dictionary if only right-clicked without preceding left-click.

Categories

(Core :: Spelling checker, defect)

43 Branch
defect

Tracking

()

People

(Reporter: jorgk-bmo, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Open two windows with the following content:
<body>
<textarea lang="en-US">this is English text</textarea>
</body>
and
<body>
<textarea lang="es-ES">texto en un libro</textarea>
</body>

Make sure spell checking is enabled for both. Left click on the English window. Now right click on the Spanish window and look at the dictionary popup. Result: The English dictionary is still selected.

Debug:
***** nsEditorEventListener::Focus on 1A84B870
***** nsEditorEventListener::Startwatch on 1A84B870
****************** en-US  <--- Language retrieved for menu
***** mPreferredLang (element) |es-ES|
***** Assigned from element/doc |es-ES|
***** Set |es-ES|.

The "current" dictionary is retrieved *before* the language for the element is determined, so we get the previous language. The line after the Startwatch was printed at:
https://dxr.mozilla.org/mozilla-central/source/toolkit/modules/InlineSpellChecker.jsm#224

If the two textareas are in the same document, the debug looks much different:
***** nsEditorEventListener::Focus on 0676B1B0
***** nsEditorEventListener::Startwatch on 0676B1B0
***** mPreferredLang (element) |es-ES|
***** Assigned from element/doc |es-ES|
***** Set |es-ES|.
****************** es-ES

So in one document, everything works fine.

This is NOT a regression from bug 697981, since I can reproduce this using this Nightly: 43.0a1 (2015-08-31).
(My dictionary changes all landed after 2nd Sept. 2015).
Attached file Video showing the bug
The video shows the problem. At the end, the left text area is spell checked in Spanish, however, the menu says English.

This is truly puzzling. I can reproduce this problem on the following *debug* builds I've tried:

- locally compiled.
- Nightly: 43.0a1 (2015-08-31)
- Nightly: 42.0a1 (2015-07-31)
- Nightly: 39.0a1 (2015-03-23) - the oldest debug build I could find
  (debug builds seem to be removed after six months).

I cannot reproduce the problem on any non-debug build I have tried, I've tried a few Nightly builds from August 2015.

Olli, would care to comment. I don't want to bother Ehsan with everything. Or who else could have an idea here?

Maybe it's a timing issue. Since it happens only with two windows, and only on debug builds (slower due to debug output), and the spell check is asynchronous, maybe the "current" dictionary is retrieved a tick too early.

If it's not visible in normal builds, it's less of an issue, but it's certainly annoying to any developer.
Flags: needinfo?(bugs)
I'm trying this on different hardware now, and the problem is harder to reproduce, but it still happens occasionally, as one can see in the picture.
Can be reproduced with one window only, see attachment 8667164 [details].
Summary: Dictionary selection shows the wrong "current" dictionary if only right-clicked without preceding left-click in a two window scenario. → Dictionary selection shows the wrong "current" dictionary if only right-clicked without preceding left-click.
Flags: needinfo?(bugs)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: