enyojs/enyo — pull request #915 by graynorton (2014-11-04 17:20:26+00:00)
Title: BHV-11799: Fix list scrolling issues

Under certain circumstances, enyo.DataList and enyo.DataGridList
have not been regenerating properly after scrolling. This can
cause list items to disappear.

This pull request addresses the most critical problem cases by
making a number of changes:

* In VerticalDelegate, fixed an off-by-one error in
resetToPosition() when determining which pages to generate

* In VerticalDelegate, enhanced didScroll() logic to account for
the case where the scroll event we're responding to indicates a
big jump (as opposed to continuous scrolling from the previous
position)

* In ScrollMath and TouchScrollStrategy, audited and adjusted
the circumstances under which we emit the onScrollStop event when
calling ScrollMath's internal stop() method. TouchScrollStrategy
and especially TranslateScrollStrategy rely on onScrollStop to
manage internal state, and weren't getting a chance to do so in
some situations. It doesn't appear that these changes have caused
any significant changes to the circumstances under which Scroller
bubbles its own onScrollStop event.

* In Scroller, removed redundant (and harmful) direct assignments
of the scrollLeft and scrollTop properties in the setScrollLeft()
and setScrollTop() methods. These direct assignments were causing
comparisons of the current and next scroll positions to be invalid
in some cases, which prevented VerticalDelegate's paging logic
from working properly. Instead, we just call the scroll strategy's
setScrollLeft() and setScrollTop() methods and rely on existing
logic elsewhere to keep the scroller and the strategy in sync.

I've also added a new sample for testing the interaction of
DataList and DataGridList with Scroller, which should make it
easier for us to detect issues going forward. That will be
submitted in a separate pull request so that the new sample can
more easily be used by reviewers / integrators / QA to compare
the old and new behaviors.

The new sample exposes some remaining issues, primarily with
TransitionScrollStrategy (which is quite broken when used with
DataList) and with the logic for showing / hiding the scroll
thumb, but I'd like to integrate this fix for the critical cases
and then write up new issues to address remaining bugs.

Enyo-DCO-1.1-Signed-Off-By: Gray Norton (gray.norton@lge.com)