testing/web-platform/tests/css/css-scroll-anchoring/basic.html
author Bogdan Tara <btara@mozilla.com>
Thu, 10 Jan 2019 18:49:22 +0200
changeset 510378 842b7a62d9cefd5030c5561d536af8414899af7a
parent 510366 b4cb2cbebdb6a099f64e477ec434701d39d4816d
child 510495 da81605d3695d0fcdbcb5647212acbbc10d8954f
permissions -rw-r--r--
Backed out 15 changesets (bug 1305957) for ASAN failures CLOSED TREE Backed out changeset 4d5eb85d3155 (bug 1305957) Backed out changeset 51c86d025ecb (bug 1305957) Backed out changeset d8eef8f3e396 (bug 1305957) Backed out changeset 950bf6ad1ef2 (bug 1305957) Backed out changeset b4cb2cbebdb6 (bug 1305957) Backed out changeset bfca5019a9cc (bug 1305957) Backed out changeset e76b842c7b7f (bug 1305957) Backed out changeset d9445a5f3458 (bug 1305957) Backed out changeset d9052f7b34d9 (bug 1305957) Backed out changeset e7124fecb721 (bug 1305957) Backed out changeset bdb766faa867 (bug 1305957) Backed out changeset 3033401ef320 (bug 1305957) Backed out changeset 6b96050386f6 (bug 1305957) Backed out changeset c66c00f73296 (bug 1305957) Backed out changeset 6bd0bdab93cb (bug 1305957)

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>

body { height: 1000px; }
div { height: 100px; }

</style>
<div id="block1">abc</div>
<div id="block2">def</div>
<script>

// Tests that growing an element above the viewport produces a scroll
// anchoring adjustment equal to the amount by which it grew.

test(() => {
  document.scrollingElement.scrollTop = 150;
  document.querySelector("#block1").style.height = "200px";
  assert_equals(document.scrollingElement.scrollTop, 250);
}, "Minimal scroll anchoring example.");

</script>