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)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(3 files)
STR:
1. load test script
Actually Result:
Spellchecker runs automatically
Expected Result:
Spellchecker doesn't run until user move focus to contenteditable element.
Assignee | ||
Comment 1•6 years ago
|
||
(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
Assignee | ||
Comment 2•6 years ago
|
||
(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.
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
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)
Updated•6 years ago
|
Attachment #9026114 -
Flags: feedback?(m_kato) → feedback+
Assignee | ||
Comment 7•6 years ago
|
||
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
Comment 9•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Updated•6 years ago
|
Assignee: nobody → echen
You need to log in
before you can comment on or make changes to this bug.
Description
•