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

First pass as adding a Client Hint for Display Mode #977

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
41 changes: 40 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2411,6 +2411,44 @@ <h4>
</section>
</section>
</section>
<section data-cite="CLIENT-HINTS-INFRASTRUCTURE">
<h2>
Client Hint
</h2>
<p class="note">
Developers often need to know details about how their web app is being
rendered in order to make content-negotiation decisions. Though this
information is accessible via JavaScript, when sent as part of a
[=request=], servers are empowered to do the content-negotiation
earlier in the process of setting up the web app, before JavaScript
execution takes place. To convey this information, this document
provides for the `Sec-CH-Display-Mode` [=client hints token=]:
</p>
<ul>
<li>`Sec-CH-Display-Mode` whose value is a suitable [=display modes
value=]
</li>
</ul>
<section>
<h3>
The 'Sec-CH-Display-Mode' Header Field
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
</h3>
<p>
The <dfn data-local-lt=
"display mode client hint">Sec-CH-Display-Mode</dfn> request header
field gives a server information about the [=display mode=] in which
the user agent plans to display the web app. It is a <a data-cite=
"rfc8941#section-3">Structured Header</a> whose value MUST be a valid
<a data-cite="rfc8941#section-3.3.3">string</a>.
</p>
<p>
The header's <abbr title="Augmented BNF for Syntax">ABNF</abbr>, as per [[rfc5234]], is:
</p>
<pre class="abnf">
Sec-CH-Display-Mode = sf-string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be

Suggested change
Sec-CH-Display-Mode = sf-string
Sec-CH-Display-Mode = "fullscreen" / "standalone" / "minimal-ui" / "browser"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m apprehensive about locking this down to specific values, especially as the display mode may be one of the overrides not defined in this list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, well we should just expand the list. We can update the spec at any time, so there is no reason not to keep this list in sync.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would also want to have this possibly be values that end up in manifest-incubations spec - not sure the best way to do this spec-wise, but referencing display-mode is probably a good way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep this extensible, hence: "whose value is a suitable [=display modes value=]"

</pre>
</section>
</section>
<section id="priv-sec">
<h2>
Privacy and security considerations
Expand Down Expand Up @@ -3016,7 +3054,8 @@ <h2>
}
return !/^editorial|^chore|^\[chore|^fix|^refactor|^tests?|^docs|^typo|^nit/i.test(message);
}
</script> <rs-changelog from="fef12b3e313bb61d9434da73dc565132d8f4c483"
</script>
<rs-changelog from="fef12b3e313bb61d9434da73dc565132d8f4c483"
filter="removeCommits"></rs-changelog>
</section>
<section class="appendix informative">
Expand Down