Closed Bug 1507543 Opened 3 years ago Closed 3 years ago
Spellchecking on contenteditable elemens runs automatically (focus is not yet moved to contenteditable elemens)
STR: 1. load test script Actually Result: Spellchecker runs automatically Expected Result: Spellchecker doesn't run until user move focus to contenteditable element.
(In reply to Edgar Chen [:edgar] from comment #0) > Expected Result: > Spellchecker doesn't run until user move focus to contenteditable element. This is something related to bug 1489437 comment 22. The EditorSpellCheck initialization happens in nsHTMLDocument::EndUpdate() call. And the active editing host  is <div contenteditable>, so the EditorSpellCheck fetch the dictionary immediately and do spell-check after dictionary is fetched. From the reftest https://searchfox.org/mozilla-central/rev/c0b26c40769a1e5607a1ae8be37fe64df64fc55e/editor/reftests/reftest.list#122, it seems that we don't expect spellchecker runs without focus.  https://searchfox.org/mozilla-central/rev/d850d799a0009f851b5535580e0a8b4bb2c591d7/dom/html/nsHTMLDocument.cpp#2176  https://searchfox.org/mozilla-central/rev/d850d799a0009f851b5535580e0a8b4bb2c591d7/editor/libeditor/HTMLEditor.cpp#5211
(In reply to Edgar Chen [:edgar] from comment #1) > And the active editing host  is <div contenteditable> It is because we set it to end of the document in TextEditRules::Init, https://searchfox.org/mozilla-central/rev/d850d799a0009f851b5535580e0a8b4bb2c591d7/editor/libeditor/TextEditRules.cpp#167.
Comment on attachment 9026114 [details] [diff] [review] Patch, v1 We could fix this by using GetFocusedContent() to check if we allow fetching dictionary. And try result in comment #4 looks good. What do you think, Makoto? Thanks.
Attachment #9026114 - Flags: feedback?(m_kato)
Attachment #9026114 - Flags: feedback?(m_kato) → feedback+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/5e2fad03c885 Spellchecker for contenteditable/design-mode should not run without focus; r=m_kato
Assignee: nobody → echen
You need to log in before you can comment on or make changes to this bug.