summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/overflow-auto-ltr.html
blob: 5a0008d90147ba8a918e80e4d1fcdb7e6806262c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!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>