shape-outside-radial-gradient-004.html (2831B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Left float with radial gradient shape, shape margin, and shape-image-threshold</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-image-threshold-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 on a right float when 17 shape-image-threshold 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 text-align: right; 23 width: 200px; 24 height: 200px; 25 font-family: Ahem; 26 font-size: 10px; 27 line-height: 1; 28 } 29 #test { 30 color: green; 31 } 32 #gradient { 33 float: right; 34 width: 100px; 35 height: 100px; 36 shape-outside: radial-gradient(circle, green 10px, rgba(0, 255, 0, 0.75) 50px, rgba(0, 255, 0, 0.25) 50px); 37 shape-image-threshold: 0.5; 38 } 39 </style> 40 </head> 41 <body> 42 <p> 43 The test passes if you see green boxes following the contour of a circle. There should be no red. 44 </p> 45 <div id="test" class="container"> 46 x</br> 47 <div id="gradient"></div> 48 <span id='test0'>x</span><br/> 49 <span id='test1'>x</span><br/> 50 <span id='test2'>x</span><br/> 51 <span id='test3'>x</span><br/> 52 <span id='test4'>x</span><br/> 53 <span id='test5'>x</span><br/> 54 <span id='test6'>x</span><br/> 55 <span id='test7'>x</span><br/> 56 <span id='test8'>x</span><br/> 57 <span id='test9'>x</span><br/> 58 x<br/> 59 </div> 60 <div id="log"></div> 61 <script> 62 test(function() { 63 assert_true( 64 verifyTextPoints({ 65 roundedRect: {x: 100, y: 10, width: 100, height: 100, rx: 50, ry: 50}, 66 containerWidth: 200, 67 containerHeight: 200, 68 lineHeight: 10 69 }, 10, 1, "right"), 70 "Lines positioned properly around the shape." 71 ); 72 }); 73 </script> 74 </body> 75 </html>