summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/media/video-remove-insert-repaints.html
blob: 9fdae117e92cc37f51d71e23de906921f608aa07 (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
39
40
41
42
43
44
45
46
47
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Test that video is rendered after being re-inserted into a document.</title>

        <script src=media-file.js></script>
        <script>
            if (window.testRunner)
                testRunner.waitUntilDone();

            function seeked()
            {
                if (window.testRunner)
                    testRunner.notifyDone();
            }

            function playing()
            {
                video.pause();
                video.currentTime = 0;
            }

            function canplaythrough()
            {
                document.body.removeChild(video);
                document.body.offsetLeft;
                document.body.appendChild(video);
                video.play();
            }

            function start()
            {
                video = document.getElementsByTagName('video')[0];
                video.src = findMediaFile('video', 'content/test');
                video.addEventListener('canplaythrough', canplaythrough);
                video.addEventListener('playing', playing);
                video.addEventListener('seeked', seeked);
            }

        </script>

    </head>

    <body onload="start()">
        <video width=320 height=240 ></video>
    </body>
</html>