Closed Bug 303947 Opened 19 years ago Closed 1 year ago

get rid of _animateRemainder

Categories

(Toolkit :: Preferences, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: asqueella, Unassigned)

Details

Current code for preferences animation uses a field, called _animateRemainder,
which serves no useful purpose and causes a bug under certain conditions. This
bug is asking for the field to be removed.

_animateRemainder is initialized in this way:
  this._animateRemainder = sizeDelta % this._animateIncrement;
where sizeDelta is the difference between panes' height, and animateIncrement is
the animation step (also in pixels).
It is used in the animation step calculation (_sizeIncrement getter), which
first tries to add the full step (animateIncrement) to current height, and if
the resulting delta between current and wanted height changes sign, it returns
animateRemainder as an increment value, instead of just returning the difference
between the current height and the wanted height.

The problem with this approach is that if the contentHeight of the target pane
changes during the animation, it gets messed up, taking three seconds to complete.

The bug is not major by itself, but there's no reason to use animateRemainder,
so it should be removed. The _sizeIncrement getter should just return
(lastSelectedPane.contentHeight - this._currentHeight) where it currently
returns animateRemainder. This is both simpler and more robust.
QA Contact: nobody → preferences
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.