Commit f22de573 authored by Stephen McGruer's avatar Stephen McGruer Committed by Commit Bot

Marquee: Early-exit on negative duration as well as zero duration

It is possible for HTMLMarqueeElement::GetAnimationParameters to return
a negative duration - this occurs when the <marquee> has no size but its
'mover' does. In this case we should not attempt to animate as this will
just throw in TimingInput::Update (as a negative duration is invalid).

Bug: 866289
Change-Id: Ifa0c2d2e8c717284670f7bddf8d350c174094f57
Reviewed-on: https://chromium-review.googlesource.com/1148887Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577894}
parent f9cabcfe
<!DOCTYPE html>
<title>Test: Positive content-width, zero marquee-width should not crash</title>
<style>
/* Style taken from clusterfuzz reproduction in http://crbug.com/866289 */
marquee {
display: table-row-group;
padding-left: 100px;
}
</style>
<marquee></marquee>
<div>This test passes if it does not crash.</div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
...@@ -291,7 +291,7 @@ void HTMLMarqueeElement::ContinueAnimation() { ...@@ -291,7 +291,7 @@ void HTMLMarqueeElement::ContinueAnimation() {
double duration = 0; double duration = 0;
if (scroll_amount) if (scroll_amount)
duration = parameters.distance * scroll_delay / scroll_amount; duration = parameters.distance * scroll_delay / scroll_amount;
if (!duration) if (duration <= 0)
return; return;
StringKeyframeEffectModel* effect_model = CreateEffectModel(parameters); StringKeyframeEffectModel* effect_model = CreateEffectModel(parameters);
......
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