display-member-media-feature-fullscreen-manual.html (1147B)
1 <!DOCTYPE html> 2 <title>Test "fullscreen" value of display member + media feature</title> 3 <link rel="help" href="https://w3c.github.io/manifest#display-member" /> 4 <link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-fullscreen" /> 5 <link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" /> 6 <link rel="manifest" href="resources/display-member-media-feature-fullscreen.webmanifest" /> 7 <script src="resources/display-member-media-feature-manual.js"></script> 8 <meta name="viewport" content="width=device-width, initial-scale=1"> 9 <h1>Testing support for "fullscreen" value of display member + media feature</h1> 10 <style> 11 .fail { 12 background-color: red; 13 } 14 15 @media all and (display-mode: fullscreen) { 16 body { 17 background-color: green; 18 } 19 } 20 </style> 21 <script> 22 const fullscreen = matchMedia("(display-mode: fullscreen)"); 23 24 fullscreen.onchange = () => { 25 if (fullscreen.matches) { 26 document.body.classList.remove("fail"); 27 } 28 } 29 30 if (!fullscreen.matches) { 31 document.body.classList.add("fail"); 32 } 33 </script> 34 <p> 35 To pass, the background color must be green after installing. 36 </p>