Closed
Bug 775468
Opened 13 years ago
Closed 5 years ago
Add chrome only API to get mutation records from MutationObserver asap it is safe to run scripts
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: Honza, Assigned: smaug)
References
Details
Attachments
(1 file)
|
16.55 KB,
patch
|
Details | Diff | Splinter Review |
New DOM Mutation Observers has been introduced to replace the old mutation events: New https://developer.mozilla.org/en/DOM/DOM_Mutation_Observers
Firebug would like to adopt these new API, but the problem is that they are not synchronous.
Firebug needs synchronous API to support features like "Break on HTML Mutation" where JS stack is climbed (at the moment when the event occurs) to find out the line of code that caused the change and break in to the debugger.
See detailed explanation of the feature here:
http://www.softwareishard.com/blog/firebug/firebug-tip-break-on-html-mutation/
---
One possible solution (suggested by smaug on IRC) would be utilizing an existing 'takeRecords' method that could fire additional 'chrome only' event.
Honza
| Reporter | ||
Comment 1•13 years ago
|
||
Related bug is Firebug issue list:
http://code.google.com/p/fbug/issues/detail?id=5490
Honza
| Assignee | ||
Comment 2•13 years ago
|
||
On forward-compatible approach is to add mozNotifyOnRecordCreation to MutationObserverInit
dictionary. The default value would be false, and only chrome can set it to true.
When set to true whenever relevant MutationRecords are created, "mutation-record-created"
would be fired (using a script runner). Subject would be the MutationObserver object.
Adding a property to the dictionary is safer than adding something to MutationObserver or to
MutationObserver constructor.
Assignee: nobody → bugs
Summary: nsIMutationObserver - implement synchronous support for HTML mutation observer → Add chrome only API to get mutation records from MutationObserver asap it is safe to run scripts
| Assignee | ||
Comment 3•13 years ago
|
||
Hmm, why notification... just calling the callback should be fine.
| Assignee | ||
Comment 4•13 years ago
|
||
I need some attribute handling changes for this.
Hi, any update on this bug?
My extension would also prefer the sync APIs (similar to Mutation Events) then the async APIs exposed by Mutation Observer. Mutation Events were lot more easier to use (I understand the reasons for deprecating them). Hopefully this FF only API is a happy middle ground.
| Assignee | ||
Comment 6•13 years ago
|
||
Just curious, how are MutationEvents easier to use?
Sync API should be limited to debugger like tools, since it is always quite slow
(no batching of various mutations).
But in any case, bug 775701 needs to be fixed, and it requires Bug 775730.
| Reporter | ||
Comment 7•13 years ago
|
||
Is there any estimate for this one?
Is final removing the old mutation events blocked by this report?
Honza
Comment 8•5 years ago
|
||
This exists now in the form of takeRecords(), right?
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•