tor-browser

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

display-contents-acid-dyn-3.html (1345B)


      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, elm.nextSibling, elm.parentNode ]);
     32      elm.remove();
     33    }
     34  }
     35  doc.body.offsetHeight;
     36  var i = contents.length;
     37  while(i--) {
     38    var arr = contents[i];
     39    arr[2].insertBefore(arr[0], arr[1]);
     40  }
     41  doc.body.offsetHeight;
     42 }
     43 </script>
     44 </head>
     45 <body>
     46 
     47 <iframe src="display-contents-acid.html" frameborder=0 onload="runTest(this)"></iframe>
     48 
     49 </body>
     50 </html>