grid-whitespace-handling-1a.xhtml (1839B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <!-- 7 This test verifies that we don't create anonymous grid items around 8 runs of inline content that are _purely_ whitespace. 9 10 The test uses "white-space: pre", to try to tempt us into honoring 11 that whitespace. (but we should resist that temptation). 12 13 The test also uses 'justify-content: space-around' to be sure we can 14 tell whether anonymous grid items are being created around the whitespace 15 (since they'd claim a share of the packing space if they were there). 16 --> 17 <html xmlns="http://www.w3.org/1999/xhtml"> 18 <head> 19 <title>CSS Test: Test that anonymous grid items aren't created for pure-whitespace inline content</title> 20 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 21 <link rel="help" href="http://www.w3.org/TR/css3-grid/#grid-items"/> 22 <link rel="match" href="grid-whitespace-handling-1-ref.xhtml"/> 23 <style> 24 div { height: 100px; } 25 div.grid { 26 white-space: pre; 27 border: 1px dashed blue; 28 width: 200px; 29 display: grid; 30 justify-content: space-around; 31 } 32 div.a { 33 width: 30px; 34 background: lightgreen; 35 } 36 div.b { 37 width: 20px; 38 background: lightblue; 39 } 40 img { width: 40px; } 41 </style> 42 </head> 43 <body> 44 <!-- whitespace & tab after grid item --> 45 <div class="grid"><div class="a"/> </div> 46 47 <!-- 2 spaces before grid item --> 48 <div class="grid"> <div class="a"/><div class="b"/></div> 49 50 <!-- newline & whitespace between grid items --> 51 <div class="grid"><img src="support/solidblue.png"/> 52 <img src="support/solidblue.png"/></div> 53 </body> 54 </html>