Index: LayoutTests/fast/dom/partial-layout-block.html |
diff --git a/LayoutTests/fast/dom/partial-layout-block.html b/LayoutTests/fast/dom/partial-layout-block.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df8d31d3efeb7bbc5bb20b7e948ba7bc34a03129 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/partial-layout-block.html |
@@ -0,0 +1,58 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<link rel="stylesheet" href="../../resources/testharness.css"> |
+<head> |
+<style> |
+html, body { |
+ margin: 0; |
+ padding: 0; |
+} |
+ |
+#measure { |
+ margin: 10px; |
+ padding: 10px; |
+} |
+ |
+#fixedsize { |
+ width: 100px; |
+ height: 100px; |
+} |
+</style> |
+</head> |
+<body> |
+<div id="measure"><div id="fixedsize"></div></div> |
+<script> |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ if (window.internals) |
+ window.internals.setUsesOverlayScrollbars(true); |
+ |
+ test(function() { |
+ var measure = document.getElementById('measure'); |
+ |
+ // Record partial layout values for offset*. |
+ var measureWidth = measure.offsetWidth; |
+ var measureHeight = measure.offsetHeight; |
+ var measureTop = measure.offsetTop; |
+ var measureLeft = measure.offsetLeft; |
+ |
+ // Invalidate measure and force a full layout. |
+ var child = measure.firstChild; |
+ measure.removeChild(child); |
+ document.body.clientHeight; |
+ measure.appendChild(child); |
+ var forceLayout = document.body.clientHeight; |
+ |
+ var childOffsetTop = child.offsetTop; |
+ |
+ assert_equals(measureWidth, document.body.offsetWidth - 20); |
+ assert_equals(measureHeight, measure.offsetHeight); |
+ assert_equals(measureTop, childOffsetTop - 10); |
+ assert_equals(measureLeft, measure.offsetLeft); |
+ }, 'Test that partial layout works for offset{width, height, left, top} methods.'); |
+</script> |
+</body> |
+</html> |