blob: 5a0008d90147ba8a918e80e4d1fcdb7e6806262c [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
#scrollLeftRtl {
width: 100px;
height: 100px;
background-color: green;
direction: rtl;
overflow: scroll;
}
#inner {
white-space: nowrap;
}
</style>
<div id="scrollLeftRtl">
<span id="inner">INNER INNER INNER</span>
</div>
<script>
description("Check that the scroll offset in an LTR block is correctly preserved when the existence of its vertical scrollbar changes.");
var scrollLeftDiv = document.getElementById("scrollLeftRtl");
var initialOffset = scrollLeftDiv.scrollWidth - scrollLeftDiv.clientWidth - scrollLeftDiv.scrollLeft;
scrollLeftDiv.style.overflow = "auto";
var finalOffset = scrollLeftDiv.scrollWidth - scrollLeftDiv.clientWidth - scrollLeftDiv.scrollLeft;
shouldBe("finalOffset", "initialOffset");
</script>