Closed Bug 1847689 Opened 2 years ago Closed 2 years ago

Minor cleanup to GenericScrollAnimation constructor

Categories

(Core :: Panning and Zooming, task, P3)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(4 files)

No description provided.

This allows only computing the Bezier physics in the branch where we
actually use it.

Depends on D185634

Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e9cff07d365 Reuse ComputeBezierAnimationSettingsForOrigin() in implementation of SettingsForDeltaType(). r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/9fe21761f365 Have GenericScrollAnimation constructor take a ScrollOrigin parameter instead of ScrollAnimationBezierPhysics. r=dlrobertson
Flags: needinfo?(botond)

The reason for the failures is that the first patch introduces a subtle behaviour change: ComputeBezierAnimationSettingsForOrigin() has a check such that it only sets the min/max duration settings to a nonzero value if smooth scrolling is enabled. If smooth scrolling is disabled, we get an animation with a zero duration, which is technically supported but somewhat fragile (e.g. we can get a division by zero if the animation is sampled with a timestamp "in the past").

Production scenarios shouldn't be affected because we don't get into this code if smooth scrolling is disabled in the first place (due to checks like this one). However, some gtests use a helper called SmoothWheel which bypasses those checks. If general.smoothScroll is in fact false (as it seem to be in Windows gtest runs for some reason, maybe prefers-reduced-motion related), we get those zero-duration animations. This then results in two failures:

  1. APZCSnappingTesterMock.Bug1265510 is not careful with timestamps and tries sampling an animation with a past timestamp
  2. APZCTransformNotificationTester.PanFollowedByWheelTransformNotifications just doesn't expect a zero-duration animation (it expects to receive a TransformEnd only after spinning the event loop)

I plan to do some further cleanup here (e.g. assert that the branch where we get the zero-duration animation doesn't happen in production, and eventually remove it), but for now a fix is to explicitly pref on smooth scrolling for gtests that use SmoothWheel().

Flags: needinfo?(botond)
Attachment #9348334 - Attachment description: Bug 1847689 - Fix some timestamp hygiene issues in APZCSnappingTesterMock.Bug1265510. r=dlrobertson → Bug 1847689 - Fix some timestamp hygiene issues in APZCSnappingTesterMock. r=dlrobertson
Attachment #9348334 - Attachment description: Bug 1847689 - Fix some timestamp hygiene issues in APZCSnappingTesterMock. r=dlrobertson → Bug 1847689 - Fix some timestamp hygiene issues in APZCSnappingTesterMock.Bug1265510. r=dlrobertson
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/43273ef51cbb Reuse ComputeBezierAnimationSettingsForOrigin() in implementation of SettingsForDeltaType(). r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/f252c38d6ed2 Have GenericScrollAnimation constructor take a ScrollOrigin parameter instead of ScrollAnimationBezierPhysics. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/84a1eb3a6f16 Fix some timestamp hygiene issues in APZCSnappingTesterMock.Bug1265510. r=dlrobertson https://hg.mozilla.org/integration/autoland/rev/b94b68f70671 Explicitly enable general.smoothScroll in gtests that use SmoothWheel(). r=dlrobertson
Blocks: 1848528
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: