Bug 541078 - Turn editing off in BeginLoad(). r=bzbarsky.

--HG--
extra : rebase_source : 8bb4f1acfb1659d55f48651ff5e236c964c2d01e
This commit is contained in:
Henri Sivonen 2010-03-12 12:29:46 +02:00
parent 6e07d9b952
commit 1abf796204
2 changed files with 17 additions and 10 deletions

View File

@ -1069,6 +1069,21 @@ nsHTMLDocument::DocumentWriteTerminationFunc(nsISupports *aRef)
htmldoc->EndLoad();
}
void
nsHTMLDocument::BeginLoad()
{
if (IsEditingOn()) {
// Reset() blows away all event listeners in the document, and our
// editor relies heavily on those. Midas is turned on, to make it
// work, re-initialize it to give it a chance to add its event
// listeners again.
TurnEditingOff();
EditingStateChanged();
}
nsDocument::BeginLoad();
}
void
nsHTMLDocument::EndLoad()
{
@ -1985,16 +2000,6 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
mDocumentBaseURI = baseURI;
}
if (IsEditingOn()) {
// Reset() blows away all event listeners in the document, and our
// editor relies heavily on those. Midas is turned on, to make it
// work, re-initialize it to give it a chance to add its event
// listeners again.
TurnEditingOff();
EditingStateChanged();
}
// Store the security info of the caller now that we're done
// resetting the document.
mSecurityInfo = securityInfo;

View File

@ -101,6 +101,8 @@ public:
nsIContentSink* aSink = nsnull);
virtual void StopDocumentLoad();
virtual void BeginLoad();
virtual void EndLoad();
virtual nsresult AddImageMap(nsIDOMHTMLMapElement* aMap);