Index: third_party/WebKit/LayoutTests/fast/scrolling/small-border-box.html |
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/small-border-box.html b/third_party/WebKit/LayoutTests/fast/scrolling/small-border-box.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..725a597c55bb354d508186b15d7eab20f5b7a41e |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/small-border-box.html |
@@ -0,0 +1,78 @@ |
+<!DOCTYPE html> |
+<style> |
+ .bfc { display:flow-root; } |
+ .vertical { overflow-y:scroll !important; overflow-x:hidden; } |
+ .horizontal { overflow-x:scroll !important; overflow-y:hidden; } |
+ .small { width:0; padding:1px; border:1px solid; margin-right:10px; float:left; } |
+ .size_border_box { box-sizing:border-box; } |
+ .rtl { direction:rtl; } |
+</style> |
+ |
+<div id="measure_block" style="position:absolute; visibility:hidden; width:100px; height:100px; overflow:scroll;"> |
+ <div id="measure_block_child" style="height:100%;"></div> |
+</div> |
+ |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+ var measure_block = document.getElementById("measure_block"); |
+ var measure_block_child = document.getElementById("measure_block_child"); |
+ var vertical_scrollbar_width = measure_block.offsetWidth - measure_block_child.offsetWidth; |
+ var horizontal_scrollbar_width = measure_block.offsetHeight - measure_block_child.offsetHeight; |
+ var padding_and_border = 4; |
+ var width_with_scrollbar = vertical_scrollbar_width + padding_and_border; |
+ var width_without_scrollbar = padding_and_border; |
+ var height_with_scrollbar = horizontal_scrollbar_width + padding_and_border; |
+ var height_without_scrollbar = padding_and_border; |
+</script> |
+ |
+<p>There should be some figures with the same size below, at least as |
+ wide as the width of a vertical scrollbar:</p> |
+<div id="vertical_only" class="bfc"> |
+ <div class="small vertical"></div> |
+ <div class="small vertical size_border_box"></div> |
+ <div class="small vertical rtl"></div> |
+ <div class="small vertical size_border_box rtl"></div> |
+</div> |
+ |
+<p>There should be some figures with the same size below, at least as |
+ tall as the height of a horizontal scrollbar:</p> |
+<div id="horizontal_only" class="bfc"> |
+ <div class="small horizontal"></div> |
+ <div class="small horizontal size_border_box"></div> |
+ <div class="small horizontal rtl"></div> |
+ <div class="small horizontal size_border_box rtl"></div> |
+</div> |
+ |
+<p>There should be some figures with the same size below, at least as |
+ wide and tall as the width and height of a vertical and horizontal |
+ scrollbar:</p> |
+<div id="vertical_and_horizontal" class="bfc"> |
+ <div class="small vertical horizontal"></div> |
+ <div class="small vertical horizontal size_border_box"></div> |
+ <div class="small vertical horizontal rtl"></div> |
+ <div class="small vertical horizontal size_border_box rtl"></div> |
+</div> |
+ |
+<script> |
+ document.querySelectorAll("#vertical_only > div").forEach(function(elm) { |
+ test(function() { |
+ assert_equals(elm.offsetWidth, width_with_scrollbar); |
+ assert_equals(elm.offsetHeight, height_without_scrollbar); |
+ }, elm.className); |
+ }); |
+ |
+ document.querySelectorAll("#horizontal_only > div").forEach(function(elm) { |
+ test(function() { |
+ assert_equals(elm.offsetWidth, width_without_scrollbar); |
+ assert_equals(elm.offsetHeight, height_with_scrollbar); |
+ }, elm.className); |
+ }); |
+ |
+ document.querySelectorAll("#vertical_and_horizontal > div").forEach(function(elm) { |
+ test(function() { |
+ assert_equals(elm.offsetWidth, width_with_scrollbar); |
+ assert_equals(elm.offsetHeight, height_with_scrollbar); |
+ }, elm.className); |
+ }); |
+</script> |