зеркало из https://github.com/mozilla/pjs.git
Bug 742636 - Keep observed node alive during microtask if there are transient observers, r=sicking
This commit is contained in:
Родитель
bfc9311ffd
Коммит
5fdaa5e95c
|
@ -152,7 +152,7 @@ protected:
|
||||||
nsMutationReceiverBase(nsINode* aRegisterTarget,
|
nsMutationReceiverBase(nsINode* aRegisterTarget,
|
||||||
nsMutationReceiverBase* aParent)
|
nsMutationReceiverBase* aParent)
|
||||||
: mTarget(nsnull), mObserver(nsnull), mParent(aParent),
|
: mTarget(nsnull), mObserver(nsnull), mParent(aParent),
|
||||||
mRegisterTarget(aRegisterTarget)
|
mRegisterTarget(aRegisterTarget), mKungFuDeathGrip(aParent->Target())
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mParent->Subtree(), "Should clone a non-subtree observer!");
|
NS_ASSERTION(mParent->Subtree(), "Should clone a non-subtree observer!");
|
||||||
mRegisterTarget->AddMutationObserver(this);
|
mRegisterTarget->AddMutationObserver(this);
|
||||||
|
@ -195,6 +195,9 @@ protected:
|
||||||
// This is different than mTarget when dealing with transient observers.
|
// This is different than mTarget when dealing with transient observers.
|
||||||
nsINode* mRegisterTarget;
|
nsINode* mRegisterTarget;
|
||||||
nsCOMArray<nsMutationReceiverBase> mTransientReceivers;
|
nsCOMArray<nsMutationReceiverBase> mTransientReceivers;
|
||||||
|
// While we have transient receivers, keep the original mutation receiver
|
||||||
|
// alive so it doesn't go away and disconnect all its transient receivers.
|
||||||
|
nsCOMPtr<nsINode> mKungFuDeathGrip;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mSubtree;
|
bool mSubtree;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче