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
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59

content / test / data / accessibility / html / bounds-fixed-scrolling.html [blame]

<!--
@BLINK-ALLOW:location=(8, 70)
@BLINK-WAIT-FOR:done
@BLINK-WAIT-FOR:location=(8, 70)
-->
<!DOCTYPE html>
<html>
<head>
<style>
#positioned {
  position:fixed;
  top:50px;
  height: 100px;
  width: 200px;
  font-size:40px;
  background: #555;
}
#heading_list {
  padding-top: 100px;
  font-size:40px;
}
</style>
</head>
<body onload="onLoad()">
<button onclick="clicked()">Scroll</button>
<div id="positioned">title</div>
<div id="heading_list">
<h2>Heading #1</h2>
<h2>Heading #2</h2>
<h2>Heading #3</h2>
<h2>Heading #4</h2>
<h2>Heading #5</h2>
<h2>Heading #6</h2>
<h2>Heading #7</h2>
<h2>Heading #8</h2>
</div>
<div id="statusDiv"></div>
<script>
function onLoad() {
  window.requestAnimationFrame(() => {
    window.onscroll = function() {
      window.requestAnimationFrame(() => {
        statusDiv.innerText = "done";
      });
    };
    window.requestAnimationFrame(() => {
      document.querySelector('button').click();
    });
  });
}

function clicked() {
  window.requestAnimationFrame(() => {
    window.scrollTo(0, 20);
  });
}
</script>
</body>
</html>