overflow-empty-child-box.html (1952B)
1 <!DOCTYPE html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html> 7 <meta charset="utf-8"> 8 <title>CSS Overflow Test: Testing an empty child box and its container's scrollable overflow area</title> 9 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 10 <link rel="author" title="Mozilla" href="https://www.mozilla.org/"> 11 <link rel="help" href="https://drafts.csswg.org/css-overflow-3/#scrollable"> 12 <meta name="assert" content="This test verifies that an empty child box shouldn't contribute to its parents scrollable overflow area."> 13 14 <script src="/resources/testharness.js"></script> 15 <script src="/resources/testharnessreport.js"></script> 16 <script src="/resources/check-layout-th.js"></script> 17 18 <style> 19 .container { 20 border: 1px solid black; 21 width: 200px; 22 height: 100px; 23 } 24 25 .empty { 26 position: relative; 27 width: 0px; 28 height: 0px; 29 left: 500px; 30 top: 300px; 31 box-shadow: 0 0 0 10px blue; 32 } 33 </style> 34 35 <body onload="checkLayout('.container')"> 36 <p>You should see no scrollbars in these container because an empty child 37 box shouldn't contribute to its parents scrollable overflow area. </p> 38 39 <div class="container" style="overflow: visible" 40 data-expected-scroll-width="200" data-expected-scroll-height="100"> 41 <div class="empty"></div> 42 </div> 43 44 <div class="container" style="overflow: auto" 45 data-expected-scroll-width="200" data-expected-scroll-height="100"> 46 <div class="empty"></div> 47 </div> 48 49 <div class="container" style="overflow: hidden" 50 data-expected-scroll-width="200" data-expected-scroll-height="100"> 51 <div class="empty"></div> 52 </div> 53 54 <div class="container" style="overflow: clip" 55 data-expected-scroll-width="200" data-expected-scroll-height="100"> 56 <div class="empty"></div> 57 </div> 58 </body> 59 </html>