summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-fullscreen-manual.tentative.html
blob: 0b9923f8bd4ded2fb7af6cd8fff4e24fc3b10cd9 (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
<!DOCTYPE html>
<title>Test "fullscreen" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-fullscreen" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="resources/display-override-member-media-feature-fullscreen.webmanifest" />
<script src="resources/display-override-member-media-feature-manual.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Test "fullscreen" in display-override member + media feature</h1>
<style>
  .fail {
    background-color: red;
  }

  @media all and (display-mode: fullscreen) {
    body {
      background-color: green;
    }
  }
</style>
<script>
const fullscreen = matchMedia("(display-mode: fullscreen)");

fullscreen.onchange = () => {
  if (fullscreen.matches) {
    document.body.classList.remove("fail");
  }
}

if (!fullscreen.matches) {
  document.body.classList.add("fail");
}
</script>
<p>
  To pass, the background color must be green after installing.
</p>