Teams‎ > ‎Animations Team‎ > ‎Highlights Archive‎ > ‎

August 2021 - New features, Fixit, Testing, Code health and more!


August  2021


Chrome Interactions Highlights

Archives: go/interactions-team-highlights






Chapter I: New features


Scroll timeline spec

kevers@ changed the spec for the “setting the timeline of an animation” part.

Problem

  • Scroll-timelines are now progress based and not time based. Two cases where we need to preserve the “progress”:

    • Switching to a scroll timeline while paused

    • Switching from a scroll timeline.

Solution

  • Augment procedure to include calculation of previous progress

  • Preserve position.

kevers@ is also changing the CSSNumberish current and start times. CSSNumberish is a double or CSSNumericValue, where CSSNumericValue has a value and a unit.

  • The problem with current & start times remaining as doubles is that it requires inferring a different unit depending on the timeline. Animations associated with a scroll timeline are progress based and not time based.

  • This would allow:

    • scrollAnimation.currentTime = CSS.percent(30);

    • timeAnimation.startTime = CSSNumericValue.parse(‘-30ms’)

Composite BG-color animation

 


xidachen@ launched the finch study for composite bgcolor animation. The preliminary result looks very positive.

  • The above table shows the summary of the result with all platforms combined, canary + dev channels.

  • Note that the blue ones show significant difference, the black ones are “not significant”.


Given the positive finch result, we will ship this in M94.



Chapter II: Fixit



Chapter III: Testing


Deflake scrolling tests


kevers@ fixed quite a few flaky scrolling tests.

mouse-autoscrolling-on-deleted-scrollbar:

  • Timeout: fixed by deferring start until ready

  • Position mismatch: fixed by waiting for scroll event before checking position

wheel-scroll-latching-on-scrollbar

  • Timeout: fixed by deferring start until after onload

  • Position mismatch: fixed by allowing for fractional offset.

  • Note this was the top Blink>Scroll flake!

mouse-scrolling-over-standard-scrollbar

  • Position mismatch: fixed by using established way of determining scroll thumb position and waiting on scroll event.

Deflake an animation layout test

xidachen@ fixed a top Blink>Animation flake. The root cause is that we do “A==B” when we compare two AnimationTimeDelta, and that the precision issue caused flakiness.


The fix is shown above, which is by introducing an epsilon when comparing two AnimationTimeDelta.


Chapter IV: Code Health


Remove use of DeprecatedAtOrEmptyValue in animations

kevers@ removed the usage of DeprecatedAtOrEmptyValue in the animations code base.

  • Here is the design doc for WTF::HashMap<>::at() refactor.


Cleanup of CompositorKeyframeModel constructors


kevers@ cleaned up the CompositorKeyframeModel constructors.

The issues are:

  • 3 public and 1 private constructor. All public versions end up calling the private constructor

  • Unnecessary if-else construct

  • Opportunity to improve efficiency with move-value semantics

Resolution:

  • Single constructor that takes a KeyframeModel::PropertyId argument

  • Add move constructor and move assignment operator to TargetPropertyId

  • Negative line count CL.

Refactor Native PaintWorklet


xidachen@ refactor the native paintworklet code.

  • Detailed design doc here.

  • The refactor reduced a middle layer, and made the entire workflow simpler.

  • Landed 3 CLs. (Part1, Part2, Part3)


Magic behind move-value


kevers@ learned something about std::move.

Move constructor

  • Foo::Foo(Foo&& other): other is a temporary object that may have its contents reset as a result of the move. Note the r-value ref cannot be const.

Move assignment:

  • Foo::operator=(Foo&& other): same thing. Other is temporary and may be reset.


Foo foo = CreateExpensiveObject(...)

In this case, no std::move is required since RHS is already an r-value.


Foo expensive_foo_instance = TakeOwnership(std::move(expensive_foo_instance));

std::move is required to take advantage of move-value semantics since expensive_foo_instance is an l-value. Adding std::move converts to an R-value reference.


Useful instead of const & when not able to share an instance but can pass ownership. Further reading. See also pkastings C++ 201 talks.



Chapter V: Stability/security fixes


Fake user activation from Extension Messaging


Interactions team and Extension team together made a concrete plan about an old P1 security issue with fake user activation (Issue 957553).


Here is a brief history to see why this is important:

  • The problem was known 3+ years ago, and we got the security bug 2+ years ago.

  • We posted solution ideas but compat risks held us back. Our design doc in early 2020 didn’t get enough traction for the same reason.

  • We added UMA in late 2020 to slice the problem but got confusing results.

  • We committed to look again in Q3 this year, and coincidentally got an escalation from fbeaufort@ and the Media team just in time!

  • Brainstorming in early Q3 by mustaq@, flackr@ and rdcronin@ led us to a solid plan, finally!


Chapter VI: à la carte


[Scroll Unification] Scheduling investigation


skobes@ investigated on the scheduling improvements for scroll unification.


Less motion, plz!


Remove animations option in settings disables a lot of system animations including stretch overscroll.


In Chrome, remove animations sets prefers-reduce-motion:

  • This CL plumbed prefers-reduced-motion from blink to compositor and wired it up to input_proxy_client.cc to disable elastic overscroll (on Android only)


Chapter VII: Bug Updates

Our team lost a bit of ground in P2s && P3s, but kept the P1s in check.







Chrome Interactions Highlights | August 2021


go/interactions-team



Comments