Commit aca616ca authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Revert to waiting for first interval when pruning first interval

When 'end' changes so that we need to discard/prune our current
interval, and said interval is the first interval, revert back to
waiting for a first interval again.

Bug: 1020163
Change-Id: I7185253474e23a3a58294043102c91e1a59fe10c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895335Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#711709}
parent 3d5d7116
...@@ -862,6 +862,10 @@ void SVGSMILElement::DiscardOrRevalidateCurrentInterval( ...@@ -862,6 +862,10 @@ void SVGSMILElement::DiscardOrRevalidateCurrentInterval(
if (new_end.IsUnresolved()) { if (new_end.IsUnresolved()) {
// No active duration, discard the current interval. // No active duration, discard the current interval.
interval_ = SMILInterval::Unresolved(); interval_ = SMILInterval::Unresolved();
// If we discarded the first interval, revert to waiting for the first
// interval.
if (!previous_interval_.IsResolved())
is_waiting_for_first_interval_ = true;
return; return;
} }
if (new_end != interval_.end) if (new_end != interval_.end)
......
<!DOCTYPE html>
<title>Timed element not active after first interval active duration changes to unresolved</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg>
<rect width="100" height="100" fill="green">
<set attributeName="fill" to="red" fill="freeze"
begin="click" end="click" dur="100ms" repeatCount="indefinite"/>
</rect>
</svg>
<script>
async_test(function(t) {
let set = document.querySelector('set');
window.onload = t.step_func(function() {
t.step_timeout(function() {
set.setAttribute('begin', '-100ms');
set.setAttribute('begin', 'click');
set.parentNode.appendChild(set);
set.setAttribute('end', '-100ms');
set.setAttribute('end', 'click');
window.requestAnimationFrame(t.step_func_done(function() {
let target = set.targetElement;
assert_equals(getComputedStyle(target).fill, 'rgb(0, 128, 0)');
}));
}, 0);
});
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment