mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Fix division by zero in gradient stop calculation
Check if total_length is zero and return 0.0 instead of NaN in this case. Closes #18435 Regression test for crash.
This commit is contained in:
parent
d96fb89c31
commit
94f3e3353d
4 changed files with 42 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>Does this gradient crash the browser?</title>
|
||||
<link rel="match" href="gradient-crash-ref.html">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-images-3/#color-stop-syntax">
|
||||
<meta name="assert" content="Gradients with total length zero and absolute positioned stops do not crash.">
|
||||
<style>
|
||||
div {
|
||||
background: linear-gradient(black 0,white);
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
Loading…
Add table
Add a link
Reference in a new issue