Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test browser, minimal-ui, and fullscreen values of the display member #24380

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<title>Test "browser" value of display member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-browser" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-member-media-feature-browser.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Testing support for "browser" value of display member + media feature</h1>
<style>
.fail {
background-color: red;
}

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

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

if (!browser.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
@@ -0,0 +1,3 @@
{
"display": "browser"
}
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<title>Test "fullscreen" value of display member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<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="display-member-media-feature-fullscreen.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Testing support for "fullscreen" value of display 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>
@@ -0,0 +1,3 @@
{
"display": "fullscreen"
}
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<title>Test "minimal-ui" value of display member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-minimal-ui" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-member-media-feature-minimal-ui.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Testing support for "minimal-ui" value of display member + media feature</h1>
<style>
.fail {
background-color: red;
}

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

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

if (!minimalUi.matches) {
document.body.classList.add("fail");
}
</script>
<p>
To pass, the background color must be green after installing.
</p>
@@ -0,0 +1,3 @@
{
"display": "minimal-ui"
}
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8
@@ -1,10 +1,11 @@
<!DOCTYPE html>
<title>Test that display member plus media feature is supported</title>
<title>Test "standalone" value of display member + media feature</title>
<link rel="help" href="https://w3c.github.io/manifest#display-member" />
<link rel="help" href="https://w3c.github.io/manifest/#the-display-mode-media-feature" />
<link rel="manifest" href="display-member-media-feature.webmanifest" />
<link rel="help" href="https://w3c.github.io/manifest/#dom-displaymodetype-standalone" />
<link rel="manifest" href="display-member-media-feature-standalone.webmanifest" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<h1>Testing support for display member plus media feature</h1>
<h1>Testing support for "standalone" value of display member + media feature</h1>
<style>
.fail {
background-color: red;
Expand Down
@@ -0,0 +1 @@
Content-Type: application/manifest+json; charset=utf-8