shape-outside-radial-gradient-002.html (2692B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Left float with radial gradient and percentage shape margin</title> 5 <link rel="author" title="Bear Travis" href="mailto:betravis@adobe.com"/> 6 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shapes-from-image"/> 7 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"/> 8 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-margin-property"/> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="../../supported-shapes/support/rounded-rectangle.js"></script> 12 <script src="../../supported-shapes/support/subpixel-utils.js"></script> 13 <script src="../../supported-shapes/support/test-utils.js"></script> 14 <meta name="flags" content="ahem dom"/> 15 <meta name="assert" content="This test verifies that shape-outside respects a 16 simple radial gradient when a percentage margin 17 is applied."/> 18 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 19 <style type="text/css"> 20 body { margin: 0; } 21 .container { 22 width: 200px; 23 height: 200px; 24 font-family: Ahem; 25 font-size: 10px; 26 line-height: 1; 27 } 28 #test { 29 color: green; 30 } 31 #gradient { 32 float: left; 33 width: 100px; 34 height: 100px; 35 shape-outside: radial-gradient(circle, green 0px, transparent 40px); 36 shape-margin: 5%; 37 } 38 </style> 39 </head> 40 <body> 41 <p> 42 The test passes if you see green boxes following the contour of a circle. There should be no red. 43 </p> 44 <div id="test" class="container"> 45 x</br> 46 <div id="gradient"></div> 47 <span id='test0'>x</span><br/> 48 <span id='test1'>x</span><br/> 49 <span id='test2'>x</span><br/> 50 <span id='test3'>x</span><br/> 51 <span id='test4'>x</span><br/> 52 <span id='test5'>x</span><br/> 53 <span id='test6'>x</span><br/> 54 <span id='test7'>x</span><br/> 55 <span id='test8'>x</span><br/> 56 <span id='test9'>x</span><br/> 57 x<br/> 58 </div> 59 <div id="log"></div> 60 <script> 61 test(function() { 62 assert_true( 63 verifyTextPoints({ 64 roundedRect: {x: 0, y: 10, width: 100, height: 100, rx: 50, ry: 50}, 65 containerWidth: 200, 66 containerHeight: 200, 67 lineHeight: 10 68 }, 10, 1), 69 "Lines positioned properly around the shape." 70 ); 71 }); 72 </script> 73 </body> 74 </html>