summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-094.html
blob: 0434530298b578ed0ea81cef43987e69ea59142f (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
<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>Content Visibility: hidden effect on table types</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-094-ref.html">
<meta name="assert" content="content-visibility: hidden effect on table types">

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

<style>
table {
  width: 150px;
  height: 150px;
  background: lightblue;
}
.hidden {
  content-visibility: hidden;
}
</style>

<table id=table>
  <caption id=caption>
    <div>Test fails if this text is visible.</div>
  </caption>
  <tr id=tr>
    <td id=td>
      <div>Test passes if this text is visible.</div>
    </td>
  </tr>
</table>

<script>
function runTest() {
  document.getElementById("table").classList.add("hidden");
  document.getElementById("tr").classList.add("hidden");
  document.getElementById("caption").classList.add("hidden");
  requestAnimationFrame(takeScreenshot);
}

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