summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-video.html
blob: bed5954fe410cd4f21b7e06eb3c1abeaa62b7ca2 (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
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Content Visibility: hidden video</title>
<link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-video-ref.html">
<meta name="assert" content="content-visibility hidden video element does not paint replaced content">

<script src="/common/reftest-wait.js"></script>

<style>
video {
  width: 200px;
  height: 200px;
  background: green;
  border: 1px solid black;
}
.hidden {
  content-visibility: hidden;
}
</style>

<body>
  <video id="video" poster="../support/blue-100x100.png" src="../support/white.webm" controls></video>
</body>

<script>
async function runTest() {
  video.classList.add("hidden");
  video.play();
  requestAnimationFrame(takeScreenshot);
}

window.onload = () => {
  requestAnimationFrame(() => {
    requestAnimationFrame(runTest);
  });
};
</script>
</html>