calc-background-linear-gradient-1

Support calc() on gradient stop positions

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3   <title>CSS Test: Support calc() on gradient stop positions</title>
 4   <link href="https://bugzilla.mozilla.org/show_bug.cgi?id=594935" rel="author" title="Yu-Sian (Thomasy) Liu">
 5   <link href="http://www.w3.org/TR/css3-values/#calc-notation" rel="help">
 6   <link href="reference/calc-background-linear-gradient-1-ref.htm" rel="match">
 7   <meta content="" name="flags">
 8 <style type="text/css">
 9 div {
10  width:100px;
11  height:100px;
12  background:red;
13  margin:5px 0 0 5px;
14  float:left;
15 }
16 div#one {
17  background: linear-gradient(lime 0px, lime calc(100% - 10px), blue calc(100% - 10px), blue 100%);
18 }
19 div#two {
20  background: linear-gradient(blue calc(100% - 100px) ,green calc(10% + 20px) ,red 40px ,white calc(100% - 40px) , lime  80px);
21 }
22 div#three {
23  background: linear-gradient(blue calc(0px) ,purple calc(20%) ,red calc(10px + 10px + 20px) ,blue calc(30% + 30px) , lime  calc(180% - 100px));
24 }
25 div#four {
26  background: linear-gradient(blue calc(0% + 0px) ,green calc(10% + 20px) ,red 40px ,blue calc(200% / 2 - 40px) , yellow  80px);
27 }
28 div#five {
29  background: linear-gradient(red calc(100% - 100px) ,green calc(10% + 20px));
30 }
31 
32 </style>
33 </head>
34 <body>
35 <div id="one">1</div>
36 <div id="two">2</div>
37 <div id="three">3</div>
38 <div id="four">4</div>
39 <div id="five">5</div>
40 
41 
42 </body></html>