OLD | NEW |
1 <style> | |
2 body { | |
3 overflow: hidden | |
4 } | |
5 pre { | |
6 position: absolute; | |
7 top: 10000px; | |
8 } | |
9 </style> | |
10 <script src="../resources/run-after-display.js"></script> | 1 <script src="../resources/run-after-display.js"></script> |
11 <script> | 2 <script> |
12 if (window.testRunner) | 3 if (window.testRunner) |
13 testRunner.waitUntilDone(); | 4 testRunner.waitUntilDone(); |
14 | 5 |
15 function onPause() | 6 function onPause() |
16 { | 7 { |
17 var videoElement = document.getElementById("fr").contentDocument.querySe
lector("video"); | 8 var videoElement = document.getElementById("fr").contentDocument.querySe
lector("video"); |
18 window.internals.startTrackingRepaints(document); | |
19 runAfterDisplay(function() { | 9 runAfterDisplay(function() { |
20 videoElement.currentTime = videoElement.duration * 0.50; | 10 videoElement.currentTime = videoElement.duration * 0.50; |
21 }); | 11 }); |
22 } | 12 } |
23 | 13 |
24 function onSeeked() | 14 function onSeeked() |
25 { | 15 { |
26 var repaintRects = window.internals.repaintRectsAsText(document); | |
27 var pre = document.createElement('pre'); | |
28 document.body.appendChild(pre); | |
29 pre.textContent += repaintRects; | |
30 window.internals.stopTrackingRepaints(document); | |
31 | |
32 if (window.testRunner) | 16 if (window.testRunner) |
33 testRunner.notifyDone(); | 17 testRunner.notifyDone(); |
34 } | 18 } |
35 | 19 |
36 function frameLoaded() | 20 function frameLoaded() |
37 { | 21 { |
38 var videoElement = document.getElementById("fr").contentDocument.querySe
lector("video"); | 22 var videoElement = document.getElementById("fr").contentDocument.querySe
lector("video"); |
39 videoElement.addEventListener("pause", onPause, false); | 23 videoElement.addEventListener("pause", onPause, false); |
40 videoElement.addEventListener("seeked", onSeeked, false); | 24 videoElement.addEventListener("seeked", onSeeked, false); |
41 // The MediaDocument has AUTOPLAY set, make sure we're paused. | 25 // The MediaDocument has AUTOPLAY set, make sure we're paused. |
42 videoElement.pause(); | 26 videoElement.pause(); |
43 } | 27 } |
44 </script> | 28 </script> |
45 <p> | 29 <p> |
46 This tests that in a standalone media document with audio content, the media
element repaints correctly | 30 This tests that in a standalone media document with audio content, the media
element repaints correctly |
47 while playing. | 31 while playing. |
48 </p> | 32 </p> |
49 <iframe src="content/silence.wav" id="fr" width=380 height=330 onload="frameLoad
ed()"></iframe> | 33 <iframe src="content/silence.wav" id="fr" width=380 height=330 onload="frameLoad
ed()"></iframe> |
50 <script>// To produce the same layout as before iframe was moved down to avoid r
ebaselines of different platforms. | 34 <script>// To produce the same layout as before iframe was moved down to avoid r
ebaselines of different platforms. |
51 // https://bugs.webkit.org/show_bug.cgi?id=54942 | 35 // https://bugs.webkit.org/show_bug.cgi?id=54942 |
52 </script> | 36 </script> |
OLD | NEW |