scrollable-overflow-fixed-positioned-initial-containing-block.html (1299B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Scrollable overflow of Document element with 'position: fixed' which has ICB as containing block</title> 5 <link rel="help" href="https://drafts.csswg.org/css-overflow/#scrollable"> 6 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth"> 7 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollheight"> 8 <link rel="author" title="Jo Steven Novaryo" href="mailto:jo.steven.novaryo@huawei.com"> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 </head> 12 <body> 13 </body> 14 <script> 15 promise_test(async (t) => { 16 let initialScrollHeight = document.scrollingElement.scrollHeight; 17 let initialScrollWidth = document.scrollingElement.scrollWidth; 18 19 let fixedDiv = document.createElement("div"); 20 fixedDiv.style.position = "fixed"; 21 fixedDiv.style.height = (initialScrollHeight * 2) + "px"; 22 fixedDiv.style.width = (initialScrollWidth * 2) + "px"; 23 document.body.appendChild(fixedDiv); 24 25 assert_equals(document.scrollingElement.scrollHeight, initialScrollHeight); 26 assert_equals(document.scrollingElement.scrollWidth, initialScrollWidth); 27 28 }, "position: fixed fixed with ICB as CB should not affect scrollable overflow of Document element."); 29 </script> 30 </html>