the Chromium logo

The Chromium Projects

January 2021 - Code Health, New Features, Testing and Stability Fixes

January 2020 Chrome Interactions Highlights Archives: go/interactions-team-highlights
Chapter I: New Features
<td><td>Over 93% pass rate on the scroll timeline tests.</td></td>

<td><td>Over 350 passing tests.</td></td>

<td><td>Recent areas of development:</td></td>

    <td><td>Extended the scope of the polyfill:</td></td>

        <td><td>EventTarget</td></td>

        <td><td>Promises</td></td>

        <td><td>Tasks</td></td>

    <td><td>Support writing modes</td></td>
<td><td>The challenge is that size dependency could change while the
animation is running. And we need to catch the change and restart the
composited animation.</td></td>

<td><td>The feature is in common use. One can write CSS only animations
without the need to resort to JS for size calculation, such as the above
demo.</td></td>
<td><td>Recent spec <a
href="https://github.com/w3c/csswg-drafts/issues/4953">discussion</a>
decided that aspect ratios should be interpolated by the log of their value,
to preserve the same visual speed whether they are wide or narrow.</td></td>
<td><td>Setup infra for animating on the compositor thread.</td></td>

<td><td>Implement the interpolation logic.</td></td>

<td><td>Handle transition keyframes.</td></td>

<td><td>Handle multiple offsets in keyframes.</td></td>

<td><td>Implement main-thread fallback logic.</td></td>
<td><td>Finch experiment: 50% on canary + dev + beta.</td></td>

<td><td><a
href="https://groups.google.com/u/1/a/chromium.org/g/blink-dev/c/bta50W_Hg24">Intent
to ship</a> has been approved with 3 LGTMs.</td></td>

<td><td>Enabled for stable at 1% starting with M88.</td></td>

<td><td>Improvement of the feature is still on-going, such as the <a
href="https://bugs.chromium.org/p/chromium/issues/detail?id=1150979">simulated
clicks</a>.</td></td>
<td><td>Landed <a
href="https://bugs.chromium.org/p/chromium/issues/detail?id=1113863">scrolling
the &lt;select&gt; popup</a>.</td></td>

<td><td>Designed <a
href="https://docs.google.com/document/d/1w_Pr4sKPXfHz03ZUxVSZL23xjQy-TiKAKf8rmbcW1Fc/edit#">metrics</a>
for scroll unification and LGTMed by the metrics team.</td></td>

<td><td>Landed scroll bubbling from OOPIFs to ancestor frame</td></td>

<td><td>Schedule frames for popup widgets in tests using compositor
thread.</td></td>
Scroll timeline polyfill image Both kevers@ and flackr@ have been working extensively on this feature. Compositing percentage based transforms image menu.hidden { transform: translateX(-100%) } kevers@ re-enabled this feature in M89:
Aspect ratio interpolation image image Demo Before Demo After flackr@ implemented aspect ratio interpolation, and enabled it by default in M90. Composite background-color animation image The above background-color animation demo runs on the compositor thread with the experimental flag. xidachen@ has made great progress on this feature, including:
Click/Auxclick as pointer event liviutinta@ and mustaq@ co-worked on this feature and shipped it to stable. Here is the major work: Capability delegation with payment request image mustaq@ built an initial prototype that allows PaymentRequest in subframe provided a token is passed into it. The PaymentRequest now consumes user activation.
Scroll unification liviutinta@ kept working on this feature, and has made progress. Scroll to images (and videos) flackr@ has created and uploaded the explainer for this feature.
Chapter II: Testing
Deflaking tests kevers@ addressed some test flakes in animations and scroll-snap. These flakes were largely triggered due to common gotchas like antialiasing, floating point precision, or test timing. Animation timing checks have been updated to accommodate 1 microsecond accuracy. This fix was not a pure test change as there was a lurking issue with numerical precision and setting the finished state of an animation. It is not just strict equality checks that are problematic when working with floating point numbers. Several layout tests in animations make use of an internal pause for testing API, which predates and is largely deprecated by the web animations API (WAAPI). One test flake was addressed simply by switching over to WAAPI. Several timing flakes were fixed in scroll-snap tests, by injecting a listener for scroll events. Unlike web animations, scroll animations do not fire an event to indicate completion of the scroll operation, and the end is inferred based on an absence of position updates over time. Unfortunately, this can lead to flakes when testing machines get bogged down and tests start running slower than expected. Simply waiting on an initial scroll event before starting the countdown, largely addresses this type of flake in scroll-snap tests. Once scrolling starts, the number of animation frames (rAFs) required to complete the scroll has a strict upper bound. xidachen@ also fixed quite a few paint worklet flaky tests by using the standard animation API. Before: we are taking a screenshot at rAF, which doesn’t guarantee the start of the animation. Now: with the animation ready API, we take a screenshot when the animation has started which prevents the flakiness. image Before image After WPT test coverage image kevers@ and girard@ measured test coverage in WPT for input/scroll/animation. The data can help us understand which category of tests needs more attention. TestDriver Action API image lanwei@ kept improving the TestDriver action API and made more WPT tests automatic. The following two pictures show the wpt dashboard for the TestDriver action API. image image
Chapter III: Stability Fixes
<td><td>Determine the root cause, landed the <a
href="https://chromium-review.googlesource.com/c/chromium/src/+/2488181">fix</a>
on ToT.</td></td>

<td><td>Merged the fix back to M88 and M89.</td></td>
Animation security fix: use after poison kevers@ fixed a crash in Animatable::Animation. The problem is that running user code (JS) can result in the destruction of an execution context. We cannot simply check and forget about the execution context. The solution is to double check if the context is used downstream of script execution. Float-cast-overflow in MouseEvent::PageX liviutinta@ fixes a float-cast-overflow bug that is caused by static_cast<int>(double value) when the value is out of range. The solution is to usd std::trunc and clampToInt instead. Paint worklet regression image image Stable Canary xidachen@ fixed a regression due to a misuse of hashmap. In the above demo, the same animation is applied to both elements. In other words, the animations of the two elements should be in sync. However, the stable version is wrong. The canary version has the fix in it, and it is correct.
Crash in PointerEventFactory mustaq@ untangled a mixed-up crash report that becomes release-blocker-stable at the last moment. The effort of fixing the crash includes: Paint worklet crash xidachen@ fixed a crash where the root cause is that our code path hits a DCHECK that is no longer applicable. The solution is to remove the outdated DCHECK.
<td><td>Specifically, we closed more bugs than opened in P1 and P2
categories.</td></td>
<td><td>Our P1 and P2 bugs are less than 40% of total bugs.</td></td>

<td><td>~40% bugs have owners assigned.</td></td>
Chapter IV: Code Health image Our team had a great start to the year by closing over 70 bugs in this sprint: image image girard@ collected our team bug data and generated graphs to visualize it. girard@ re-enabled “MissedTOUCHEVENTF_UP” which tracks a hack in windows touch. We would like to tear out the hack/workaround once usage drops. liviutinta@ removed the AzimuthAltitude flag since it has been turned on by default since M86. lanwei@ and liviutinta@ fixed input failing tests on the new WPT bots. mustaq@ landed Mouse/PointerEvent related code cleanup.
Chrome Interactions Highlights | January 2020 go/interactions-team