blob: 04560071dfa4cc1590475b6ff87feab545b8255e (
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
|
<!DOCTYPE html>
<title>Test "tabbed" in display-override member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<link rel="help" href="https://www.w3.org/TR/mediaqueries-5/#display-modes" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-browser" />
<link rel="manifest" href="resources/display-override-member-media-feature-tabbed.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="resources/display-override-member-media-feature-manual.js"></script>
<h1>Test "tabbed" in display-override member + media feature</h1>
<style>
.fail {
background-color: red;
}
@media all and (display-mode: tabbed) {
body {
background-color: green;
}
}
</style>
<script>
const tabbed = matchMedia("(display-mode: tabbed)");
tabbed.onchange = () => {
if (tabbed.matches) {
document.body.classList.remove("fail");
}
}
if (!tabbed.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
|