tor-browser

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

dynamic-top-change-001.xht (1926B)


      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3  <head>
      4   <title>CSS Test: Inheriting 'top' changes from relpos grandparent</title>
      5   <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
      6   <link rel="reviewer" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/>
      7   <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit"/>
      8   <link rel="help" href="http://www.w3.org/TR/css-cascade-3/#inherit"/>
      9   <link rel="help" href="http://www.w3.org/TR/css-cascade-4/#inherit"/>
     10   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"/>
     11   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position"/>
     12   <link rel="match" href="dynamic-top-change-001-ref.xht" />
     13 
     14   <meta name="flags" content="dom" />
     15   <meta name="assert" content="The position of a positioned element which inherits its 'top' value from its relatively positioned grandparent changes when the grandparent's 'top' value is changed."/>
     16   <style type="text/css"><![CDATA[
     17   p
     18   {
     19   line-height: 1.25;
     20   margin: 1em 0;
     21   }
     22 
     23   strong {line-height: 1;}
     24 
     25     .testDiv { position: absolute; width: 100px; height: 100px; }
     26     #green { top: 4em; background: green; }
     27     #red { top: inherit; background: red; }
     28     #parent { top: inherit; position: relative; }
     29     #grandparent { position: relative; }
     30   ]]></style>
     31   <script type="text/javascript"><![CDATA[
     32     window.onload = function() {
     33       document.body.offsetWidth;
     34       document.getElementById("grandparent").style.top = "2em";
     35     }
     36   ]]></script>
     37  </head>
     38  <body>
     39    <p>Test passes if there is <strong>no red</strong>.</p>
     40    <div id="grandparent">
     41      <div id="parent">
     42        <div id="red" class="testDiv"></div>
     43      </div>
     44      <div id="green" class="testDiv"></div>
     45    </div>
     46  </body>
     47 </html>