Re-import the css/css-shapes WPT
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / css / css-shapes / spec-examples / shape-outside-012.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>CSS Test: Shape from image - shape-image-threshold - 0.9</title>
5     <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com"/>
6     <link rel="author" title="Bem Jones-Bey" href="mailto:bemjb@adobe.com"/>
7     <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shapes-from-image"/>
8     <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"/>
9     <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-image-threshold-property"/>
10     <meta name="flags" content="ahem dom"/>
11     <meta name="assert" content="This test verifies content flows around a shape that is
12                                  defined in the image's alpha channel and adjusted by the
13                                  image-threshold" />
14     <!-- This test is derived from Example 7 in this version of the spec:
15          http://www.w3.org/TR/2014/WD-css-shapes-1-20140211/ -->
16     <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
17     <style type="text/css">
18         .container {
19           width: 400px;
20           font-family: Ahem;
21           font-size: 20px;
22           line-height: 2em;
23         }
24         #test {
25             color: green;
26         }
27         #test-image {
28             float: left;
29             shape-outside: url("support/circle-shadow.png");
30             shape-image-threshold: 0.9;
31         }
32     </style>
33     <script src="/resources/testharness.js"></script>
34     <script src="/resources/testharnessreport.js"></script>
35     <script src="support/spec-example-utils.js"></script>
36     <script>
37     function checkFloats() {
38       approxShapeTest('test', 'line-', 2, [181, 199, 201, 199, 181, 0]);
39     }
40     </script>
41 </head>
42 <body onload="checkFloats();">
43     <p>
44         The test passes if the short green horizontal bars are the right of the circle, all
45         intersect the shadow, none intersect the circle and the long green bar is beneath the
46         circle. There should be no red.
47     </p>
48     <div id="test" class="container">
49         <img id="test-image" src="support/circle-shadow.png"/>
50         <span id="line-0">XXXXXX</span>
51         <span id="line-1">XXXXXX</span>
52         <span id="line-2">XXXXXX</span>
53         <span id="line-3">XXXXXX</span>
54         <span id="line-4">XXXXXX</span>
55         <span id="line-5">XXXXXXXXXXXXXXX</span>
56     </div>
57     <div id="log"></div>
58 </body>
59 </html>