Bug 1679006 [wpt PR 26611] - Fix a crash by PaintWorklet + custom property animation...
commit32a1a023ea804f879ed3759539bdd53da3dd553f
authorXida Chen <xidachen@chromium.org>
Thu, 26 Nov 2020 21:32:27 +0000 (26 21:32 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Mon, 30 Nov 2020 20:06:00 +0000 (30 20:06 +0000)
tree1a3b34f2e73fdf0084dd99229ec5307466c4178f
parentb39cce9319d591b429a64268f7957abc0b80dd32
Bug 1679006 [wpt PR 26611] - Fix a crash by PaintWorklet + custom property animation, a=testonly

Automatic update from web-platform-tests
Fix a crash by PaintWorklet + custom property animation

https://chromium-review.googlesource.com/c/chromium/src/+/2359370
The above CL made a custom property animation always composited if
it is used by paint worklet, even if the element does not have
"will-change: transform". The approach is that we give a special
ElementId which is uint64_t::max() to the paint worklet element,
and then on the CC side, once we see that element id, we know that
it is an animation associated with paint worklet and we will always
tick that animation.

The problem comes when there are two paint worklet elements.

The short version of the problem is:
CC's animation system doesn't allow two layers with the same
ElementId.

Longer version:
Then these two layers would have the same ElementId when
we try to attach a composited layer with that animation. As a
result, in the AnimationHost::RegisterAnimationForElement(), we
will have two Animation with the same ElementId. Then, the actual
crash happens at ElementAnimations::GetPropertyToElementIdMap(),
at the first DCHECK.

So the solution in this CL is to not DCHECK in certain cases.
The DCHECK actually doesn't make sense in this case where
there is no composited layer. In fact, the callers of the
ElementAnimations::GetPropertyToElementIdMap gives the result
to MutatorHostClient::ElementIsAnimatingChanged, and in there
it only cares about 4 properties. So for the other properties
that it doesn't care, we should not put it in the map.

Bug: 1151755
Change-Id: I5479ccae80f3c89db98d27518ef013dded527ece
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2553691
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831090}

--

wpt-commits: 8225f7456566a3e7c20135917113e1bde15c5d37
wpt-pr: 26611
testing/web-platform/tests/css/css-paint-api/two-element-custom-property-animation-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-paint-api/two-element-custom-property-animation.https.html [new file with mode: 0644]