[Bug 26909] Scrolling in one direction aborts smooth scroll in the other direction

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26909

--- Comment #1 from Kearwood "Kip" Gilbert <kgilbert@mozilla.com> ---
In our implementation, the second smooth scroll aborts the first.  The
animation of the scroll position incorporates the velocity of the first scroll,
resulting in a momentary overshooting on the y-axis while the x-axis animation
advances towards the new "left:" position begins.  The y-axis of the scroll at
the time of the abort is used as the new destination's y-position for the new
smooth scroll in the absence of a "top:" member in the ScrollToOptions
dictionary.

Effectively, we respect CSSOM View's 4.1.1 rule, "Abort any ongoing smooth
scroll for box.", while providing a smooth transition into the new animation.

Are there some use cases where other behavior would be more desirable?

If so, would it be reasonable to explicitly stop the first animation before
instantiating the second?  One method would be to allow the smooth scrolls to
be explicitly stopped instantly with a call such as:

scroll({behavior:"instant"});

(In our implementation, this would stop the scrolling motion immediately)

This would work inherently if we always use the scrollX and scrollY positions
at the time of the aborted smooth scroll as the default destination for
subsequent instant or smooth scrolls when they are not specified in the
ScrollToOptions dictionary.  This would also allow explicitly aborted smooth
scrolls to be stopped with a smooth transition:

scroll({behavior:"smooth"});

(In our implementation, this would result in a momentary overshoot in the
current direction of travel before returning to the position at the time of the
aborted smooth scroll.)

TL;DR, Yes.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 26 September 2014 14:59:07 UTC