Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 382124

Summary: [firefox] remove mutation event listeners
Product: [ECD] Orion Reporter: Mihai Sucan <mihai.sucan>
Component: EditorAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: mihai.sucan, Silenio_Quarti
Version: 0.5Flags: mihai.sucan: review+
Target Milestone: 0.5 RC2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix mihai.sucan: review+

Description Mihai Sucan CLA 2012-06-08 11:49:06 EDT
(based on https://bugzilla.mozilla.org/show_bug.cgi?id=760980 )

Please remove the mutation event listeners from Orion. I see there's the DOMCharacterDataModified mutation event listener.

We are concerned with the editor performance and mutation event listeners hurt performance. Additionally we now have a warning that shows every time Orion adds this event listener - we always advise developers to use the Mutation Observer API.

Please see:

https://developer.mozilla.org/en/DOM/DOM_Mutation_Observers
http://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/

Thank you!
Comment 1 Silenio Quarti CLA 2012-06-11 14:21:11 EDT
Created attachment 217176 [details]
fix
Comment 2 Silenio Quarti CLA 2012-06-11 14:27:17 EDT
MutationObserver is only available on Firefox 14. In this patch, the old listener is still used when the observer is not used.
Comment 3 Silenio Quarti CLA 2012-06-11 14:30:37 EDT
Mihai, please review this patch for 0.5 RC2.
Comment 4 Mihai Sucan CLA 2012-06-11 14:38:14 EDT
Comment on attachment 217176 [details]
fix

Thanks for your fix Silenio! Much appreciated.

Patch looks good to me, r+ if this patch has been tested and confirmed to work as intended.

(what is $NON-NLS-$?)
Comment 5 Silenio Quarti CLA 2012-06-11 15:23:09 EDT
The patch has been tested on Mac and it works as expected.

$NON-NLS-$ is a marked indicating the literal string is not supposed to be externalized. It is used by a Orion plugin that externalizes user facing strings.