EditorBase stores PlaceholderTransaction with nsWeakPtr. However, retrieving its pointer requires a QI. So, for reducing the QI cost, EditorBase should use WeakPtr instead and PlaceholderTransaction needs to inherit SupportsWeakPtr instead of nsSupportsWeakReference.
MozReview-Commit-ID: IYwSTbJebMk
--HG--
extra : rebase_source : fa728b09afa826506befbeb46aba54075ecf4787
Edit transactions should store their editor instance with strong reference and they should be released at destroying the editor.
MozReview-Commit-ID: D67KU8WFxyo
--HG--
extra : rebase_source : 28c8a37498cad9f2e308eb4416cef76cf395bb9c
Currently, editor code uses following style (or similar style) in a lot of places:
if (foo)
{
}
else
{
}
This patch fixes this as conforming to our coding rules, i.e., it becomes:
if (foo) {
} else {
}
Additionally, this fixes other odd control statements in the files which include above issue because it's difficult to find following issues with searching the files:
* if (foo) bar;
* if (foo) { bar; }
* if (foo)
bar;
Finally, if it becomes much simpler than current code, this patch rewrites existing code with "early return style". But this case is only a few places because this is risky.
MozReview-Commit-ID: 2Gs26goWXrF
--HG--
extra : rebase_source : 603f9003a3566b3203bdeb27dc73ac33502d2853
This patch also renames:
EditorInputEventDispatcher -> mozilla::EditorInputEventDispatcher
And some variable names are renamed from aEditor or mEditor to aEditorBase or mEditorBase for making their types clearer.
MozReview-Commit-ID: 2FCXWpLMn8e
--HG--
rename : editor/libeditor/nsEditor.cpp => editor/libeditor/EditorBase.cpp
rename : editor/libeditor/nsEditor.h => editor/libeditor/EditorBase.h
Note that this fixes some new bustage of nsHTMLEditor.
nbsp is conflict with nsWSRunObject.cpp's same name constant. Therefore, I moved it into nsHTMLEditor and rename it to kNBSP.
And including some missing header files.
MozReview-Commit-ID: hwL8BIbSMQ
--HG--
rename : editor/libeditor/nsSelectionState.cpp => editor/libeditor/SelectionState.cpp
rename : editor/libeditor/nsSelectionState.h => editor/libeditor/SelectionState.h