Skip to content

Commit

Permalink
Fix crash getting keyframes of root font-size transition
Browse files Browse the repository at this point in the history
This change fixes a bug where a transition on a root element would
cause a crash if GetKeyframes() was called via javascript. The crash
was caused by the parent style not being available in the style
resolver state. This change adds a new function that initializes the
parent style as the initial style, as was done to fix
crbug.com/40703845

Bug: 387447929
Change-Id: Iaaef09b4cf003751082d1c818e55f4b9f792ab5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6142431
Reviewed-by: Kevin Ellis <[email protected]>
Commit-Queue: Claire Chambers <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1411049}
  • Loading branch information
Claire Chambers authored and chromium-wpt-export-bot committed Jan 24, 2025
1 parent 709dc0c commit aa999d8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions web-animations/crashtests/get-keyframe-fontsize-crash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="help" href="https://crbug.com/387447929">
<html id="root">
<style>
#root {
transition: all 5s ease;
}

#root.override {
font-size: 5rem;
}
</style>
<p>This test succeeds if the transition keyframes can be retrieved without a crash</p>
<script>
// Transition will not run if document is not loaded
window.onload = () => {
document.getElementById("root").className = "override";
document.getAnimations()[0].effect.getKeyframes();
};
</script>
</html>

0 comments on commit aa999d8

Please sign in to comment.