`EditorBase::IsInPlaintextMode` is confusing name
Categories
(Core :: DOM: Editor, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox116 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
nsIEditor.eEditorPlaintextMask is always set to TextEditor, and if the editor is for plaintext email of Thunderbird, it's also set to HTMLEditor. It's unclear that whether we can share the behavior with Thunderbird and contenteditable="plaintext-only". Therefore, I think that we should rename it like IsTextEditorOrPlaintextModeHTMLEditor.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
Now, most users of EditorBase::IsInPlaintextMode() are HTMLEditor itself.
There are some exceptions:
EditorBase::GetDesiredSpellCheckState() uses it to consider whether the root
(<body> if HTMLEditor) element's specllcheck attribute should be referred
or document's editing state. I think that this should just check
IsHTMLEditor(), but I think it must be okay to keep this as-is for now.
EditorEventListener::KeyUp() uses it to consider whether Ctrl + left/right
Shift switches the text direction of the editing host if and only if user
installed both LTR/RTL keyboard layouts and running in Windows. I think that
this should keep working in plaintext mail composer because nobody can control
the direction in plaintext editor. Therefore, this needs to check either
IsTextEditor() or IsPlaintextMailComposer() returning true.
EditorEventListener::DragEventHasSupportingData() uses it to consider
whether the editor accepts styled text and files. Therefore, it needs to check
either IsTextEditor() or IsPlaintextMailComposer() returning false.
Finally, we can stop setting nsIEditor::eEditorPlaintextMask to TextEditor.
Depends on D181836
Comment 3•2 years ago
|
||
| bugherder | ||
Description
•