This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16092 - MutationObserver.disconnect() should cancel any pending deliveries
Summary: MutationObserver.disconnect() should cancel any pending deliveries
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-23 18:25 UTC by Adam Klein
Modified: 2012-02-27 22:56 UTC (History)
7 users (show)

See Also:


Attachments

Description Adam Klein 2012-02-23 18:25:01 UTC
From rafaelw, in https://bugs.webkit.org/show_bug.cgi?id=78639:

"It's pretty strange to call disconnect() and still *possibly* get one invocation of your callback. We should just clear any pending deliveries.

It's possible that script way want to know immediately prior to calling disconnect() *what* mutation records are pending delivery. If this happens in practice, we can add a method to synchronously retrieve & clear pending mutation records."

This is easy for WebKit to change, but want to make sure it makes sense and get it fixed in the spec first.
Comment 1 Anne 2012-02-25 12:20:00 UTC
Olli, Jonas?
Comment 2 Jonas Sicking (Not reading bugmail) 2012-02-27 08:18:48 UTC
I agree we should cancel pending deliveries. addEventListener does the same thing FWIW.

I don't think we should bother with getting a list of pending deliveries unless use cases come up.
Comment 3 Olli Pettay 2012-02-27 13:28:04 UTC
(In reply to comment #2)
> I agree we should cancel pending deliveries. addEventListener does the same
> thing FWIW.
You mean removeEventListener.

I don't have strong opinion. Either way is ok to me.
Comment 4 Anne 2012-02-27 22:55:44 UTC
No need to cc me if I'm the assignee. On the other hand, this once it made me fix the bug a little quicker: https://bitbucket.org/ms2ger/dom-core/changeset/d5065a7d4427

Assuming the above means to empty the record queue per new terminology.