Erase caret if needed when content is removed. b=304383 r=mrbkap sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@178577 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mats.palmgren%bredband.net
2005-08-22 00:25:20 +00:00
parent 6a0f96c99e
commit 2750874396
2 changed files with 13 additions and 0 deletions

View File

@@ -5501,6 +5501,15 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
NS_PRECONDITION(!mIsDocumentGone, "Unexpected ContentRemoved");
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
// XXX fix for bug 304383. Remove when bug 287813 is fixed?
if (mCaret) {
nsIFrame* frame = nsnull;
GetPrimaryFrameFor(aChild, &frame);
if (frame && (frame->GetStateBits() & NS_FRAME_EXTERNAL_REFERENCE)) {
mCaret->EraseCaret();
}
}
// Notify the ESM that the content has been removed, so that
// it can clean up any state related to the content.
mPresContext->EventStateManager()->ContentRemoved(aChild);