We do intentionally rail more aggressively depending on the page topology. The code that makes hard diagonal scrolling "jumpy" across bubbled layers is there (https://code.google.com/p/chromium/codesearch#chromium/src/cc/trees/layer_tree_host_impl.cc&q=layer_tree_Host_impl&sq=package:chromium&l=2704 ) because when scrolling a sublayer vertically while zoomed in, we found it's really annoying when the parent moves slightly horizontally. I don't think we can change this, but when we do the big scroll refactoring I proposed, that should solve the problem of the inconsistent behavior on main and impl thread for the bubbling-related logic.
On Android I believe the non-topology-related railing is performed somewhere in the java code in the browser process. I'm not sure right now whether it's in the system library code or not, if it is we'll need to have a separate implementation for other platforms, otherwise we could remove it from there and have a unified implementation in C++.
Alex: do we need to rail more aggressively depending on page topology, or can we just always rail that aggressively?"when scrolling a sublayer vertically while zoomed in, we found it's really annoying when the parent moves slightly horizontally."Is it any less annoying when you're scrolling a single layer vertically and you accidentally scroll horizontally slightly? It seems to me that we should rail aggressively enough that we prevent accidental scrolling, regardless of page topology.
For touch, we do non-topology related railing during gesture recognition, which is shared across all platforms.
Chris: I'm still hopeful that we can get rid of the topology dependent railing logic, which would likely change which variety of topology independent railing logic feels best. We may want to hold off until we've definitively established whether or not the topology dependent railing logic is necessary.
Trackpad railing logic should be cross platform, shouldn't it? Is there any reason that trackpad rails on mac should feel different than they do on ChromeOS or Windows?
Alex: do we need to rail more aggressively depending on page topology, or can we just always rail that aggressively?"when scrolling a sublayer vertically while zoomed in, we found it's really annoying when the parent moves slightly horizontally."Is it any less annoying when you're scrolling a single layer vertically and you accidentally scroll horizontally slightly? It seems to me that we should rail aggressively enough that we prevent accidental scrolling, regardless of page topology.
I hadn't considered that in order to implement something like -ms-scroll-rails, we can't apply rails without paying attention to page topology.Perhaps the most flexible approach would be if when input comes, we don't apply rails to the delta at all, but we annotate the event with a "rail state", which is one of VERTICAL, HORIZONTAL, or NONE.Then when we're actually applying a scroll delta to a scroller, we can choose whether to respect or disregard the event's rail state, and apply more strict railing due to page topology if necessary.To fully make this change, we'd want to receive unrailed deltas from touchpad/touchscreen drivers as much as possible.Does this approach sound reasonable? It doesn't completely centralize the railing logic (as some of that logic is device dependent), but it would move the actual application of the rails to a single place in the pipeline.