| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-strict.dtd"> |
| 2 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 <head> |
| 4 <title>CSS Test: Inheriting 'top' changes from abspos 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-inher
it"/> |
| 8 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props"
/> |
| 9 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-positio
n"/> |
| 10 <meta name="flags" content="combo dom" /> |
| 11 <meta name="assert" content="The position of a positioned element which inheri
ts its 'top' value from its relatively positioned parent changes when the parent
's 'top' value is changed."/> |
| 12 <style type="text/css"><![CDATA[ |
| 13 .testDiv { position: relative; width: 100px; height: 100px; } |
| 14 #green { top: 100px; background: green; } |
| 15 #red { top: inherit; background: red; display: block; } |
| 16 #parent { position: relative; } |
| 17 body > p { position: absolute; font-size: medium; } |
| 18 #grandparent { position: absolute; top: 0; } |
| 19 body { font-size: 0; line-height: 0; position: relative; } |
| 20 ]]></style> |
| 21 <script type="text/javascript"><![CDATA[ |
| 22 window.onload = function() { |
| 23 document.body.offsetWidth; |
| 24 document.getElementById("parent").style.top = "50px"; |
| 25 } |
| 26 ]]></script> |
| 27 </head> |
| 28 <body> |
| 29 <p>Test passes if there is no red.</p> |
| 30 <div id="grandparent"> |
| 31 <span id="parent"> |
| 32 <span id="red" class="testDiv"></span> |
| 33 </span> |
| 34 </div> |
| 35 <div id="green" class="testDiv"></div> |
| 36 </body> |
| 37 </html> |
| OLD | NEW |