Chromium Code Reviews| Index: LayoutTests/fast/css-grid-layout/grid-container-width-should-include-scroll-bar-width.html |
| diff --git a/LayoutTests/fast/css-grid-layout/grid-container-width-should-include-scroll-bar-width.html b/LayoutTests/fast/css-grid-layout/grid-container-width-should-include-scroll-bar-width.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5280b78f557e86a1713310e8e652121ab7f32275 |
| --- /dev/null |
| +++ b/LayoutTests/fast/css-grid-layout/grid-container-width-should-include-scroll-bar-width.html |
| @@ -0,0 +1,41 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<link href="resources/grid.css" rel="stylesheet"> |
| +<style> |
| +.grid { |
| + position:absolute; |
| + overflow:scroll; |
| +} |
| +.gridItem { |
| + width: 100px; |
| + height: 100px; |
| + background:green; |
| +} |
| +</style> |
| +<body> |
| +Test that scrollbar width is added to the width of the grid container. |
| +<div class='grid' style='top: 100px'> |
| + <span class='gridItem'></span> |
| +</div> |
| +<div class='grid' style='top: 100px; left: 150px; overflow-y: hidden' data-no-vertical-scrollbar> |
| + <span class='gridItem'></span> |
| +</div> |
| + |
| +<script src="../../resources/check-layout.js"></script> |
| +<script> |
| +var dummy = document.createElement('h1'); |
| +dummy.style.overflow = 'scroll'; |
| +document.body.appendChild(dummy); |
| +var scrollbarWidth = dummy.offsetWidth - dummy.clientWidth; |
| +document.body.removeChild(dummy); |
| + |
| +Array.prototype.forEach.call(document.querySelectorAll('div'), function(node) { |
| + var width = 100; |
| + if (!node.hasAttribute('data-no-vertical-scrollbar')) |
| + width += scrollbarWidth; |
| + node.setAttribute('data-expected-width', width); |
| +}); |
|
Julien - ping for review
2014/09/09 14:39:40
The scrollbar width is 16px so no need for this lo
Sunil Ratnu
2014/09/09 17:28:30
Done.
|
| +checkLayout('body'); |
| +</script> |
| +</body> |
| +</html> |