Fix for bug 401288 (Crash in Composer [@ PresShell::GetSelection][@ nsCOMArray_base::InsertObjectAt]). r/sr=bz, a=endgame.

This commit is contained in:
peterv@propagandism.org 2007-10-29 11:22:48 -07:00
parent b26ca6fd26
commit 86ecd29446
2 changed files with 2 additions and 11 deletions

View File

@ -3737,7 +3737,7 @@ nsHTMLDocument::EndUpdate(nsUpdateType aUpdateType)
{
nsDocument::EndUpdate(aUpdateType);
if (mUpdateNestLevel == 0 && EditingShouldBeOn() != IsEditingOn()) {
if (mUpdateNestLevel == 0 && mContentEditableCount > 0 != IsEditingOn()) {
EditingStateChanged();
}
}
@ -3752,7 +3752,7 @@ nsHTMLDocument::ChangeContentEditableCount(nsIContent *aElement,
mContentEditableCount += aChange;
if (mParser ||
(mUpdateNestLevel > 0 && EditingShouldBeOn() != IsEditingOn())) {
(mUpdateNestLevel > 0 && mContentEditableCount > 0 != IsEditingOn())) {
return NS_OK;
}

View File

@ -212,15 +212,6 @@ public:
mDisableCookieAccess = PR_TRUE;
}
/**
* Returns whether the document should be editable. This can be different from
* IsEditingOn() (for example if we're delaying turning the editor on/off).
*/
PRBool EditingShouldBeOn()
{
return HasFlag(NODE_IS_EDITABLE) || mContentEditableCount > 0;
}
void EndUpdate(nsUpdateType aUpdateType);
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLDocument, nsDocument)