shape-outside-013.html (2642B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Shape from image - shape-margin</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 <meta name="flags" content="ahem dom"/> 10 <meta name="assert" content="This test verifies that the content flows around the 11 shape defined in the images alpha channel and adjusted by 12 the shape-margin."/> 13 <!-- This test is derived from Example 7 in this version of the spec: 14 http://www.w3.org/TR/2014/WD-css-shapes-1-20140211/ --> 15 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 16 <style type="text/css"> 17 #test { 18 position: relative; 19 width: 400px; 20 color: green; 21 font-family: Ahem; 22 font-size: 20px; 23 line-height: 2em; 24 } 25 #test-image { 26 float: left; 27 shape-outside: url("support/circle-no-shadow.png"); 28 shape-margin: 15px; 29 } 30 #margin-circle { 31 position: absolute; 32 top: -15px; 33 left: -15px; 34 width: 230px; 35 height: 230px; 36 background-color: blue; 37 border-radius: 150px; 38 z-index: -1; 39 } 40 </style> 41 <script src="/resources/testharness.js"></script> 42 <script src="/resources/testharnessreport.js"></script> 43 <script src="support/spec-example-utils.js"></script> 44 <script> 45 setup({ single_test: true }); 46 function checkFloats() { 47 approxShapeTest('test', 'line-', 2, [200, 214, 216, 214, 200, 158, 0]); 48 done(); 49 } 50 </script> 51 </head> 52 <body onload="checkFloats();"> 53 <p> 54 The test passes if the short green horizontal bars are the right of the circle, 55 the long green bar is beneath the circle, and no bars intersect the circle. There 56 should be no red. 57 </p> 58 <div id="test"> 59 <img id="test-image" src="support/circle-no-shadow.png"/> 60 <div id="margin-circle"></div> 61 <span id="line-0">XXXXXX</span> 62 <span id="line-1">XXXXXX</span> 63 <span id="line-2">XXXXXX</span> 64 <span id="line-3">XXXXXX</span> 65 <span id="line-4">XXXXXX</span> 66 <span id="line-5">XXXXXX</span> 67 <span id="line-6">XXXXXXXXXXXXX</span> 68 </div> 69 <div id="log"></div> 70 </body> 71 </html>