Closed Bug 1507543 Opened 6 years ago Closed 6 years ago

Spellchecking on contenteditable elemens runs automatically (focus is not yet moved to contenteditable elemens)

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

Details

Attachments

(3 files)

Attached file test.html (deleted) —
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 [2] 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. [1] https://searchfox.org/mozilla-central/rev/d850d799a0009f851b5535580e0a8b4bb2c591d7/dom/html/nsHTMLDocument.cpp#2176 [2] 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 [2] 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.
Attached patch Patch, v1 (deleted) — Splinter Review
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 echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e2fad03c885 Spellchecker for contenteditable/design-mode should not run without focus; r=m_kato
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Assignee: nobody → echen
Regressions: 1581774
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: