-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Editorial review: Device Posture API #37595
Conversation
Preview URLs (10 pages)
Flaws (8)Note! 7 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
External URLs (6)URL:
URL:
URL:
URL:
URL:
(comment last updated: 2025-02-07 10:50:13) |
LGTM |
Thanks for reviewing, @darktears! @estelle, this is now ready for your editorial review. Note that the dom-examples demo that I link to in this PR will 404 until mdn/dom-examples#292 is merged. You can see an example of the same demo at https://device-posture-test.glitch.me/. |
![]() edit: figured out the issue. 128 is origin trial, which this device is not part of edit: reads as continuoius in chrome when emulating folded edit: samsung internet has it on by default, so it works in the @browserstack emulator, but always says continuous (only options on emulator and browserstack are to have it fully flat (180deg) or folded (360deg), not folded at any other angle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "device posture" needs to be defined.
we can either define it in the intro of all of these pages, or create a glossary and link to it.
@@ -37,6 +37,7 @@ When designing reusable HTML components, you may also use [container queries](/e | |||
- {{cssxref("@media/color-index", "color-index")}} | |||
- {{cssxref("@media/device-aspect-ratio", "device-aspect-ratio")}} | |||
- {{cssxref("@media/device-height", "device-height")}} | |||
- {{cssxref("@media/device-posture", "device-posture")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this is not in the css media queries specification, this gets added under "related concepts" rather than here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate why you are saying this, but I worry that this will make the device-posture
descriptor hard to find on the page. It would surely be more useful to put it in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CSS media queries are defined in the Device Posture spec. In that regard in makes no difference than "being defined in the CSS spec". It's just so that the feature is defined in the spec it belongs to. It doesn't make it "less official".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these module landing pages are about the module - the spec - not about any individual features.
Those looking for a list of descriptors would go to the @media page.
those wanting to learn about the spec would to to this page. That is why this link has to be moved.
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few edits and we're good to go
## Examples | ||
|
||
```js | ||
const postureOutput = document.querySelector("p"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const postureOutput = document.querySelector("p"); | |
const postureOutput = document.querySelector("#currentPosture"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
} | ||
``` | ||
|
||
To see the above code in action, view the [Device Posture API demo](https://mdn.github.io/dom-examples/device-posture-api/) on a foldable device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To see the above code in action, view the [Device Posture API demo](https://mdn.github.io/dom-examples/device-posture-api/) on a foldable device. | |
To see the above code in action, view the [Device Posture API demo](https://mdn.github.io/dom-examples/device-posture-api/) on a foldable device. Your browser developer tools enable emulating foldable devices, but current tools don't include emulating partially folded devices, only fully open or closed devices, so they will always return `continuous`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am pretty confident this is true. (tested dev tools and browserStack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this sounds plausible. I have rewritten it a bit and included it here and on the Examples section of the main Device Posture API landing page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to address https://github.com/mdn/content/pull/37595/files#r1942113759 and this PR is good to go.
OK, done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🎉
Description
Chrome 132 supports the Device Posture API, which provides functionality to create user interfaces that adapt to a foldable device's posture and respond to posture changes.
Specifically, it adds:
DevicePosture
interface, which is accessed via thenavigator.devicePosture
property.device-posture
media query feature.This PR adds docs for all the features of the API.
See https://chromestatus.com/feature/5185813744975872 for the data source.
Also see https://developer.chrome.com/blog/foldable-apis-ot for a tutorial with some info.
Also see mdn/dom-examples#292 for my PR to add a demo to the
dom-examples
repoMotivation
Additional details
Related issues and pull requests