Bug 1717749: Drop `MOZ_ASSERT` check for `nsIEditor.eEditorMailMask` r=m_kato

In my understanding at fixing bug 1717156, `nsIEditor.eEditorMailMask` won't be
set to `TextEditor` instance.  However for making consistent **spellchecker**
behavior on email composer, subject editor is also set this flag.  So, we need
to drop the check in `SetFlags` and IsMailEditor.

Differential Revision: https://phabricator.services.mozilla.com/D118561
This commit is contained in:
Masayuki Nakano 2021-06-23 23:01:48 +00:00
Родитель cdcdf984e4
Коммит 88b5b85325
3 изменённых файлов: 3 добавлений и 7 удалений

Просмотреть файл

@ -683,9 +683,6 @@ NS_IMETHODIMP EditorBase::SetFlags(uint32_t aFlags) {
// So, eEditorPasswordMask is available only when we're a `TextEditor`
// instance.
MOZ_ASSERT_IF(IsHTMLEditor(), !(aFlags & nsIEditor::eEditorPasswordMask));
// eEditorMailMask specifies the editing rules of `HTMLEditor`. So, it's
// available only with `HTMLEditor` instance.
MOZ_ASSERT_IF(IsTextEditor(), !(aFlags & nsIEditor::eEditorMailMask));
// eEditorAllowInteraction changes the behavior of `HTMLEditor`. So, it's
// not available with `TextEditor` instance.
MOZ_ASSERT_IF(IsTextEditor(), !(aFlags & nsIEditor::eEditorAllowInteraction));

Просмотреть файл

@ -585,9 +585,7 @@ class EditorBase : public nsIEditor,
}
bool IsMailEditor() const {
const bool isMailEditor = (mFlags & nsIEditor::eEditorMailMask) != 0;
MOZ_ASSERT_IF(isMailEditor, IsHTMLEditor());
return isMailEditor;
return (mFlags & nsIEditor::eEditorMailMask) != 0;
}
bool IsWrapHackEnabled() const {

Просмотреть файл

@ -65,7 +65,8 @@ interface nsIEditor : nsISupports
// internal editor's readonly state.
const long eEditorReadonlyMask = 0x0008;
// If you want an HTML editor to work as an email composer, specify this flag.
// So, this is not available with text editor instances.
// And you can specify this to text editor too for making spellchecker for
// the text editor should work exactly same as email composer's.
const long eEditorMailMask = 0x0020;
// allow the editor to set font: monospace on the root node
const long eEditorEnableWrapHackMask = 0x0040;