I only use custom controls in my web app. These controls have a single event (click). I just checked my page and all my controls: there are no other reported events.
Yet, if I run my web app on a mobile Android a little slow, I have warnings of this type that appear in my console:
Actually, in the Chrome developer tools, I see that framework.js has added many events: mousewheel, mousedown, etc. Why the framework add the “mousewheel” event listener (on Window/document with the trackMouseWheel method) while I don’t need?
Would it be possible to add the new “passive” property to mousewhell, touchstart, touchmove (…) events?
Create a feedback case, it’s the only way for that to happen.
Of course, the js framework contains methods managing events. This not means that it will add all the event listeners on all controls on the page. Besides, it does not. For controls, the framework adds the event listener only if you open the corresponding handler event in Xojo.
But the framework adds many event listeners on the page itself, this time without adding the corresponding event handler to the page in our Xojo code. I guess some are necessary (“resize” for example). But keydown, keypress, keyup, focus, blur, mousedown, mouseup, mousemove, mousewheel…?
If these event listeners are needed, ok. But I wonder if it can be improved. MouseWheel (and probably mousemove) seems expensive according to Chrome. Xojo could ask the framework to add these events listeners only if it has detected that it needs?
[quote=315027:@Michel Bujardet]I wonder about the complexity of adding only events that have a handler. It may not be trivial.
Why not file a feature request ?[/quote]
We already do this for Controls. WebPages are a little more complicated as we use those in the framework for maintaining properties that users expect to have all the time.