Closed Bug 1476897 Opened 6 years ago Closed 6 years ago

HTMLEditor should inherit nsIEditorMailSupport directly and TextEditor shouldn't inherit it

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 1 obsolete file)

59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
59 bytes, text/x-review-board-request
m_kato
: review+
Details
HTMLEditor now defines overrides of nsIEditorMailSupport methods with NS_DECL_NSIEDITORMAILSUPPORT. So, if we don't need to override some of them like Rewrap(), it just increases the binary size. So, HTMLEditor should override each of them only when it's necessary.
Comment on attachment 8993570 [details] Bug 1476897 - Make HTMLEditor define overriding methods of nsIEditorMailSupport instead of using NS_DECL_NSIEDITORMAILSUPPORT Sorry for the bug spam. I change my mind. We should make HTMLEditor inherits nsIEditorMailSupport directly instead of TextEditor.
Attachment #8993570 - Flags: review?(m_kato)
Attachment #8993570 - Attachment is obsolete: true
Summary: HTMLEditor should define only necessary methods of nsIEditorMailSupport → HTMLEditor should inherit nsIEditorMailSupport directly and TextEditor shouldn't inherit it
Comment on attachment 8994140 [details] Bug 1476897 - part 5: Move implementation of TextEditor::InsertAsQuotation() to new method https://reviewboard.mozilla.org/r/258754/#review265640 Code analysis found 3 defects in this patch: - 3 defects found by clang-tidy You can run this analysis locally with: - `./mach static-analysis check path/to/file.cpp` (C/C++) If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1840 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > - selection->Collapse(newNode, 0); > + rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^ ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1840 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > - selection->Collapse(newNode, 0); > + rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^ ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1840 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > - selection->Collapse(newNode, 0); > + rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^
Comment on attachment 8994141 [details] Bug 1476897 - part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods https://reviewboard.mozilla.org/r/258756/#review265642 Code analysis found 3 defects in this patch: - 3 defects found by clang-tidy You can run this analysis locally with: - `./mach static-analysis check path/to/file.cpp` (C/C++) If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1853 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^ ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1853 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^ ::: editor/libeditor/HTMLEditorDataTransfer.cpp:1853 (Diff revision 1) > newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::style, > NS_LITERAL_STRING("white-space: pre-wrap;"), true); > } > > // and set the selection inside it: > rv = selection->Collapse(newNode, 0); Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] rv = selection->Collapse(newNode, 0); ^
Comment on attachment 8994136 [details] Bug 1476897 - part 1: Implement nsIEditorMailSupport in HTMLEditor since it's never used with TextEditor instance https://reviewboard.mozilla.org/r/258746/#review265966
Attachment #8994136 - Flags: review?(m_kato) → review+
Comment on attachment 8994137 [details] Bug 1476897 - part 2: Make TextEditor::GetEmbeddedObjects() just return NS_ERROR_NOT_IMPLEMENTED since it's never used https://reviewboard.mozilla.org/r/258748/#review265968 No one uses getEmbeddedObjects without debugQAEditorOverlay.js? I cannot find any uses from m-c, c-c and bluegriffon.
Attachment #8994137 - Flags: review?(m_kato) → review+
Comment on attachment 8994137 [details] Bug 1476897 - part 2: Make TextEditor::GetEmbeddedObjects() just return NS_ERROR_NOT_IMPLEMENTED since it's never used https://reviewboard.mozilla.org/r/258748/#review265970
(In reply to Makoto Kato [:m_kato] from comment #25) > Comment on attachment 8994137 [details] > Bug 1476897 - part 2: Make TextEditor::GetEmbeddedObjects() just return > NS_ERROR_NOT_IMPLEMENTED since it's never used > > https://reviewboard.mozilla.org/r/258748/#review265968 > > No one uses getEmbeddedObjects without debugQAEditorOverlay.js? I cannot > find any uses from m-c, c-c and bluegriffon. Ah, nsMsgCompose.cpp uses it. Sorry.
(but we should move GetEmbeddedObjects to c-c since it doesn't depend on editor code.)
Comment on attachment 8994138 [details] Bug 1476897 - part 3: Make TextEditor::InsertAsCitedQuotation() return NS_ERROR_NOT_IMPLEMENTED since nobody uses this method with TextEditor instances https://reviewboard.mozilla.org/r/258750/#review265972
Attachment #8994138 - Flags: review?(m_kato) → review+
Comment on attachment 8994139 [details] Bug 1476897 - part 4: Make TextEditor::InsertTextWithQuotations() returns NS_ERROR_NOT_IMPLEMENTED since it's never used https://reviewboard.mozilla.org/r/258752/#review265978
Attachment #8994139 - Flags: review?(m_kato) → review+
Comment on attachment 8994140 [details] Bug 1476897 - part 5: Move implementation of TextEditor::InsertAsQuotation() to new method https://reviewboard.mozilla.org/r/258754/#review265986
Attachment #8994140 - Flags: review?(m_kato) → review+
Comment on attachment 8994141 [details] Bug 1476897 - part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods https://reviewboard.mozilla.org/r/258756/#review266002
Attachment #8994141 - Flags: review?(m_kato) → review+
Comment on attachment 8994142 [details] Bug 1476897 - part 7: Drop nsIEditorMailSupport interface from TextEditor https://reviewboard.mozilla.org/r/258758/#review266004
Attachment #8994142 - Flags: review?(m_kato) → review+
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/07d193decac0 part 1: Implement nsIEditorMailSupport in HTMLEditor since it's never used with TextEditor instance r=m_kato https://hg.mozilla.org/integration/autoland/rev/39ff01e6d729 part 2: Make TextEditor::GetEmbeddedObjects() just return NS_ERROR_NOT_IMPLEMENTED since it's never used r=m_kato https://hg.mozilla.org/integration/autoland/rev/e8d209654ba4 part 3: Make TextEditor::InsertAsCitedQuotation() return NS_ERROR_NOT_IMPLEMENTED since nobody uses this method with TextEditor instances r=m_kato https://hg.mozilla.org/integration/autoland/rev/e5c9e728940a part 4: Make TextEditor::InsertTextWithQuotations() returns NS_ERROR_NOT_IMPLEMENTED since it's never used r=m_kato https://hg.mozilla.org/integration/autoland/rev/2356492fb27c part 5: Move implementation of TextEditor::InsertAsQuotation() to new method r=m_kato https://hg.mozilla.org/integration/autoland/rev/62e18ecb29ea part 6: Move implementation of both TextEditor::PasteAsQuotation() and HTMLEditor::PasteAsQuotation() to new virtual methods r=m_kato https://hg.mozilla.org/integration/autoland/rev/2c8b3ee07751 part 7: Drop nsIEditorMailSupport interface from TextEditor r=m_kato
Depends on: 1478268
(In reply to Makoto Kato [:m_kato] from comment #28) > (but we should move GetEmbeddedObjects to c-c since it doesn't depend on > editor code.) I file as bug 1478546
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: