AutoPlaceHolderBatch can take EditorBase class and its inherited class, AutoEditBatch, can be removed if we implement other constructor which doesn't take transaction name.
Additionally, nsIEditor::(Begin|End)PlaceHolderTransaction() are referred only by AutoPlaceHolderBatch. Therefore, they can be non-public methods and removed from nsIEditor interface.
Note that this patch also repalces "PlaceHolder" with "Placeholder" since it's a word.
MozReview-Commit-ID: 5dw3kcX3bOx
--HG--
extra : rebase_source : e926cc1c2ebea70eb08e43778a8b52912b559b7b
CreateAnonymousElement still uses nsIDOMNode, but we should use nsIContent for it.
MozReview-Commit-ID: 2xgzlE6NVra
--HG--
extra : rebase_source : c93a9acb230604da391f705b0038e3cf7fbd4f23
HTMLEditor inherits some interface classes. Therefore, CachedWeakPtr is confused at ambiguous conversion from HTMLEditor to nsISupports. Therefore, this patch adds second parameter to the template class.
MozReview-Commit-ID: KGSYJHfp1L5
--HG--
extra : rebase_source : 7189372c4c06218c3040701196eac51ded85d3fa
nsIDOMText is old interface and it needs QI to access node etc. So we should use Text etc.
MozReview-Commit-ID: 7VrTrE0p2Q9
--HG--
extra : rebase_source : baa6601708d4b71e624a4dc893cc413d7743dbeb
m-c, c-c, addons and bluegriffon don't use this interface, so we can remove it.
MozReview-Commit-ID: I8sVLpDR2gx
--HG--
extra : rebase_source : f88633271bf61ccc55098593fedff0dd7a561f21
We can replace old nsIEditor API with nsIAtom version.
MozReview-Commit-ID: EMEANldtTo0
--HG--
extra : rebase_source : 2828270d42efe1786f88f13bf20c34bd56083d41
Resizer and etc attributes on table editor still use nsIDOMElement. Converting to Element makes both implementation and the callers simpler.
MozReview-Commit-ID: TTFSvqn5GE
--HG--
extra : rebase_source : 705576c4eb0fe5f8f566f3415a8a72842c919edd
Now we can return Element directly via CreateAnonymousElement. We should use it.
MozReview-Commit-ID: Et1i3hLVSqc
--HG--
extra : rebase_source : e09c2b2b41481dd6608d9c816676030d8aae1ed6
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
In our coding rules, variable names of nsresult should be rv. Indeed, when you see |rv| in the code, you must assume that its type if nsresult.
However, a lot of code under editor/ uses |res| for the variables of nsresult. Let's replace |res| with |rv|.
And this patch improves following points:
1. When |rv| is set in both |if| and |else| block and they are check outside of them, this moves the check into each |if| and |else| block because even if the failure is notified with warning, you cannot see which case was performed and failed. This change makes it clear.
2. When |return rv;| returns non-error code because |rv| is checked with NS_ENSURE_SUCCESS() immediately before, setting replacing it with |return NS_OK;| is clearer.
3. Move declaration of |nsresult rv| into smaller scope as far as possible. This prevents setting rv to unexpected value and easier to check its value at reading the code.
MozReview-Commit-ID: 9MAqj7sFey3
--HG--
extra : rebase_source : 0fd316b851ea616b3a95d8c1afc111ff55e11993
This patch renames:
ResizerSelectionListener -> mozilla::ResizerSelectionListener
ResizerMouseMotionListener -> mozilla::ResizerMouseMotionListener
DocumentResizeEventListener -> mozilla::DocumentResizeEventListener
And making the header file name HTMLEditorObjectResizerUtils.h because it doesn't define specific class related to its file name and should be clearer that it's related to HTMLEditor.
MozReview-Commit-ID: GOJyEwtFdJV
--HG--
rename : editor/libeditor/nsHTMLObjectResizer.h => editor/libeditor/HTMLEditorObjectResizerUtils.h