c-c nor add-ons seem noet to use it. We should remove this.
MozReview-Commit-ID: 3jN8kUp6D4Z
--HG--
extra : rebase_source : cc31001bb87da2888a9c1da6d92a305cdebebb7a
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
I would like to nsIAtom and mozilla::dom::Element version of CreateAnonymousElement to clean up code. When getting/setting attirubte, editor sometimes use string, not nsGkAtoms. We should use new mozilla::dom::Element methods.
Also, we should add _moz_anonclass to atom list that uses on editor.
MozReview-Commit-ID: ICaAWVPjcej
--HG--
extra : rebase_source : 9585214aa678c16905250265a75b817c90246fcc
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