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:
https://bugzilla.mozilla.org/show_bug.cgi?id=1429676

And currently, I'm working on making HTMLEditRules not derived from 
nsIEditActionListener:
https://bugzilla.mozilla.org/show_bug.cgi?id=1430021

And nsIEditActionListener::Will*() will be removed because of no users:
https://bugzilla.mozilla.org/show_bug.cgi?id=1430319

-- 
Masayuki Nakano <masayuki@d-toybox.com>
Software Engineer, Mozilla
0
Masayuki
1/13/2018 12:19:32 AM
mozilla.dev.platform 6145 articles. 0 followers. Post Follow

0 Replies
3 Views

Similar Articles

[PageSpeed] 9

Reply: