margin-block-end-scroll-area-001.html (1710B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Overflow Test: margin-block-end, scrolling area height and scrollTop (complex)</title> 6 7 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> 8 <link rel="help" href="https://www.w3.org/TR/css-overflow-3/#scrollable"> 9 <link rel="help" href="https://www.w3.org/TR/cssom-view-1/#dom-element-scrolltop"> 10 <link rel="help" href="https://www.w3.org/TR/cssom-view-1/#scrolling-area"> 11 <link rel="match" href="reference/ref-if-there-is-no-red.xht"> 12 13 <!-- 14 15 This test is a slightly modified version of the testcase from 16 17 Morten Stenshorne coming from 18 19 https://bugs.chromium.org/p/chromium/issues/detail?id=750992#c8 20 21 --> 22 23 <meta content="" name="flags"> 24 <meta content="This test checks that when the bottom edge of an element's scrolling area is the bottom margin edge of all of the element's descendants' boxes, then the element.scrollTop must reach such bottom edge. In this test, the tested element's scrolling area height must reach the end edge of the margin-bottom of the p element." name="assert"> 25 26 <style> 27 div 28 { 29 height: 200px; 30 } 31 32 div#test 33 { 34 font-size: 100px; 35 /* 36 Setting a font-size of 100px is to influence the 37 margin on the P without setting it directly. 38 */ 39 overflow: hidden; 40 } 41 42 div#red 43 { 44 background-color: red; 45 } 46 47 div#red > p 48 { 49 height: 1px; 50 } 51 </style> 52 53 <body onload="document.getElementById('test').scrollTop = 200;"> 54 55 <p>Test passes if there is <strong>no red</strong>. 56 57 <div id="test"> 58 59 <div id="red"> 60 61 <div id="filler"></div> 62 63 <p> 64 65 </div> 66 67 </div>