Skip to content

Commit

Permalink
Bug 1717749: Drop MOZ_ASSERT check for nsIEditor.eEditorMailMask
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
masayuki-nakano committed Jun 23, 2021
1 parent 7780d0d commit ace66ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions editor/libeditor/EditorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 1 addition & 3 deletions editor/libeditor/EditorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion editor/nsIEditor.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ace66ca

Please sign in to comment.