w3c / device-posture

Device Posture API
https://www.w3.org/TR/device-posture/
Other
32 stars 20 forks source link

Device posture and direction interaction #151

Open aphillips opened 2 months ago

aphillips commented 2 months ago

(no particular section) https://www.w3.org/TR/device-posture/

The device posture spec provides an API to report whether a device is continuous or folded (and changes between these device postures). This works with, for example, foldable devices to allow for richer experiences, such as those mentioned in the very nice explainer:

It's unclear if any thought has been given, in the larger scope described by the explainer, to the impact of text direction or writing mode on the various APIs/properties. Some languages/cultures have variant 'page turn direction' expectations for vertical folding (see, for example, EPUB's page-progression-direction. The device posture API isn't directly affected by this, but the group might want to include scenarios and requirements from this larger perspective (to avoid conflicts between physical positioning (left/right) vs. logical positioning (start/end).

anssiko commented 2 months ago

Thank you @aphillips for sharing this i18n review feedback! What references would you recommend the WG should look at for text direction and writing mode considerations?

(This feedback is related to the i18n review request: https://github.com/w3c/i18n-request/issues/233)

xfq commented 2 months ago

Some languages/cultures have variant 'page turn direction' expectations for vertical folding

To give some examples, for Chinese, Japanese, and Korean books in vertical writing mode, pages are progressed from right to left, although personally I haven't found any direct impact on this API.

darktears commented 1 month ago

I believe it's an author/web developer issue independently of the posture of the device. Even if a foldable is used in a half-folded state like a book, text direction needs to be respected like the device was being used flat. At least this API allows developers to align the content perfectly and know about the various segments thanks to the Viewport Segments API making the experience better for users. It's an opt-in feature meaning developers need to write new code, no layout change happens automatically because of the posture of the device (at least not in Chromium based browsers).

I'm not sure what we should do in the spec beside a note but then it's just a normal guideline like many others so probably not useful to add specifically written in this spec.