shape-outside-001.html (3516B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test: Left and right float with shape-outside</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-001-ref.html"/> 10 <meta name="flags" content="ahem"/> 11 <meta name="assert" content="This test verifies that left floats with a shape-outside 12 only allow content wrapping on the right side, and right floats only allow wrapping on 13 the left."/> 14 <!-- This test is derived from Example 1 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 body { 19 margin-left: 0; 20 } 21 .container { 22 width: 400px; 23 text-align: center; 24 font-family: Ahem; 25 font-size: 20px; 26 line-height: 1em; 27 } 28 #test { 29 color: green; 30 } 31 #test-float-left { 32 shape-outside: polygon(0 0, 200px 200px, 0 200px); 33 float: left; 34 width: 200px; 35 height: 200px; 36 } 37 #test-float-right { 38 shape-outside: polygon(200px 0, 200px 200px, 0 200px); 39 float: right; 40 width: 200px; 41 height: 200px; 42 } 43 #failure-container { 44 color: red; 45 z-index: -1; 46 } 47 #test, #failure-container { 48 position: absolute; 49 top: 60px; 50 } 51 .line { 52 height: 20px; 53 } 54 #bottom { 55 position: absolute; 56 top: 200px; 57 } 58 #left-triangle, #right-triangle { 59 position: absolute; 60 top: 60px; 61 width: 200px; 62 height: 200px; 63 background-color: lightblue; 64 } 65 #left-triangle { 66 clip-path: polygon(0 0, 200px 200px, 0 200px); 67 } 68 #right-triangle { 69 left: 200px; 70 clip-path: polygon(200px 0, 200px 200px, 0 200px); 71 } 72 </style> 73 </head> 74 <body> 75 <p> 76 The test passes if the green shape does not intersect either of the triangles and 77 there is one green horizontal bar beneath the triangles. There should be no red. 78 </p> 79 <div id="test" class="container"> 80 <div id="test-float-left"></div> 81 <div id="test-float-right"></div> 82 XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXX 83 XXXXXXXXXXX XXXXXXXXX XXXXXXX XXXXX XXX X 84 XXXXXXXXXXXXXXXXX 85 </div> 86 <div id="failure-container"> 87 <div class="line container">XXXXXXXXXXXXXXXXX</div> 88 <div class="line container">XXXXXXXXXXXXXXX</div> 89 <div class="line container">XXXXXXXXXXXXX</div> 90 <div class="line container">XXXXXXXXXXX</div> 91 <div class="line container">XXXXXXXXX</div> 92 <div class="line container">XXXXXXX</div> 93 <div class="line container">XXXXX</div> 94 <div class="line container">XXX</div> 95 <div class="line container">X</div> 96 <div class="line container" id="bottom">XXXXXXXXXXXXXXXXX</div> 97 </div> 98 <div id="left-triangle"></div> 99 <div id="right-triangle"></div> 100 </body> 101 </html>