Get rid of nsIPlaintextEditor interface
Categories
(Core :: DOM: Editor, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Once bug 1540037 is fixed, we can get rid of nsIPlaintextEditor
instance which is currently not used by so many places.
https://searchfox.org/comm-central/search?q=nsIPlaintextEditor&case=false®exp=false&path=
https://github.com/therealglazou/bluegriffon/search?q=nsIPlaintextEditor&type=Code
Even though comm-central and BlueGriffon need some changes, I think that we should move all methods and constants in nsIPlaintextEditor
to nsIEditor
and get rid of nsIPlaintextEditor
.
Fortunately, QI cost from nsIEditor
to nsIPlaintextEditor
is really cheap in Firefox, Thunderbird and BlueGriffon even now. But we can make it zero cost and avoid maintaining similar interfaces for (always) accessing same instance. I.e., yes, I'd like to reduce the number of interfaces around editor.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Note that editor/ui is not used by Thunderbird any more. Only these call sites are relevant to TB:
https://searchfox.org/comm-central/search?q=nsIPlaintextEditor&case=false®exp=false&path=%5Email
Assignee | ||
Comment 2•5 years ago
|
||
First, just move all members of nsIPlaintextEditor
to nsIEditor
and make it inherits nsIEditor
.
After landing it and after a while (comm-central replaces nsIPlaintextEditor
for its contents to nsIEditor
and fix each QI), get rid of nsIPlaintextEditor
completely.
Assignee | ||
Comment 3•5 years ago
|
||
For preparing to remove nsIPlaintextEditor
interface, this patch moves
all of them to nsIEditor
, but for avoiding bustage in comm-central, makes
nsIPlaintextEditor
inherit nsIEditor
for now (i.e., even with this patch,
script can access old nsIPlaintextEditor
members with the interface.
In C++ code, this patch moves SetWrapColumn()
, InsertTextAsAction()
,
InsertTextAsSubAction()
and InsertLineBreakAsSubAction()
because
they do common things between TextEditor
and HTMLEditor
. On the other
hand, this does not move TextEditor::GetTextLength()
because it's designed
only for TextEditor
.
Comment 5•5 years ago
|
||
bugherder |
Assignee | ||
Comment 6•5 years ago
|
||
I'd like somebody to review the patch for comm-central...
Comment 7•5 years ago
|
||
== Change summary for alert #24799 (as of Sat, 25 Jan 2020 04:22:24 GMT) ==
Improvements:
2% raptor-motionmark-htmlsuite-firefox macosx1014-64-shippable opt 50.09 -> 51.25
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=24799
Assignee | ||
Comment 8•5 years ago
|
||
Could you review attachment 9123284 [details] [diff] [review]? Or redirect this review request to somebody who can do it?
(All nsIPlaintextEditor
members have been moved to nsIEditor
and nsIPlaintextEditor
inherits nsIEditor
for keeping its users accessible to the moved members via nsIPlaintextEditor
interface, but I'd like to remove nsIPlaintextEditor
interface completely as soon as possible. So, JS in comm-central should stop QI from nsIEditor
to nsIPlaintextEditor
and refer nsIEditor
interface for accessing its constants.)
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
Thank you!
I'll post new patch which removes nsIPlaintextEditor
completely.
Comment 11•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/857a1d5c4507
part 2: Make comm-central stop using nsIPlaintextEditor
interface r=jorgk
Assignee | ||
Comment 12•5 years ago
|
||
(In reply to Pulsebot from comment #11)
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/857a1d5c4507
part 2: Make comm-central stop usingnsIPlaintextEditor
interface r=jorgk
Oops, I forgot to change the reviewer, sorry for that.
Assignee | ||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 15•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Description
•