Index: third_party/WebKit/LayoutTests/fast/block/shrink-to-fit-with-height-stretched-abspos-and-auto-scrollbar-sibling.html |
diff --git a/third_party/WebKit/LayoutTests/fast/block/shrink-to-fit-with-height-stretched-abspos-and-auto-scrollbar-sibling.html b/third_party/WebKit/LayoutTests/fast/block/shrink-to-fit-with-height-stretched-abspos-and-auto-scrollbar-sibling.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b87a6c71f88232988ebbb63fa0fd4638a5b0244f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/block/shrink-to-fit-with-height-stretched-abspos-and-auto-scrollbar-sibling.html |
@@ -0,0 +1,23 @@ |
+<!DOCTYPE html> |
+<p>There should be a green square below. No red.</p> |
+<div style="float:left; position:relative; background:red;"> |
+ <div id="abspos" style="position:absolute; top:0; right:0; bottom:0; left:0; background:green;"></div> |
+ <div style="width:150px; max-height:150px; overflow:auto;"> |
+ <div id="child" style="width:100px; height:100px;"></div> |
+ </div> |
+</div> |
+<div style="clear:both;"></div> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+ test(() => { |
+ var abspos = document.getElementById("abspos"); |
+ var child = document.getElementById("child"); |
+ assert_equals(abspos.offsetWidth, 150); |
+ assert_equals(abspos.offsetHeight, 100); |
+ document.body.offsetLeft; |
+ child.style.height = "400px"; |
+ assert_equals(abspos.offsetWidth, 150); |
+ assert_equals(abspos.offsetHeight, 150); |
+ }, "Add content to an overflow:auto container, so that scrollbars appear"); |
+</script> |