shape-outside-007.html (3248B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Shape smaller than float content area - 1 float</title> 5 <link rel="author" title="Rebecca Hauck" href="mailto:rhauck@adobe.com"/> 6 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#relation-to-box-model-and-float-behavior"/> 7 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#supported-basic-shapes"/> 8 <link rel="help" href="http://www.w3.org/TR/css-shapes-1/#shape-outside-property"/> 9 <link rel="match" href="reference/shape-outside-007-ref.html"/> 10 <meta name="flags" content="ahem"/> 11 <meta name="assert" content="This test verifies that inline content only wraps around the 12 shape, and otherwise overlays the rest of the float margin 13 box"/> 14 <!-- This test is derived from Example 5 in this version of the spec: 15 http://www.w3.org/TR/2013/WD-css-shapes-1-20131203/ --> 16 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 17 <style type="text/css"> 18 .container { 19 width: 260px; 20 font-family: Ahem; 21 font-size: 20px; 22 line-height: 1.5em; 23 border: 1px solid black; 24 padding-left: 2px; 25 } 26 #test { 27 color: green; 28 } 29 #test-float-left { 30 shape-outside: polygon(0 70px, 50px 120px, 0 120px); 31 float: left; 32 width: 100px; 33 height: 100px; 34 margin-top: 20px; 35 } 36 #test, #failure-container { 37 position: absolute; 38 top: 70px; 39 } 40 #margin-line { 41 position: absolute; 42 top: 100px; 43 width: 263px; 44 border-bottom: 1px solid black; 45 } 46 .fail { 47 position: absolute; 48 height: 20px; 49 background-color: red; 50 z-index: -1; 51 } 52 #bar-1 { 53 top: 6px; 54 left: 3px; 55 width: 240px; 56 } 57 #bar-2 { 58 top: 36px; 59 left: 3px; 60 width: 240px; 61 } 62 #bar-3 { 63 top: 66px; 64 left: 23px; 65 width: 220px; 66 } 67 #bar-4 { 68 top: 96px; 69 left: 53px; 70 width: 200px; 71 } 72 #triangle { 73 position: absolute; 74 top: 90px; 75 width: 100px; 76 height: 100px; 77 background-color: lightblue; 78 margin-left: 2px; 79 clip-path: polygon(0% 50%, 50% 100%, 0 100%);; 80 81 } 82 </style> 83 </head> 84 <body> 85 <p> 86 The test passes if one green bar is inside the top rectangle, three green bars 87 are in the bottom rectangle, and none intersect the triangle. There should be no red. 88 </p> 89 <div id="test" class="container"> 90 <div id="test-float-left"></div> 91 XXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXX 92 </div> 93 <div id="margin-line"></div> 94 <div id="failure-container"> 95 <div id="bar-1" class="fail"></div> 96 <div id="bar-2" class="fail"></div> 97 <div id="bar-3" class="fail"></div> 98 <div id="bar-4" class="fail"></div> 99 </div> 100 <div id="triangle"></div> 101 </body> 102 </html>