Intent to remove: some methods of nsIEditActionListener or the interface itself

I'd like to remove unnecessary methods of nsIEditActionListener or 
nsIEditActionListener itself completely.

This is not buildinclass.  So, this can be implemented by XUL addons. 
Currently, this is used only by ThunderHTMLedit (only Did*()). 
Additionally, 3 internal classes of Gecko implements this interface.

Supporting this interface is expensive from a point of view of Quantum 
Flow.  When editor changes DOM tree, a set of methods of this interface 
is always called every time.  When running for loop to call a method of 
the interface, we need to copy edit action listeners array with array of 
strong pointer. Then, we need to call them with nsIDOM* interfaces. 
I.e., a lot of unnecessary QIs are required.  Additionally, each 
implementation will QI back to nsINode or something. Finally, all of 
them are virtual call but our internal classes implements less than half 
of the methods.

So, my current idea is, keep supporting ThunderHTMLedit as far as 
possible.  Even with that, we can make all our internal classes are 
notified directly instead of via the interface.  This is not so 
beautiful but we can get rid of virtual call cost, unnecessary method 
calls and unnecessary QIs.  Then, only XUL addon for Thunderbird may use 
the interface. However, in most environment, that's not used. So, our 
editor can check before doing for loop if there is edit action listeners.

Feel free to suggest something in this bug:

And currently, I'm working on making HTMLEditRules not derived from 

And nsIEditActionListener::Will*() will be removed because of no users:

Masayuki Nakano <>
Software Engineer, Mozilla
1/13/2018 12:19:32 AM 6467 articles. 0 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 3