Bug 637631 DOM manipulation marks blank page as undoably modified r=ehsan
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -413,17 +413,20 @@ var gEditorDocumentObserver =
editor.returnInParagraphCreatesNewParagraph = gPrefs.getBoolPref(kCRInParagraphsPref);
// Set focus to content window if not a mail composer
// Race conditions prevent us from setting focus here
// when loading a url into blank window
setTimeout(SetFocusOnStartup, 0);
// Call EditorSetDefaultPrefsAndDoctype first so it gets the default author before initing toolbars
+ editor.enableUndo(false);
+ editor.documentCharacterSet = prefCharsetString;
EditorSetDefaultPrefsAndDoctype();
+ editor.enableUndo(true);
// We may load a text document into an html editor,
// so be sure editortype is set correctly
// XXX We really should use the "real" plaintext editor for this!
if (editor.contentsMIMEType == "text/plain")
{
try {
GetCurrentEditorElement().editortype = "text";
@@ -2457,22 +2460,17 @@ function EditorSetDefaultPrefsAndDoctype
var prefCharsetString = 0;
try
{
prefCharsetString = gPrefs.getComplexValue("intl.charset.default",
Components.interfaces.nsIPrefLocalizedString).data;
}
catch (ex) {}
if ( prefCharsetString && prefCharsetString != 0)
- {
- editor.enableUndo(false);
- editor.documentCharacterSet = prefCharsetString;
editor.resetModificationCount();
- editor.enableUndo(true);
- }
var node = 0;
var listlength = nodelist.length;
// let's start by assuming we have an author in case we don't have the pref
var authorFound = false;
for (var i = 0; i < listlength && !authorFound; i++)
{