| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>066 deep nesting</title>
- <style>
- body { background: #ffffff; color: #202020; font-family: sans-serif;
- margin: 12px; font-size: 18px; }
- #n0 { background: #f4f4f4; padding: 2px; }
- #deep { background: #dddddd; margin: 6px 0; }
- #result { background: #ffc8c8; color: #000000; padding: 8px;
- margin-top: 12px; }
- </style>
- </head>
- <body>
- <h1>066 — deep nesting</h1>
- <p>News pages wrap a teaser in many layout containers. Text at a realistic
- nesting depth must still be laid out.</p>
- <div id="n0"><div id="n1"><div id="n2"><div id="n3">
- <div id="n4"><div id="n5"><div id="n6"><div id="n7">
- <div id="n8"><div id="n9"><div id="n10"><div id="n11">
- <div id="n12"><div id="n13"><div id="n14"><div id="n15">
- <h2 id="deep">Deep content headline</h2>
- <p>Deep content body text.</p>
- </div></div></div></div></div></div></div></div>
- </div></div></div></div></div></div></div></div>
- <div id="result">checking...</div>
- <script>
- setTimeout(function () {
- var d = document.getElementById('deep');
- var r = d.getBoundingClientRect();
- var style = getComputedStyle(d);
- var ok = r.height > 10 && r.width > 100 &&
- style.display === 'block';
- var out = document.getElementById('result');
- if (out) {
- out.style.background = ok ? '#c8f0c8' : '#ffc8c8';
- out.textContent = (ok ? 'DEEP-OK ' : 'DEEP-FAIL ') +
- Math.round(r.left) + ',' + Math.round(r.top) + ' ' +
- Math.round(r.width) + 'x' + Math.round(r.height) +
- ' display=' + style.display;
- }
- }, 300);
- </script>
- </body>
- </html>
|