<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-overflow/#scrollbar-layout">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<div id="container" style="width:600px; height:400px; writing-mode:vertical-rl; overflow:auto;">
<div id="target" style="width:1000px; height:500px; background:lime;"></div>
</div>

<script>
promise_test(async () => {
  await new Promise(resolve => requestAnimationFrame(resolve));
  await new Promise(resolve => requestAnimationFrame(resolve));
  // Remove the vertical scrollbar.
  document.querySelector('#target').style.height = '200px';
  assert_equals(document.querySelector('#container').scrollLeft, 0);
}, 'Removing the vertical scrollbar of a vertical-rl container should keep scrollLeft');
</script>
