Hi Ziba,
I have a question about the benefits of the change from event based to polling based folder highlighting when dragging.
I am not developing RC, but your question interested me. I presume that event-based highlighting might suffer from the fact that 'mouseover' and 'mouseout' events are fired each time cursor moves above target element _and any of its descendants_. This means that when you freely move above the target rectangle, many and many highlights/unhighlights might happen in the background (as you hover mouse above rectangle's children).
On the other hand, the "polling-based" approach can be relatively highly optimized (using pre-calculation of target rectangles coordinates, because getting .offset* properties is a very slow operation), resulting only in numerical computation (basicly no DOM interaction required).
Sincerely, Ondrej Zara, happy RC user :)
Revision 1763 changed the manner in which target folders are highlighted when dragging a message. Before 1763, each folder had an onmouseover which would trigger focus_folder.
1763 removed that onmouseover event and instead calls drag_move every time the mouse moves. drag_move essentially polls the position of the mouse and loops over every folder on screen to see if the mouse is above that folder folder. This polling is costly and has mixed effects across browsers, operating systems and pcs with different specs.
On all systems tested so far, even if the dragging appears smooth, at least one cpu is maxed at 100% by the polling. On some systems/browsers a cpu is pegged and the dragging is intolerably choppy and slow.
The commit comment for 1763 includes: "Don't rely on browser events anymore"
Is relying on browser events a bad thing? Worse than polling?
It seems that the previous highlighting detection method was more efficient and compatible across a wider range of systems.
If there are reasons that polling has to be the answer, then perhaps we can add some sort of rate limiting?
Thanks for your consideration, Ziba
List info: http://lists.roundcube.net/dev/