Now that CheckNeedsRefresh is a member of the base class,
CommonAnimationManager, we no longer need to rely on callers of
AnimationPlayerCollection::EnsureStyleRuleFor to remember to call this method
but can do it automatically.
In order to add AnimationPlayerCollection::NotifyPlayerUpdated, collections
need a way of updating their managers to inform them that their mNeedsRefreshes
flag has changed and hence the manager may need to resume observing the refresh
driver.
Currently, only nsAnimationManager makes use of mNeedsRefreshes and provides
a CheckNeedsRefresh method. In order to allow AnimationPlayerCollection to
operate independently of the type of manager it is attached to (and because
there's a lot of similar code here that we eventually want to move to a common
manager anyway), this patch moves CheckNeedsRefreshes and associated
machinery to CommonAnimationManager.
I originally wrote this to see if it would fix bug 1086937, but it
didn't.
Note that this conflicts a bit with the patch in bug 1085769; whoever
lands second will have some merging (though it shouldn't be difficult).
The updating of the style rule is needed as part of the animation-only
style update, but it shouldn't be in the general restyling code, so it
has moved there.
I originally wrote this to see if it would fix bug 1086937, but it
didn't.
Note that this conflicts a bit with the patch in bug 1085769; whoever
lands second will have some merging (though it shouldn't be difficult).
- When the scroll-behavior CSS value changed, the nsChangeHint_NeutralChange
hint was returned by nsStyleDisplay::CalcDifference. It now returns
nsChangeHint_ReconstructFrame to ensure that the change takes effect.
- When scroll-behavior is changed, the nsChangeHint_NeutralChange was not
sufficient to enter nsCSSFrameConstructor::PropagateScrollToViewport. By
using the same hint as used when the overflow css property changes,
nsChangeHint_ReconstructFrame, PropagateScrollToViewport will be called.
- The scroll-behavior css property is not expected to change often (the
CSSOM-View DOM methods are likely to be used in those cases); however, if
this does become common perhaps a faster-path might be worth while.
- When the scroll-behavior CSS value changed, the nsChangeHint_NeutralChange
hint was returned by nsStyleDisplay::CalcDifference. It now returns
nsChangeHint_ReconstructFrame to ensure that the change takes effect.
- When scroll-behavior is changed, the nsChangeHint_NeutralChange was not
sufficient to enter nsCSSFrameConstructor::PropagateScrollToViewport. By
using the same hint as used when the overflow css property changes,
nsChangeHint_ReconstructFrame, PropagateScrollToViewport will be called.
- The scroll-behavior css property is not expected to change often (the
CSSOM-View DOM methods are likely to be used in those cases); however, if
this does become common perhaps a faster-path might be worth while.