summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/scrolling/scroll-to-origin-no-layout.html
blob: 48d701e1aa832b6f6af915e5bdb55ca70f523ce4 (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
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<div id="spanner"></div>
<script>
spanner.style.height = "3000px";
scrollTo(0, 1000);

if (window.internals) {
    var styleCount = internals.updateStyleAndReturnAffectedElementCount();
    var layoutCount = internals.needsLayoutCount();
    // scrollTo should have synchronously updated style and layout
    shouldBe("styleCount", "0");
    shouldBe("layoutCount", "0");
}
shouldBe("window.scrollY", "1000");

spanner.style.height = "2000px";
scrollTo(0, 0);

if (window.internals) {
    var styleCount = internals.updateStyleAndReturnAffectedElementCount();
    var layoutCount = internals.needsLayoutCount();
    // scrollTo should not need to synchronously updated style and layout
    shouldNotBe("styleCount", "0");
    shouldNotBe("layoutCount", "0");
}
shouldBe("window.scrollY", "0");
</script>