3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
5 <link rel=
"stylesheet" href=
"../../resources/testharness.css">
25 <div id=
"measure"><div id=
"fixedsize"></div></div>
27 if (window
.testRunner
)
28 testRunner
.dumpAsText();
31 window
.internals
.settings
.setOverlayScrollbarsEnabled(true);
34 var measure
= document
.getElementById('measure');
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
;
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
;
49 var childOffsetTop
= child
.offsetTop
;
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} methods.');