tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

display-contents-acid-dyn-2.html (1309B)


      1 <!DOCTYPE html>
      2 <!--
      3     Any copyright is dedicated to the Public Domain.
      4     http://creativecommons.org/publicdomain/zero/1.0/
      5 -->
      6 <html lang="en-US">
      7 <head>
      8  <meta charset="UTF-8">
      9  <title>CSS Test: CSS display:contents</title>
     10  <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=907396">
     11  <link rel="help" href="http://dev.w3.org/csswg/css-display">
     12 <style type="text/css">
     13 
     14        html,body {
     15            color:black; background-color:white; height:100%; font-size:16px; padding:0; margin:0;
     16        }
     17 
     18 iframe { padding:0;margin:0;border-width:0;width:100%;height:90%; color:red; }
     19 
     20    </style>
     21 <script>
     22 function runTest(iframe) {
     23  var win = iframe.contentWindow;
     24  var doc = iframe.contentDocument;
     25  doc.body.offsetHeight
     26  var e = doc.querySelectorAll('*');
     27  var contents = new Array;
     28  for (i=0; i < e.length; ++i) {
     29    var elm = e[i];
     30    if (win.getComputedStyle(elm).display == 'contents') {
     31      contents.push(elm);
     32      elm.style.display='inline';
     33    }
     34  }
     35  doc.body.offsetHeight;
     36  for (i=0; i < contents.length; ++i) {
     37    elm = contents[i];
     38    elm.style.display='contents';
     39  }
     40  doc.body.offsetHeight;
     41 }
     42 </script>
     43 </head>
     44 <body>
     45 
     46 <iframe src="display-contents-acid.html" frameborder=0 onload="runTest(this)"></iframe>
     47 
     48 </body>
     49 </html>