Commit a73d100b authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Clamp infinite values for radial gradients.

Missing clampTo<float> in ComputeEndPoint() caused DCHECK failures.

Bug: 1009307
Change-Id: Ic524e358b7ba94e5b77ffca94128762a08395172
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879454Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710722}
parent 83f047c3
......@@ -1271,8 +1271,10 @@ FloatSize RadiusToCorner(const FloatPoint& point,
}
}
if (shape == kCircleEndShape)
if (shape == kCircleEndShape) {
distance = clampTo<float>(distance);
return FloatSize(distance, distance);
}
DCHECK_EQ(shape, kEllipseEndShape);
// If the end shape is an ellipse, the gradient-shape has the same ratio of
......
<!doctype html>
<p>You should see a 300x300px green square below and no crash.</p>
<div style="width:300px;height:300px;background:green"></div>
<!doctype html>
<title>CSS Images Test: repeating-radial-gradient with huge size crashes Chrome</title>
<link rel="help" href="https://crbug.com/1009307">
<link rel="match" href="infinite-radial-gradient-crash-ref.html">
<style>
#crash {
background-image: repeating-radial-gradient(closest-corner circle at 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999%, green, green);
width: 300px;
height: 300px;
}
</style>
<p>You should see a 300x300px green square below and no crash.</p>
<div id="crash"></div>
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