self-painting-layers.html 1.41 KB
Newer Older
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
<!DOCTYPE html>
<html>
  <head>
    <title>Self painting layers</title>

    <style type="text/css" media="screen">

    #container {
      width: 300px;
      margin: 10px;
      border: 1px solid black;
    }
    
    #details {
     width: 300px;
     height: 150px;
     margin: 10px;
     overflow: auto;
     border: 1px solid black;
    }

    #details > div {
      width: 100%;
      height: 500px;
      font-size: 24pt;
      line-height: 150%;
    }
    
    </style>
    <script type="text/javascript" charset="utf-8">
      if (window.layoutTestController)
        layoutTestController.waitUntilDone();

      function testOnLoad()
      {
        window.setTimeout(function() {
          document.getElementById('details').scrollTop = 24;
          if (window.layoutTestController)
            layoutTestController.notifyDone();
        }, 0);
      }
      
      window.addEventListener('load', function() {
44
45
46
        var video = document.getElementById('video');
        video.addEventListener('loadeddata', testOnLoad, false);
        video.src = "resources/video.mp4";
47
48
49
50
51
52
      }, false);
    </script>
  </head>
  <body>
      <p>You should not see double text when the div scrolls</p>
        <div id="container">
53
          <video id="video" width="300" height="200"></video>
54
55
56
57
58
59
60
61
62
63
        </div>

        <div id="details">
            <div>
              Scrolled<br>text<br>here.
            </div>
        </div>

  </body>
</html>