Closed
Bug 742371
Opened 14 years ago
Closed 14 years ago
Remove MutationReceiver from MutationObserver when the target is deleted
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: smaug, Assigned: smaug)
Details
Attachments
(2 files)
|
7.99 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
|
8.13 KB,
patch
|
Details | Diff | Splinter Review |
Currently if target is deleted, MutationObserver ends up having receivers
with null target. Nothing scary there, but no need to keep such things
alive.
This patch fixes also transient receiver disconnecting.
s/Disconnect/DisconnectTransientReceiver/
The patch adds also some warnings and assertions.
Attachment #612183 -
Flags: review?(jonas)
Comment on attachment 612183 [details] [diff] [review]
patch
If I understand correctly NodeWillBeDestroyed can only be called on non-transient receivers, since transient receivers are always attached to nodes which we hold a strong reference to in a MutationRecord.
Is this correct?
If so, could you add an assertion to NodeWillBeDestroyed that checks that the receiver doesn't have a parent? Mostly as documentation, but also to make sure that we don't have any bad bugs.
Attachment #612183 -
Flags: review?(jonas) → review+
| Assignee | ||
Comment 2•14 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #1)
> Comment on attachment 612183 [details] [diff] [review]
> patch
>
> If I understand correctly NodeWillBeDestroyed can only be called on
> non-transient receivers, since transient receivers are always attached to
> nodes which we hold a strong reference to in a MutationRecord.
>
> Is this correct?
No, but nsMutationObserver has node->transientobserverlist hashtable.
That keeps node and transientobservers alive.
>
> If so, could you add an assertion to NodeWillBeDestroyed that checks that
> the receiver doesn't have a parent? Mostly as documentation, but also to
> make sure that we don't have any bad bugs.
Sure.
| Assignee | ||
Comment 3•14 years ago
|
||
| Assignee | ||
Comment 4•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Makes sense.
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•