Skip to content

Commit

Permalink
Call RestartAnimationOnCompositor() whether or not performing_reattac…
Browse files Browse the repository at this point in the history
…h is true.

Even when performing_reattach is false, it's important to call
RestartAnimationOnCompositor so that effect_changed will be true, so
that if we restart the animation, the compositor gets the new element
ID.

Without this change, and with https://crrev.com/c/3498292, the added
test fails when run in virtual/threaded/.

Fixed: 1305487
Bug: 900241
Change-Id: I2fe8c92cd3b395ce8bf0e1b34f274ef56e553b82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522511
Reviewed-by: Robert Flack <[email protected]>
Commit-Queue: David Baron <[email protected]>
Cr-Commit-Position: refs/heads/main@{#981818}
  • Loading branch information
dbaron authored and pull[bot] committed Sep 1, 2023
1 parent 9b4c3b7 commit 1420979
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions lint.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ SET TIMEOUT: shadow-dom/slotchange-event.html
SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: user-timing/*
SET TIMEOUT: web-animations/crashtests/reparent-animating-element-002.html
SET TIMEOUT: web-animations/timing-model/animations/*
SET TIMEOUT: web-locks/crashtests/after-worker-termination.https.html
SET TIMEOUT: webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
Expand Down
44 changes: 44 additions & 0 deletions web-animations/crashtests/reparent-animating-element-002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html class="test-wait">
<title>CSS Test (Animations): Reparenting an element with a web animation on the compositor</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
<link rel="author" title="Google" href="http://www.google.com/">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1305487">
<meta name="assert" content="This should not crash.">
<!--
The Chromium implementation of <marquee> essentially uses web animations
underneath. However, I was unable to make a testcase for this crash
that uses web animations directly. Despite that, it still seems worth
adding this testcase here in WPT.
-->

<style>
#animate {
width: 100px;
height: 100px;
}
#newparent {
display: none;
}
</style>
<marquee id="animate">X</marquee>
<div id="newparent"></div>
<script>

let a = document.getElementById("animate");

requestAnimationFrame(function() {
// use setTimeout because the crash doesn't happen if we do this inside
// a requestAnimationFrame callback
setTimeout(function() {
a.remove();
document.getElementById("newparent").appendChild(a);
requestAnimationFrame(function() {
document.documentElement.classList.remove("test-wait");
});
}, 0);
});

</script>

0 comments on commit 1420979

Please sign in to comment.