robert@webkit.org | 6571422 | 2013-01-17 20:20:11 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <style> |
| 5 | #wrap { |
| 6 | position: absolute; |
| 7 | width: 800px; |
| 8 | height: 200px; |
| 9 | border: 2px solid black; |
| 10 | left:0; |
| 11 | top:0; |
| 12 | } |
| 13 | |
| 14 | #outer { |
| 15 | position: absolute; |
| 16 | display: inline-block; |
| 17 | width:200px; |
| 18 | height:200px; |
| 19 | background-color:grey; |
| 20 | } |
| 21 | |
| 22 | #outer2 { |
| 23 | display: inline-block; |
| 24 | width:200px; |
| 25 | height:200px; |
| 26 | background-color:blue; |
| 27 | } |
| 28 | |
| 29 | #inner { |
| 30 | width: 100px; |
| 31 | height: 100px; |
| 32 | background-color:green; |
| 33 | position: fixed; top:2px; |
| 34 | } |
| 35 | |
| 36 | #outer p { |
| 37 | margin-left: 110px; |
| 38 | } |
| 39 | </style> |
| 40 | </head> |
| 41 | <body> |
| 42 | <div id='wrap'> |
| 43 | <div id='outer2'></div> |
| 44 | <div id='outer'> |
| 45 | <div id='inner'></div> |
| 46 | <p>Foo</p> |
| 47 | </div> |
| 48 | </div> |
| 49 | <div id="output">Failure</div> |
| 50 | <script> |
| 51 | if (window.testRunner) { |
| 52 | testRunner.dumpAsText(); |
| 53 | } |
| 54 | |
| 55 | function measure() { |
| 56 | var output = document.getElementById("output"); |
| 57 | if (document.getElementById('inner').offsetLeft == 2) { |
| 58 | output.innerHTML = "Success" |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | var outer = document.getElementById("outer2"); |
| 63 | document.getElementById("wrap").removeChild(outer); |
| 64 | measure(); |
| 65 | </script> |
| 66 | </body> |
| 67 | </html> |