insert-block-in-inlines-middle-001.xht (1941B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 3 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> 4 5 <head> 6 7 <title>CSS Test: Insert a block-level element into a block of inlines at its middle</title> 8 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> 10 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level" title="9.2.1.1 Anonymous block boxes" /> 11 <link rel="match" href="insert-block-in-inlines-middle-001-ref.xht" /> 12 13 <meta content="ahem dom" name="flags" /> 14 <meta http-equiv="Content-Script-Type" content="text/javascript" /> 15 16 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 17 <style type="text/css"><![CDATA[ 18 div.container 19 { 20 background-color: fuchsia; 21 color: black; 22 font: 20px/1 Ahem; 23 margin: 1em; 24 } 25 26 div.inserted 27 { 28 border-left: yellow solid 0.5em; 29 border-right: yellow solid 0.5em; 30 margin: 1em 0em; 31 } 32 ]]></style> 33 34 <script type="text/javascript"><![CDATA[ 35 function insertABlockAtMiddle() 36 { 37 document.body.offsetHeight; 38 39 var newBlockNode = document.createElement("div"); 40 41 newBlockNode.appendChild(document.createTextNode("Inserted new block")); 42 43 newBlockNode.className = "inserted"; 44 45 document.getElementsByClassName("container")[0].insertBefore(newBlockNode, document.getElementById("insertion-point")); 46 47 document.documentElement.className = ""; 48 } 49 ]]></script> 50 51 </head> 52 53 <body onload="insertABlockAtMiddle();"> 54 55 <p>Test passes if the 2 colorized rectangles are <strong>identical</strong>.</p> 56 57 <div class="container"><span>Several</span> <span>inline elements</span> are <span id="insertion-point">in this</span> sentence.</div> 58 59 <div class="container"> 60 Several inline elements are 61 <div class="inserted">Inserted new block</div> 62 in this sentence. 63 </div> 64 65 </body> 66 </html>