summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scroll-behavior/overflow-scroll-triggers-layout.html
blob: af791b8f2787e224f84eeea0acf619e811d96e12 (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
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
#inner {
  background:red;
  width:500px;
  height:100%;
}

#outer {
  width:300px;
  height:500px;
  overflow-y:scroll;
  overflow-x:hidden;
}
</style>
<div id="outer">
  <div id="inner">
  </div>
</div>

<script>
description("Ensures that if layout is dirty, triggering a scroll causes a relayout");
internals.settings.setScrollAnimatorEnabled(false);

outer.addEventListener("wheel",
  function(e) {
    inner.style.height = "1000px";
  }
);

var x = outer.offsetLeft + 5;
var y = outer.offsetTop + 5;
eventSender.mouseMoveTo(x, y);
eventSender.mouseScrollBy(0, -1);
shouldBeGreaterThan("outer.scrollTop", "0");

</script>