box-shadow-blur-definition-001

blur computation for box-shadow

WeasyPrint

This browser

Assertion
the resulting shadow must approximate (with each pixel being within 5% of its expected value) the image that would be generated by applying to the shadow a Gaussian blur with a standard deviation equal to half the blur radius

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: blur computation for box-shadow</title>
 5   <link rel="author" title="L. David Baron" href="https://dbaron.org/">
 6   <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/">
 7   <link rel="help" href="http://www.w3.org/TR/css3-background/#the-box-shadow">
 8   <meta name="flags" content="">
 9   <meta name="assert" content="the resulting shadow must approximate (with each pixel being within 5% of its expected value) the image that would be generated by applying to the shadow a Gaussian blur with a standard deviation equal to half the blur radius">
10   <style type="text/css">
11     div.stripecontainer {
12       width: 600px;
13       height: 30px;
14       border: medium solid blue;
15     }
16     div.refimage, div.blurcontainer {
17       width: 600px;
18       height: 10px;
19     }
20     div.refimage img {
21       display: block;
22     }
23     div.blurcontainer { position: relative; overflow: hidden }
24     div.blur {
25       position: absolute;
26       width: 2000px;
27       height: 2010px;
28       top: -1000px; /* places 1000px both above and below container */
29       left: -2000px; /* places right edge at left of container */
30       box-shadow: 300px 0 100px black;
31     }
32   </style>
33  </head>
34  <body>
35   <p>The following test should contain three grayscale stripes, each 10
36   pixels tall, with no space between them, but all enclosed within a
37   blue border.  At all points, the middle stripe must be <strong>the
38   same color as or darker than</strong> the top stripe, and <strong>the
39   same color as or lighter than</strong> the bottom stripe.  (This tests
40   that the blurring algorithm produces results within 5% of a Gaussian
41   blur.)</p>
42   <div class="stripecontainer">
43    <div class="refimage"><img height="10" width="600" src="support/box-shadow-blur-definition-001-light-bound.png" alt="[reference stripe image]"></div>
44    <div class="blurcontainer"><div class="blur"></div></div>
45    <div class="refimage"><img height="10" width="600" src="support/box-shadow-blur-definition-001-dark-bound.png" alt="[reference stripe image]"></div>
46   </div>
47  </body>
48 </html>