--HG--
extra : rebase_source : 4f1e95223fd0c167fa5ec882b46ae36f9edbb071
This commit is contained in:
Olli Pettay 2009-11-26 11:12:20 +02:00
Родитель 302d099b34
Коммит a9ecd1c99c
1 изменённых файлов: 25 добавлений и 23 удалений

Просмотреть файл

@ -1900,6 +1900,8 @@ PresShell::Destroy()
mCurrentEventFrameStack[i] = nsnull;
}
mFramesToDirty.Clear();
if (mViewManager) {
// Clear the view manager's weak pointer back to |this| in case it
// was leaked.
@ -2862,6 +2864,29 @@ PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
// Remove frame properties
mPresContext->PropertyTable()->DeleteAllPropertiesFor(aFrame);
if (aFrame == mCurrentEventFrame) {
mCurrentEventContent = aFrame->GetContent();
mCurrentEventFrame = nsnull;
}
#ifdef NS_DEBUG
if (aFrame == mDrawEventTargetFrame) {
mDrawEventTargetFrame = nsnull;
}
#endif
for (unsigned int i=0; i < mCurrentEventFrameStack.Length(); i++) {
if (aFrame == mCurrentEventFrameStack.ElementAt(i)) {
//One of our stack frames was deleted. Get its content so that when we
//pop it we can still get its new frame from its content
nsIContent *currentEventContent = aFrame->GetContent();
mCurrentEventContentStack.ReplaceObjectAt(currentEventContent, i);
mCurrentEventFrameStack[i] = nsnull;
}
}
mFramesToDirty.RemoveEntry(aFrame);
}
return NS_OK;
@ -3633,29 +3658,6 @@ NS_IMETHODIMP
PresShell::ClearFrameRefs(nsIFrame* aFrame)
{
mPresContext->EventStateManager()->ClearFrameRefs(aFrame);
if (aFrame == mCurrentEventFrame) {
mCurrentEventContent = aFrame->GetContent();
mCurrentEventFrame = nsnull;
}
#ifdef NS_DEBUG
if (aFrame == mDrawEventTargetFrame) {
mDrawEventTargetFrame = nsnull;
}
#endif
for (unsigned int i=0; i < mCurrentEventFrameStack.Length(); i++) {
if (aFrame == mCurrentEventFrameStack.ElementAt(i)) {
//One of our stack frames was deleted. Get its content so that when we
//pop it we can still get its new frame from its content
nsIContent *currentEventContent = aFrame->GetContent();
mCurrentEventContentStack.ReplaceObjectAt(currentEventContent, i);
mCurrentEventFrameStack[i] = nsnull;
}
}
mFramesToDirty.RemoveEntry(aFrame);
nsWeakFrame* weakFrame = mWeakFrames;
while (weakFrame) {