Repository navigation
Reflect the application context in the display-mode media feature - #1218
Conversation
|
@copilot, can you fix the indenting on the |
dmurph
left a comment
There was a problem hiding this comment.
Based on manifest editor meeting chat, we can remove the re-statements of manifest application on browsing contexts, as the definition of an installed web application imlpies that - e.g. it must be true if installed web application is true.
Other than that, the intention here lgtm and I'm sure there are small style things that can be fixed. but other than queueing an event (which I think marcos has in a comment) directionally lgtm
There was a problem hiding this comment.
Pull request overview
Adds specification text for a new installed CSS media feature to let documents detect whether the current top-level traversable is running as an installed web application (application context), including cross-origin iframe behavior and privacy considerations.
Changes:
- Defines the
installedmedia feature withinstalled/nonevalues and boolean usage semantics. - Adds normative requirements for cross-origin nested documents and for updating media query evaluation on transitions.
- Documents privacy properties and includes examples for CSS and
matchMedia()usage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Awesome to see that we're adding normative spec text for Without being aware we were looking to merge this; I recently had taken a crack at an explainer/WICG proposal for this at WICG/proposals#288 My current proposal is that we shift from a boolean media feature to an enumerated one, for reasons outlined in the Explainer (namely context clarity and extensibility). Do you think that would make sense to reflect in the spec text here, or do we have compelling reasoning for having a boolean feature? |
|
|
|
Yup, I'll open a PR on the CSSWG for the spec text! Would appreciate a cursory look on the initial draft PR that I throw up there so that we can iterate on exact wording and behavior before I add specific CSS WG reviewers. UPDATE - PR is here: w3c/csswg-drafts#14587 |
@marcoscaceres w3c/csswg-drafts#14587 has merged! |
|
Ok, nice! We should have at least one implementation proving it works before we merge. I’ll try to update the WebKit PR this week. |
|
I maintain [openpwa.net](https://openpwa.net), where I track PWA compatibility across browsers. There's another compatibility issue worth highlighting here. Firefox 143+ on Windows uses On iOS 26+, websites added to the Home Screen now open as web apps by default, even without a manifest. But detecting that context still relies on platform-specific behavior like So developers can't simply check I think the underlying issue is that we're using display modes to detect application context, even though these are two different things. A single I've documented the Firefox behavior and implementation details here: https://openpwa.net/reference/platforms/firefox-taskbar-web-apps/ |
…ture https://bugs.webkit.org/show_bug.cgi?id=314609 rdar://176851836 Reviewed by NOBODY (OOPS!). `display-mode: application` matches when a web application manifest is applied or the Standalone setting is on. It matches alongside the display mode the page already reports, as Media Queries 5 now allows. With the Standalone setting on and no manifest, the page reports `standalone`. Spec changes: w3c/manifest#1218 w3c/csswg-drafts#14587
|
WebKit has an implementation ready for review: WebKit's pull request. It turned up two problems. The fixes are up in Media Queries 5: browser and cross-origin frames. I'd keep this PR blocked until we settle them. Media Queries 5 says Media Queries 5 also says embedded frames match the top-level page, so any frame, from any site, can tell the page is an installed app. |
|
@cmzz thanks. That is the value this pull request adds. Your iOS 26 example needs one more fix. This spec counts a page as an application context only when a manifest is applied, so an app that the browser makes without a manifest did not clearly count. Let user agents process a manifest for a document with no manifest link closes that gap. |
|
@marcoscaceres wrote:
Just a suggestion, but could one solution be to deprecate the |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
f9a44ae to
14aab0b
Compare
Closes #1092
Requires the user agent to reflect whether the top-level traversable is an application context through the
applicationvalue of thedisplay-modemedia feature. This follows the CSS Working Group's review in w3c/csswg-drafts#14125 ("Request for review:application-contextmedia feature (Web App Manifest)"). It depends on a Media Queries 5 change, not yet written, that defines theapplicationvalue and lets more than onedisplay-modevalue match at once. It replaces the separateapplication-contextmedia feature this PR originally added.This change (choose at least one, delete ones that don't apply):
Implementation commitment (delete if not making normative changes):
Commit message:
Reflect the application context in the
display-modemedia featureDocuments can query
(display-mode: application), to be defined in Media Queries 5, to detect whether they are running in an application context.Preview | Diff