Firefox/Projects/Multitouch Polish/Fixing tree

From MozillaWiki
Jump to: navigation, search

The panning feedback is part of the windows touch support in win7 API. It basically consists of providing a visual feedback when the user is panning that the area that he is trying to scroll has reached the end of the scroll. When this happens, the window where the scrollport is is pulled together with the finger and then bounces back to the original position when the finger is released.

To use this functionality, we just need to pass to a new API a value named overflow, which represents how many pixels the user tried to scroll past the scroll limit.

To implement this, a new property was added to nsMouseScrollEvent, |scrollOverflow|, and then a corresponding implementation to calculate it was added to the ScrollPortView, which calculates it inside the ScrollByPixels function and then sets the value in the event object, which then can be acessed all the way back after the DispatchEvent call from nsWindow, where the gesture is being processed.

The <tree> element however is not a scrollport, it has its own scrolling code, so the same must be implemented in the tree scrolling code. The problem is that, from what I've seen debugging, the call stack from DispatchEvent until ScrollByXXX on a tree is much more complex, passing through the JS code, among other things. So when it reaches the ScrollByXXX I don't know how the original event object can be acessed (and also must be casted to an nsMouseScrollEvent).