Skip to content

Commit

Permalink
Clamp the presentation time to a usable range
Browse files Browse the repository at this point in the history
If the time container is seeked to a large enough value, we will end up
truncating it to SMILTime::Latest(), which is the largest value that
isn't one of the two special values ("indefinite" and "unresolved").
When trying to derive other values from this value - like if we have an
interval begin at it - we can end up in a loop since any the result of
any additions will yield the same value, leading to the element being
rescheduled at the same point in time, hanging UpdateIntervals().
This mechanism can also be used to implement the "once" animation-policy
in a slightly nicer way. This will be done as a follow-up.

Bug: 1039886
Change-Id: If13d7d7d3c44c4f586d15852eb05105879f44918
  • Loading branch information
Fredrik Söderquist authored and chromium-wpt-export-bot committed Jan 30, 2020
1 parent 122146a commit 3846e20
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions svg/animations/end-of-time-crash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html class="reftest-wait">
<title>Seeking the time container to a large value does not cause a crash (or hang)</title>
<svg>
<rect height="100" width="100" fill="blue">
<animateTransform begin="18446744073709551557" dur="2" repeatCount="indefinite"
attributeName="transform" type="rotate" from="0,15,15" to="360,15,15"/>
</rect>
</svg>
<script>
let svg = document.querySelector("svg");
svg.setCurrentTime(18446744073709551557);
let html = document.documentElement;
html.addEventListener("TestRendered", () => html.classList.remove("reftest-wait"));
</script>

0 comments on commit 3846e20

Please sign in to comment.