OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <link rel="stylesheet" href="../../resources/testharness.css"> |
| 6 <head> |
| 7 <style> |
| 8 html, body { |
| 9 margin: 0; |
| 10 padding: 0; |
| 11 } |
| 12 |
| 13 #measure { |
| 14 margin: 10px; |
| 15 padding: 10px; |
| 16 } |
| 17 |
| 18 #fixedsize { |
| 19 width: 100px; |
| 20 height: 100px; |
| 21 } |
| 22 </style> |
| 23 </head> |
| 24 <body> |
| 25 <div id="measure"><div id="fixedsize"></div></div> |
| 26 <script> |
| 27 if (window.testRunner) |
| 28 testRunner.dumpAsText(); |
| 29 |
| 30 if (window.internals) |
| 31 window.internals.setUsesOverlayScrollbars(true); |
| 32 |
| 33 test(function() { |
| 34 var measure = document.getElementById('measure'); |
| 35 |
| 36 // Record partial layout values for offset*. |
| 37 var measureWidth = measure.offsetWidth; |
| 38 var measureHeight = measure.offsetHeight; |
| 39 var measureTop = measure.offsetTop; |
| 40 var measureLeft = measure.offsetLeft; |
| 41 |
| 42 // Invalidate measure and force a full layout. |
| 43 var child = measure.firstChild; |
| 44 measure.removeChild(child); |
| 45 document.body.clientHeight; |
| 46 measure.appendChild(child); |
| 47 var forceLayout = document.body.clientHeight; |
| 48 |
| 49 var childOffsetTop = child.offsetTop; |
| 50 |
| 51 assert_equals(measureWidth, document.body.offsetWidth - 20); |
| 52 assert_equals(measureHeight, measure.offsetHeight); |
| 53 assert_equals(measureTop, childOffsetTop - 10); |
| 54 assert_equals(measureLeft, measure.offsetLeft); |
| 55 }, 'Test that partial layout works for offset{width, height, left, top} meth
ods.'); |
| 56 </script> |
| 57 </body> |
| 58 </html> |
OLD | NEW |