contain-size-023.html (2048B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Containment Test: 'contain: size' applies to inline-block (basic)</title> 6 7 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> 8 <link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-size"> 9 <link rel="match" href="reference/contain-size-023-ref.html"> 10 11 <meta content="This test checks that when laying out an inline-block element with 'contain: size', the inline-block element must be treated as if it would have no contents. In this test, the inline-block element has text and no in-flow block descendant." name="assert"> 12 13 <!-- 14 15 contain-size-021: inline-block with 1 image and no in-flow block descendant: width comparison 16 17 contain-size-022: inline-block with 1 image and no in-flow block descendant: height comparison 18 19 contain-size-023: inline-block with text and no in-flow block descendant: width comparison 20 21 contain-size-024: inline-block with text and no in-flow block descendant: height comparison 22 23 contain-size-025: inline-block and 2 in-flow block descendants made of images: width comparison 24 25 contain-size-026: inline-block and 2 in-flow block descendants made of images: height comparison 26 27 contain-size-027: inline-block and 2 in-flow block descendants made of text: width comparison 28 29 contain-size-028: inline-block and 2 in-flow block descendants made of text: height comparison 30 31 --> 32 33 <style> 34 div.inline-block 35 { 36 display: inline-block; 37 } 38 39 div#blue-test 40 { 41 background-color: blue; 42 color: transparent; 43 contain: size; 44 font-size: 100px; 45 padding: 50px; 46 } 47 48 div#orange-reference 49 { 50 background-color: orange; 51 height: 100px; 52 width: 100px; 53 } 54 </style> 55 56 <p>This test passes if the painted blue area is <strong>exactly as wide as</strong> the orange square. 57 58 <div> 59 <div id="blue-test" class="inline-block">B</div> 60 </div> 61 62 <div> 63 <div id="orange-reference" class="inline-block"></div> 64 </div>