Ensure that the event state manager doesn't send content state changed notifications for content that's been removed from the document. b=157322 r=bryner sr=kin
git-svn-id: svn://10.0.0.236/trunk@127627 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
8ec55d91d3
commit
12c9b29b2b
@ -4099,6 +4099,21 @@ nsEventStateManager::ContentRemoved(nsIContent* aContent)
|
||||
NS_RELEASE(mCurrentFocus);
|
||||
}
|
||||
|
||||
if (aContent == mHoverContent) {
|
||||
// Since hover is hierarchical, set the current hover to the
|
||||
// content's parent node.
|
||||
NS_RELEASE(mHoverContent);
|
||||
aContent->GetParent(mHoverContent);
|
||||
}
|
||||
|
||||
if (aContent == mActiveContent) {
|
||||
NS_RELEASE(mActiveContent);
|
||||
}
|
||||
|
||||
if (aContent == mDragOverContent) {
|
||||
NS_RELEASE(mDragOverContent);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -5264,6 +5264,13 @@ PresShell::ContentReplaced(nsIDocument* aDocument,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
// Notify the ESM that the content has been removed, so that
|
||||
// it can clean up any state related to the content.
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
mPresContext->GetEventStateManager(getter_AddRefs(esm));
|
||||
if (esm)
|
||||
esm->ContentRemoved(aOldChild);
|
||||
|
||||
WillCauseReflow();
|
||||
nsresult rv = mStyleSet->ContentReplaced(mPresContext, aContainer, aOldChild,
|
||||
aNewChild, aIndexInContainer);
|
||||
@ -5280,7 +5287,6 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
|
||||
{
|
||||
// Notify the ESM that the content has been removed, so that
|
||||
// it can clean up any state related to the content.
|
||||
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
mPresContext->GetEventStateManager(getter_AddRefs(esm));
|
||||
if (esm)
|
||||
|
||||
@ -5264,6 +5264,13 @@ PresShell::ContentReplaced(nsIDocument* aDocument,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
// Notify the ESM that the content has been removed, so that
|
||||
// it can clean up any state related to the content.
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
mPresContext->GetEventStateManager(getter_AddRefs(esm));
|
||||
if (esm)
|
||||
esm->ContentRemoved(aOldChild);
|
||||
|
||||
WillCauseReflow();
|
||||
nsresult rv = mStyleSet->ContentReplaced(mPresContext, aContainer, aOldChild,
|
||||
aNewChild, aIndexInContainer);
|
||||
@ -5280,7 +5287,6 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
|
||||
{
|
||||
// Notify the ESM that the content has been removed, so that
|
||||
// it can clean up any state related to the content.
|
||||
|
||||
nsCOMPtr<nsIEventStateManager> esm;
|
||||
mPresContext->GetEventStateManager(getter_AddRefs(esm));
|
||||
if (esm)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user