overflow-rtl-scroll-left.html (1414B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>overflow: rtl scroll left should return 0 when overflow size is empty</title> 4 <link rel="author" href="mailto:perryuwang@gmail.com"> 5 <link rel="help" href="https://issues.chromium.org/issues/40064904"> 6 <script src="/css/css-transitions/support/helper.js"></script> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <style> 10 #rtl-parent { 11 direction: rtl; 12 overflow: auto; 13 width: 300px; 14 height: 200px; 15 } 16 #rtl-child { 17 width: 500px; 18 height: 200px; 19 } 20 </style> 21 22 <div id="rtl-parent"> 23 <div id="rtl-child"></div> 24 </div> 25 26 <script> 27 promise_test(async () => { 28 const parent = document.getElementById('rtl-parent'); 29 const child = document.getElementById('rtl-child'); 30 31 await waitForAnimationFrames(5); 32 assert_equals(parent.offsetWidth, 300); 33 assert_equals(parent.offsetHeight, 200); 34 assert_equals(child.offsetWidth, 500); 35 assert_equals(child.offsetHeight, 200); 36 37 assert_equals(parent.scrollWidth, 500); 38 assert_equals(parent.scrollHeight, 200); 39 assert_equals(parent.scrollLeft, 0); 40 41 child.style.height = '0px'; 42 parent.style.height = '0px'; 43 44 await waitForAnimationFrames(5); 45 assert_equals(parent.offsetHeight, 0); 46 assert_equals(parent.scrollHeight, 0); 47 assert_equals(parent.scrollLeft, 0); 48 }, 'rtl scroll left should be 0 when overflow size is empty'); 49 </script>